* * *

Author Topic: Any difference between TSQLQuery.Open and TSQLQuery.ExecSQL?  (Read 445 times)

egsuh

  • Full Member
  • ***
  • Posts: 174
Any difference between TSQLQuery.Open and TSQLQuery.ExecSQL?
« on: November 07, 2018, 09:32:13 am »
Firebird now supports 'insert ... RETURNING'.  For example, following SQL statement is valid.

insert into testtable (code, text) values (1, 'code 1') returning code

In Lazarus, I can see the result by SQLQuery1.Open (assuming that content of SQLQuery1.SQL is the above statement).  When there were no 'returning', I would use TSQLQuery.ExecSQL. This does not return any value.

Is there any other difference between ExecSQL and Open of TSQLQuery?

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 483
    • Lebeau Software
Re: Any difference between TSQLQuery.Open and TSQLQuery.ExecSQL?
« Reply #1 on: November 07, 2018, 07:44:32 pm »
Is there any other difference between ExecSQL and Open of TSQLQuery?

Open() allows you to access result sets returned by SQL queries.  ExecSQL() does not, as it is intended to execute SQL queries that do not return result sets.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus