You are not logged in.
TOrmInvcanceled=class(Torm)
private
Ftestid: PtrInt;
Fxml: rawutf8;
published
property testID: PtrInt read Ftestid write Ftestid;
property xml:rawutf8 read Fxml write Fxml;
end;
procedure errororm;
var lis:ilist<TOrmInvcanceled>; model:TOrmModel;
begin
model:=tormmodel.Create([TOrmInvcanceled]);
Model.VirtualTableRegister(TOrmInvcanceled,TOrmVirtualTableBinary);
srvmem:=TRestServerDB.Create(model);
srvmem.Model.Owner:=srvmem;
srvmem.CreateMissingTables;
showmessage(TOrmInvcanceled.OrmProps.SqlTableRetrieveAllFields);
srvmem.orm.RetrieveIList(TOrmInvcanceled,lis,'testID=?',[1],'*');
end;
The above causes the following error:
Project Project3.exe raised exception class ESqlite3Exception with message 'Error SQLITE_ERROR (1) [SELECT ID,testID,xml FROM Invcanceled WHERE testID=?] using 3.37.0 - no such column: ID, extended_errcode=1'.
if the following is used, no error is returned:
srvmem.orm.RetrieveIList(TOrmInvcanceled,lis,'',[],'*');
Using the following, no error is returned also:
srvmem.orm.RetrieveIList(TOrmInvcanceled,lis,'testID=?',[1],'Row'+TOrmInvcanceled.OrmProps.SqlTableRetrieveAllFields);
Last edited by dcoun (2021-12-18 12:15:12)
Offline
Am I missing something from the documentation in the above?
Offline
It is weird, because it was a problem existing in mORMot 1 already.
Should be fixed with https://github.com/synopse/mORMot2/commit/9cdef61a
Offline
Thank you Arnaud,
There is something more. The following does not work
srvmem.orm.RetrieveIList(TOrmInvcanceled,lis,'ID=?',[1],'*');
nor the following:
srvmem.orm.RetrieveIList(TOrmInvcanceled,lis,'testID=?',[1],'ID,xml');
Should I use RowID?
Thank you in advance
Last edited by dcoun (2021-12-18 14:15:01)
Offline