11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SQLPrepare<br />

Syntax<br />

status = SQLPrepare (statement.env, statement)<br />

Note: This function is case-sensitive. If you want it to be case-insensitive, you<br />

must compile your programs using the BASIC command with the -i option.<br />

Description<br />

SQLPrepare passes an SQL statement or procedure call to the data source in order<br />

to prepare it for execution by SQLExecute.<br />

Use this function to deliver either an SQL statement or a call to an SQL procedure to<br />

the data source where it can prepare to execute the passed SQL statement or the<br />

procedure. The application subsequently uses SQLExecute to tell the data source to<br />

execute the prepared SQL statement or procedure.<br />

What happens when the data source executes the SQLPrepare call depends on the<br />

data source. In many cases the data source parses the SQL statement and generates<br />

an execution plan that allows rapid, efficient execution of the SQL statement.<br />

Use SQLPrepare and SQLExecute functions when you are issuing SQL statements<br />

or calling a procedure repeatedly. You can supply values to a prepared INSERT or<br />

UPDATE statement and issue an SQLExecute call each time you change the values<br />

of parameter markers. SQLExecute sends the current values of the parameter<br />

markers to the data source and executes the prepared SQL statement or procedure<br />

with the current values.<br />

Note: Before you issue an SQLExecute call, all parameter markers in the SQL<br />

statement or procedure call must be defined using an SQLBindParameter call,<br />

otherwise SQLExecute returns an error.<br />

If the parameter type of an SQLBindParameter procedure is<br />

SQL.PARAM.OUTPUT or SQL.PARAM.INPUT.OUTPUT, values are returned to<br />

the specified program variables.<br />

SQLPrepare 1-841

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!