Recent

Author Topic: How to execute a query directly without prepare, unprepare  (Read 1085 times)

mek

  • New member
  • *
  • Posts: 8
How to execute a query directly without prepare, unprepare
« on: November 25, 2018, 05:02:45 am »
In procedure TSQLConnection.ExecuteDirect,
Every sql query go through
Quote
   
PrepareStatement(Cursor,ATransaction,SQL,Nil);
Execute(Cursor,ATransaction, Nil);
UnPrepareStatement(Cursor); 
Is there a way to execute sql without prepare?


Thaddy

  • Hero Member
  • *****
  • Posts: 9449
Re: How to execute a query directly without prepare, unprepare
« Reply #1 on: November 25, 2018, 12:31:40 pm »
executedirect?
also related to equus asinus.

mangakissa

  • Hero Member
  • *****
  • Posts: 962
Re: How to execute a query directly without prepare, unprepare
« Reply #2 on: November 27, 2018, 10:02:55 am »
Don't use the execute of TSQLConnection, but the TSQLquery.execsql.
SQLdb doesn't prepare the query. Your database does. It prepares the query to check if the query is valid. Then it will executed. It also caches you query to use it if the query is the same.
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10