Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

FireDac: any way to get SQL data as an object?

$
0
0

Hi,
I was wondering whether it's possible to actually get the result of an SQL statement as an object?
Did anybody typecast a result into an object?

Something like:
The class TProduct has a idProduct: integer, idName:String, idPrice:integer and equivalent fields in a Database, is it possible to get the select from the DB and avoid the idProduct := sql.FieldByName("idProduct").AsInteger, etc... ? A kind of auto field matching, filling the variables automatically (besides blobs)?

The example here is simple, but when you have 20+ fields it's more cumbersome: you need to manually assign each field.
That would be convenient too to write data into the DB.
I'd like to avoid storing the class as a BLOB so we can still query the values.

Thanks for any guidance.

Steve


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>