OdxSetVariable
OdxSetVariable sets the value of any SQL Transact variables that are
in the SQL statement.
Syntax
OdxSetVariable @cursor, @variable_name, @value
@cursor integer input
Cursor number.
@variable_name varchar input
The SQL-Transact variable name
@value (any data type) input
The value to be assigned to the variable. Data type must match the variable
data type.
Options
Example
This example uses a QUALIFY statement to qualify rows using criteria
that is bound to the statement after the statement is defined.
-- qualify rows using MDK indexes
exec @status = OdxParseSql @cursor_num, 'qualify customers where company
= @kwd'
if @status <> 0 goto exit_label
-- bind the keyword
exec @status = OdxSetVariable @cursor_num, '@kwd', 'boe*'
if @status <> 0 goto exit_label
-- execute the sql and get the qualifying count
exec @status = OdxExecuteSql @cursor_num, @qual_count output
if @status <> 0 goto exit_label
print 'Rows qualified: ' + convert(varchar(32), @qual_count)
Top
|