Cicode Programming Reference > Cicode Function Categories > SQL Functions > SQLQueryCreate

SQLQueryCreate

The function creates a new query and returns its handle. The query is empty and has to be set by using SQLSet() and/or SQLAppend() functions. The query handle can be used with the statement functions as SQLExec() or SQLGetRecordset().

Queries allocated by SQLQueryCreate should be disposed by SQLQueryDispose when no longer necessary. Each DB connection object has one default query which is created and disposed automatically. The default query need not be disposed by the function SQLQueryDispose.

This function can be called in the foreground or background.

Syntax

SQLQueryCreate(hSQL)

hSQL:

The handle to the DB connection object, returned from either SQLCreate() or SQLConnect() function. The handle identifies the DB connection object where details of the associated SQL connection are stored.

Return Value

The handle to the query if successful, otherwise the invalid handle.

Related Functions

SQLSet, SQLAppend, SQLExec, SQLGetRecordset, SQLCall, SQLGetScalar, SQLEnd, SQLQueryCreate, SQLQueryDispose, SQLNumChange, SQLNoFields, SQLNumFields, SQLFieldInfo, SQLGetField, SQLIsNullField, SQLRowCount, SQLNext, SQLPrev

See Also

SQL Functions

Published June 2018