You are not logged in.
Pages: 1
hi,
i use a view base class with more overloaded methods that can return an array of selected ids/an array with all field values of selected rows/tobjectlist with all object selected etc etc...
Offline
Please download the following pdf:
http://synopse.info/files/pdf/Synopse%2 … 201.18.pdf
Take a look at the paragraphs about ORM queries.
You have several code sample in there, using either CreateAndFillPrepare/FillOne either TSQLTableJSON.
RTFM!
Offline
sorry eraldo,
i don't understand...you need a method to do a select of view (where "view" is a database view) or you need a method to get an user's selection of record from a view (where "view" is V part in MVC)?
Offline
I suspect you are speaking about a DB view.
The ORM is not able to create a view, by design.
So it was not meant to work with it.
Depending on the backend database engine, it may work - but for instance for SQLIte3 it won't work, since it will try to create a missing table with the view name.
But both the SQLIte3 core and the underlying SynDB*.pas are able to access views.
So you can easily create an interface-based service, run a query on a view, then return it directly as RawJSON to the client.
Then, on the client, use a TSQLTableJSON to work on the context. You can use a dedicated TSQLRecord class mapping the returned view column layout for direct ORM access, with FillOne, as usual.
See sample in directory "SQLite3/Samples/16 - Execute SQL via services" for how to work with SQL queries via services.
Offline
Thank lele9,
Really i'm speaking about the DB view.
The ab is correct. I'm currently using interface-based service, to return to the client a select on a view.
I imagined that someone could be doing this in another way.
Offline
Pages: 1