RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLConnection.ExecuteDirect Method

Executes an SQL command that does not include parameters.

Pascal
function ExecuteDirect(const SQL: WideString): Integer;
C++
__fastcall int ExecuteDirect(const BSTR SQL);

Call ExecuteDirect to execute a single parameterless command on the server without the overhead of using an SQL dataset or preparing the statement before it executes. If the statement ordinarily returns a cursor, ExecuteDirect executes the statement, but does not return a cursor. 

SQL is the command to execute. 

ExecuteDirect returns 0 if the command was successfully executed. Otherwise, it returns a dbExpress error code.

Note: To execute an SQL statement that includes parameters or that returns a cursor, use the Execute method instead.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!