• Welcome, Guest. Please login.
 
September 16, 2021, 09:27:59 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.

Messages - Fim

31
Yes my intention is to pull the MIN and MAX values from a range of rows using SQL, but how?

/Fim W
32
Thanks.
I will have a look at it.
/Fim W.
33

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
34
Thanks, now I know.
/Fim W.
35
I know that SQLite can handle UTF-16.
I have tested it and it works as I whish.
In my example slExe(RAD_IN, "E2") I was doing wrong, I had declareted RAD_IN as WSTRING.
As far as I understand it should be like this:

DIM RAD_IN AS STRING
DIM NYTT AS WSTRING
NYTT = "ABCD"
RAD_IN = "INSERT INTO ORD (ORDET) VALUES(NYTT)"
SLEXE(RAD_IN, "E2")

Right??
/Fim W

36
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.
37
Thank you for all the tips and advice. Because it's a bit difficult with division with zero, I've decided to go another way. I will ensure that term PRISKVANT is always greater than zero.
/Fim
38
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
39
I will try to use the slexebind.
I will bee back.

/Fim W.
40
I will have a look at it.
/Fim W.
41
Paul,

Is all in one transaction.
/Fim
42
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.
43
Thanks. Now I feel safer.
/Fim W.
44
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.