#1 2021-12-01 13:27:01

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

External DB function Problem (mormot2)

Hi Arnaud

atm im struggling with an external Oracle DB - I used both ConnectionProperties:  TSqlDBOracleConnectionProperties and TSQLDBUniDACConnectionProperties (for Oracle)

i use code like this:

var LVariant := RestModel.RetrieveDocVariantArray(TSQLEOR_SomeRecord,'', 
'trunc(DateTimeField) = trunc(sysdate)' ,  // <-- SQLite Error Oracle SQL Function sysdate unknown
 [] , 
'ID, DateTimeField, Field1, Field2, Field3,')

Example for other Oracle functions not working:

to_char( datetimefield, 'YYYY-MM-DD' ) = '2021-12-01'  // SQLite Error: to_char unkown
trunc( datetimefield ) = to_date('2021-12-01', 'YYYY-MM-DD')");  // SQLite Error: to_date unknown

trunc is also unkown smile

Is there a possibilty to let SQLite know the functions or to get the Query run
Why does SQLite have to know the functions ?

Best Regards

Last edited by itSDS (2021-12-01 14:50:20)


Rad Studio 12.1 Santorini

Offline

#2 2021-12-01 17:11:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: External DB function Problem (mormot2)

This is not supported because SQlite3 and Oracle are not at all compatible about date types.

The easiest is to call directly the Oracle DB ConnectionProperties, returning the result as JSON, then fill your ORM from this JSON.

Offline

Board footer

Powered by FluxBB