Home » U++ Library support » U++ SQL » sqlite3 Custom Function in SqlExp (is it possible?)
sqlite3 Custom Function in SqlExp [message #57384] |
Wed, 28 July 2021 18:37 |
JeyCi
Messages: 50 Registered: July 2020
|
Member |
|
|
I will put a little example (see attached console project) without SqlExp.
As so as simple math functions is problematic to do (e.g. multiply 2 columns), I decided to create Custom Function for this purpose.
Done:
C.F. with #include sqlite3.h from MSYS2 32x mingw gcc 9.3 -- in addition to U++ sqlite3 plug-in; so C.F. was done in foreign lib to U++, but it works in Sql sql; sql.Execute("...") U++ query
Problem:
I would like to use this C.F. in U++ SqlExp Update query & to my viewpoint U++ Update is much quicker than sqlite3 SQL Update (~30 sec per 14000 records plus 30sec for fixing changes in db_sqlite3 )-- as I noticed (U++ SqlExp Update was being done much quicker )... therefore I would like to make this C.F. able to be used as a part of SqlExp or inside SqlExp - in order to use it in quicker U++ Update-Select later on... preferably without Fetching (like here in example for update)
I've got away my attempts with Model for SqlExp from attached project, just left working query...
And the Question is:
Is it possible to use e.g. such C.F. in U++ SqlExp? How to make it to work? (because in my attempts I had no success) -- I'm not attaching these fault attempts
p.s.
for any case: Build Method Common Options -
-msse2 -D__CRT__NO_INLINE -DSQLITE_CORE
All static
Best regards.
[Updated on: Thu, 29 July 2021 04:44] Report message to a moderator
|
|
|
Re: sqlite3 Custom Function in SqlExp [message #57385 is a reply to message #57384] |
Wed, 28 July 2021 19:58 |
JeyCi
Messages: 50 Registered: July 2020
|
Member |
|
|
JeyCi wrote on Wed, 28 July 2021 18:37As so as simple math functions is problematic to do (e.g. multiply 2 columns), I decided to create Custom Function for this purpose.
...
to use it in quicker U++ Update-Select later on... preferably without Fetching
sorry to hurry with this topic - in my final project everything works as I desired - without C.F., normal multiplication, & Update OK in SqlExp
it* Update(j)(IT, Case(t == "C", (f*k)-s) \
(t == "P", s-(f*k)));
- with appropriate SqlIds...
- my real problem is solved
p.s.
in any case:
let the example of C.F. just be in mind...
Best regards.
[Updated on: Wed, 28 July 2021 20:13] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Thu Mar 28 18:28:36 CET 2024
Total time taken to generate the page: 0.01158 seconds
|