Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Stored Procedures

SQL Server

Syntax

Options

Example

 

OdxConnectEnv

OdxDisconnectEnv

OdxOpenCursor

OdxCloseCursor

OdxIsConnected

OdxIsOpened

OdxParseSql

OdxSetVariable

OdxSetColumnType

OdxExecuteSql

OdxGetRow

OdxGetColumn

OdxGetLastRowCount

OdxGetVersion

OdxGetErrorMessage

OdxGetPrimaryKeys

OdxGetData

 

SQL Server

 

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