Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-09

SQLite differences between ExecSQL and SQL

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Usuario Anónimo

What difference exist between

dsTest.ExecSQL('Select * from Vendor where Code = 0');

and

dsTest.SQL := 'Select * from Vendor where Code = 0';

?

Regards.

Reply by email

Luiz Americo Pereira Camara
to Usuario Anónimo
Usuario An?nimo wrote
What difference exist between dsTest.ExecSQL('Select * from Vendor where Code = 0');

ExecSql is used to commands to modify the database state like Insert, Update, Delete, Create Table

and dsTest.SQL := 'Select * from Vendor where Code = 0';

SQL is used to retrieve data, i.e, the Select command. It must be followed by the Open method. So to retrieve the data you must do:

Close;
Sql:= 'select XXX';
Open;

Luiz

Reply by email