Recent

Author Topic: How to execute a query directly without prepare, unprepare  (Read 1674 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: 14377
  • Sensorship about opinions does not belong here.
Re: How to execute a query directly without prepare, unprepare
« Reply #1 on: November 25, 2018, 12:31:40 pm »
executedirect?
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
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 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

 

TinyPortal © 2005-2018