AdsCreateSQLStatement

Advantage Client Engine

Creates an SQL statement object and returns the handle

Syntax

UNSIGNED32

AdsCreateSQLStatement( ADSHANDLE hConnect,

ADSHANDLE *phStatement )

Parameters

hConnect (I)

Connection handle

phStatement (O)

Statement handle returned

Remarks

AdsCreateSQLStatement takes as input a non-zero connection handle value and returns a statement handle for use in subsequent calls to AdsPrepareSQL, AdsExecuteSQL , and AdsExecuteSQLDirect . After a call to AdsPrepareSQL with an SQL statement that contains parameters this statement handle can then be used in calls to the following AdsSet functions to set parameter data:

The statement handle must be closed with the AdsCloseSQLStatement or AdsApplicationExit function call.

Note When using the Advantage Database Server (ADS) SQL statements are sent to the server for processing. Because of this functionality, joins across servers are not possible when using the Advantage Database Server. Joins across servers when using Advantage Local Server, however, are legal.

Example

AdsConnect( "x:\mydata\", &hConnection );

AdsCreateSQLStatement( hConnection, &hStmt );

// EXECUTE STATEMENT, PROCESS DATA, ETC…

AdsCloseSQLStatement( hStmt );

 

Additional Example

See Also

AdsConnect

AdsPrepareSQL

AdsExecuteSQL

AdsExecuteSQLDirect

AdsCloseSQLStatement

AdsStmtSetTableCharType

AdsStmtSetTableLockType

AdsStmtSetTableReadOnly

AdsStmtSetTableRights

AdsStmtSetTableType