Cicode Programming Reference > Cicode Function Categories > SQL Functions Introduction > SQLSet

SQLSet

Sets a statement string in the SQL buffer. Cicode cannot send an SQL statement that is longer than 255 characters. If you have an SQL statement that is longer than the 255 character limit, you can split the statement into smaller strings, and use this function and the SQLAppend() function to append the statements in the SQL buffer.

Syntax

SQLSet(hSQL, String)

hSQL:

The handle to the SQL connection, returned from the SQLConnect() function. The SQL connection handle identifies the table where details of the associated SQL connection are stored.

String:

The statement string to set in the SQL buffer. The string needs to contain the first part of an SQL statement.

Return Value

0 (zero) if successful, otherwise an error number is returned. (For details of the 307 error code, call the SQLErrMsg() function).

Related Functions

SQLAppend, SQLBeginTran, SQLCommit, SQLConnect, SQLDisconnect, SQLEnd

Example

hSQL = SQLConnect("DRV=QEDBF");
SQLBeginTran(hSQL);
SQLSet(hSQL, "SELECT *")
SQLAppend(hSQL, " FROM EMP");
SQLAppend(hSQL, " ORDER BY last_name");
SQLExec(hSQL, "");

See Also

SQL Functions