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.

SQLBindParameter<br />

Syntax<br />

status = SQLBindParameter ( statement.env, mrk#, data.type, sql.type, prec, scale,<br />

param [ , param.type ] )<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 />

SQLBindParameter specifies where to find values for input parameter markers<br />

when you issue an SQLExecute or SQLExecDirect call. For output parameter<br />

markers, SQLBindParameter specifies where to find the return value of a called<br />

procedure.<br />

Parameter markers are placeholders in SQL statements. Input parameter markers let<br />

a program send user-defined values with the SQL statement when an SQLExecute<br />

or SQLExecDirect call is executed repeatedly. Output parameter markers receive<br />

values returned from a called procedure. The placeholder character is ? (question<br />

mark).<br />

SQLBindParameter tells the system where to find the variables to substitute for<br />

parameter markers in the SQL statement and how to convert the data before sending<br />

it to the data source. You need to do only one SQLBindParameter for each<br />

parameter marker in the SQL statement, no matter how many times the statement is<br />

to be executed.<br />

For example, consider the following SQL statement:<br />

1-788 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

INSERT INTO T1 VALUES (?,?,?);<br />

If you want to load 1000 rows, you need issue only three SQLBindParameter calls,<br />

one for each question mark.

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

Saved successfully!

Ooh no, something went wrong!