11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SQLExecute<br />

Syntax<br />

status = SQLExecute (statement.env)<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 />

Use this function to repeatedly execute an SQL statement, using different values for<br />

parameter markers. You must use an SQLPrepare call to prepare the SQL statement<br />

before you can use SQLExecute. If the SQL statement specified in the SQLPrepare<br />

call contains parameter markers, you must also issue an SQLBindParameter call for<br />

each marker in the SQL statement before you use SQLExecute. After you load the<br />

parameter marker variables with data to send to the data source, you can issue the<br />

SQLExecute call. By setting new values in the parameter marker variables and<br />

calling SQLExecute, new data values are sent to the data source and the SQL<br />

statement is executed using those values.<br />

If the SQL statement uses parameter markers, SQLExecute performs any data<br />

conversions required by the SQLBindParameter call for the parameter markers. If<br />

the SQL statement executed produces a set of results, you must use an SQLFreeStmt<br />

call with the SQL.CLOSE option before you execute another SQL statement using<br />

the same SQL statement environment. The SQL.CLOSE option cancels any pending<br />

results still waiting at the data source.<br />

Your application programs should not try to issue transaction control statements<br />

directly to the data source (for instance, by issuing a TRANSACTION COMMIT<br />

statement with SQLExecDirect or SQLPrepare). Programs should use only<br />

<strong>UniBasic</strong> transaction control statements. UniData BCI issues the correct combination<br />

of transaction control statements and middleware transaction control function calls<br />

that are appropriate for the DBMS you are using. Trying to use SQLExecute to<br />

execute explicit transaction control statements on ODBC data sources can cause<br />

unexpected results and errors.<br />

SQLExecute 1-813

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

Saved successfully!

Ooh no, something went wrong!