• Welcome, Guest. Please login.
 
September 17, 2019, 01:55:22 pm

News:

Welcome to the SQLitening support forums!


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Fim

1
According to https://sqlite.org/cli.html item 18, two parameters can be used.
This works ok:
sqlite3 winova.db3 .help
But not this:
sqlite3 winova.db3 .read export.sql
Then I got the error message: Usage: .read FILE
Am I doing something wrong or ....
/Fim W
2
All I've done is to change sqlite3.dll from versions 3.14 to 3.26. Then I get wrong. There is nothing in the log file.
3
I have a database of just over 60 tables. The names are always 3 letters, such as ARB, ART, FAB. Now I intend to insert a table description in each table on rowid = 0.
Is it good or bad?
/Fim W.
4

MIN_MAX_START:
    TEMP_MIN = 100
    TEMP_MAX = -100

MIN_MAX_SELECT:
    SQL_SATS = "SELECT TEMP FROM TEMPERATUR WHERE DATE LIKE " + $SQ + 2017% +$SQ
    slSel(SQL_SATS)

MIN_MAX_READING:
    IF slGetRow = 0 THEN EXIT FUNCTION
    TEMP_=  VAL(slFN("TEMP" ))

MIN_OCH_MAX_LAGRING:
    TEMP_MAX = MAX(TEMP_MAX, TEMP)
    TEMP_MIN = MIN(TEMP_MIN, TEMP)
    GOTO MIN_MAX_READING


Is it possible to solve this in an SQL statement only?
/Fim
5
You've got Questions? We've got Answers! / UTF-16
May 19, 2018, 09:23:43 am
How to put strings coded with UTF-16 in a SQLite databas using SQLItening?

This does not work:

DIM RAD_IN AS WSTRING
slExe(RAD_IN, "E2")

Parameter mismatches definition says the compiler.
/Fim W.
6
SELECT BES_KVANT * PRIS / PRISKVANT FROM IRA

Works as i should, but...
For some records PRISKVANT  is zero.
In that case I will use 1 instead.
But how to put an if-statment in that SELECT-command?
Like  SELECT BES_KVANT * PRIS / (if PRISKVANT = 0 then 1 else PRISKVANT) FROM IRA
Pls, don't say RTM, i have tried.
/Fim
7
I have a conversion program, it reads a sequential file of about 4,000,000 records with 19 fields. For each record I make an INSERT in a table. It takes about 13 hours because compilation of each INSERT takes about 12 ms. Is there any way to use that function in slExeBind that tells SQLite3 to only compile the
SQL statement once and then insert each row re-using the compiled statement?

/Fim W.
8
Are there any differences between
CREATE TABLE HIS (AA PRIMARY KEY, BB, CC);

and

CREATE TABLE HIS (AA, BB, CC);
CREATE UNIQUE INDEX HIS_INDEX0 ON HIS (AA);

/Fim W.
9
I have a Item Master Table ITE with 100,000 items. I want all the items whose item name contains all the keywords. The number of keywords can be 1 to 5.     
Current solution is shown below (maybe something wrong in the translation from Swedish to English)
Is it possible to solve the selection in the server using LIKE or like() ?
STARTING:
    slSel "SELECT ITEM_NO, ITEM_NAMN FROM ITE ORDER BY ITEM_NO"

FETCH_NEXT_ITEM:
    IF slGetRow = %FALSE THEN GOTO ENDING
    ITE.ITEM_NO   = slF(01)
    ITE.ITEM_NAME = slF(02)
    ITEM_NAME = SHRINK$(ITEM_NAME)

SELECT_ITEM:
    IF INSTR(ITEM_NAME, KEYWORD1) = 0 THEN GOTO FETCH_NEXT_ITEM
    IF LEN(KEYWORD2) = 0 THEN GOTO SELECT_ITEM_END
    IF INSTR(ITEM_NAME, KEYWORD2) = 0 THEN GOTO FETCH_NEXT_ITEM
    IF LEN(KEYWORD2) = 0 THEN GOTO SELECT_ITEM_END
    IF INSTR(ITEM_NAME, KEYWORD2) = 0 THEN GOTO FETCH_NEXT_ITEM
    IF LEN(KEYWORD3) = 0 THEN GOTO SELECT_ITEM_END
    IF INSTR(ITEM_NAME, KEYWORD3) = 0 THEN GOTO FETCH_NEXT_ITEM
    IF LEN(KEYWORD4) = 0 THEN GOTO SELECT_ITEM_END
    IF INSTR(ITEM_NAME, KEYWORD4) = 0 THEN GOTO FETCH_NEXT_ITEM
    IF LEN(KEYWORD5) = 0 THEN GOTO SELECT_ITEM_END
    IF INSTR(ITEM_NAME, KEYWORD5) = 0 THEN GOTO FETCH_NEXT_ITEM
SELECT_ITEM_END:

    PRINT ITEM_NO, ITEM_NAMN
    GOTO FETCH_NEXT_ITEM   
   
ENDING:   
     
     
Example:
KEWORD1 = "FOR"
KEWORD2 = "SS"       

Item Names
1 CHASSI FOR SWITCH    <-- Hit
2 CHASSI-STOMME
3 FORMAT-BAND     
4 KASSERAD OMFORMARE   <-- Hit


/Fim W.
10
If a client does not call the server in x minutes, you will get an error -18 at the next call.
Is there any good way to stay connected?
/Fim W.
11
This triggers does not work, what am I doing wrong?
CREATE TRIGGER ARB_TRIGG_05 UPDATE OF FK_KOST ON ARB FOR EACH ROW BEGIN UPDATE VOR SET FK_KOSTN_ARB_SUM = FK_KOSTN_ARB_SUM - OLD.FK_KOSTN + NEW.FK_KOSTN WHERE ORDERNR = NEW.ORDERNR; END
I am making a change of FK_KOST in ARB and want change to update an overruled table VOR.
But FK_KOSTN_ARB_SUM in VOR does not update.

/Fim W.
12
This works well:
CREATE TRIGGER ARB_TRIGG_01 INSERT ON ARB FOR EACH ROW BEGIN UPDATE VOR SET FK_KOSTN_ARB_SUM = FK_KOSTN_ARB_SUM + NEW.FK_KOSTN WHERE ORDERNR = NEW.ORDERNR; END

But not this:
CREATE TRIGGER ARB_TRIGG_01 INSERT ON ARB FOR EACH ROW WHEN OPKOD = 'LEGO' BEGIN UPDATE VOR SET FK_KOSTN_ARB_SUM = FK_KOSTN_ARB_SUM + NEW.FK_KOSTN WHERE ORDERNR = NEW.ORDERNR; END
I do not understand what it's wrong.
Pls help
/Fim W.
13
I have two tables. One ART with all data (except inventory on hand) about all parts.
The other table is LPL with inventory on hand with one record for each part and each stock location.
Now I want a list, for each part where total inventory on hand for each part is less then the reorder point.
Is it possible to put these two SQL-statement into one statement?
SELECT PARTNO, SUM(QOH) AS QOH_SUM FROM LPL GROUP BY PARTNO
SELECT PARTNO, REORDEP, QOH_SUM FROM ART WHERE QOH_SUM < REORDP
As you see QOH_SUM a computed term and not a term in any table.

/Fim W.
14
Can I have two databases simultaneously on a server, such as "Winova.db3" and "Winova-test.db3" without doing anything special on the server? In my progarm, I open one or other database. I think right?

Fim W.
15
Is there any way to unlock a locked database from a client besides going to the server and stopping the service?
/Fim W.
16
How to avoid slSetRelNamedLock displaying an error message?
I will only have a ReturnCode -11, no display.

    SlSetProcessMods ("E0")
    SVAR = slSetRelNamedLocks("+" + PA_NR_X)
    MSGBOX "SVAR=" + STR$(SVAR)

17
SELECT datetime(CURRENT_TIMESTAMP, 'localtime')
Do I get the time from my local PC or the PC that is server?
I can not find any info about this.
/Fim W.
18
I have a calendar of every day from 1 Jan 2015 until 31 Dec 2099.
The days of work-free days are marked with an X in the ARBFRI column. When adding or deleting a work-free day, DAG_LOPNR (work day number) must be recalculated.
I do it in a program, but it takes a very, very long time.
Is there any way to do it in SQLite?
Like this:
UPDATE CAL SET DAY_LOPNR = PREV + 1 WHERE ARBFRI = ''
Here is the beginning of th table:

DATE   ARBFRI DAG_LOPNR
150101                1
150102                2
150103      X         0
150104      X         0
150105                3
150106      X         0
150107                4
150109                5
150110                6
150111      X         0
150112      X         0
150113                7


/Fim W.
19
Is there any compilation of features available in "remote mode" but missing in "local mode"?
/Fim W.
20
But which foreign key?
Somtimes you have more than one foreign key.

/Fim W