Recent

Author Topic: How to execute a query directly without prepare, unprepare  (Read 1258 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: 10490
Re: How to execute a query directly without prepare, unprepare
« Reply #1 on: November 25, 2018, 12:31:40 pm »
executedirect?
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

mangakissa

  • Hero Member
  • *****
  • Posts: 1090
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