#1 2021-06-27 08:41:54

jonsafi
Member
Registered: 2011-07-26
Posts: 58

mORMot2: SQL and the 'old' ExecuteList

Hello,

am trying out the nice brand new mORMot2 with Lazarus (2.1) and FPC 3.3.1.
Was able to compile and run the sample  01-StandAloneORM kindly converted by Martin Doyle.
However, the following will not compile as ExecuteList is not found for TRestClientDB.

Var
  GG_globalClient:  TRestClientDB;
sql_str :String;
   data1    : TOrmTable; 
    sql_str  := 'SELECT * FROM My_Table WHERE ...';
    data1   := GG_globalClient.ExecuteList([], sql_str);

Am I missing something or is there currently no way to run free
SQL statements in mORMot2?

Any hints are much appreciated,
Sami

Offline

#2 2021-06-27 08:59:14

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

Re: mORMot2: SQL and the 'old' ExecuteList

Use the new TRestClientDB.Orm field.

Offline

#3 2021-06-27 09:49:25

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: SQL and the 'old' ExecuteList

Many thanks, works very nicely!
Just had to add .orm in between:

GG_globalClient.Orm.ExecuteList([], sql_str);

Offline

Board footer

Powered by FluxBB