Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

SQL Reference

Commands

Syntax

Options

Example

 

SQL Reference

Joins

Nested Queries

Set Operations

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

 

OPEN CURSOR

Opens a cursor. This statement is used in ODXSQL and can be passed in OmniAccess API applications through oaexecsql, as an alternative to oaopencursor.

Since each Statement object is opened and closed on its own cursor, this command is not relevant to JDBC and ODBC applications, although it is technically supported.

Each time OPEN CURSOR is called, the new cursor becomes the current cursor in the cursor parameter of the status array. Cursor numbers are assigned automatically.

In ODXSQL, unless the NOCURSOR option is set, a cursor is automatically opened when a connection is made to an Omnidex environment.

See Also: CLOSE CURSOR

 

Syntax

OPEN CURSOR [ON [INSTANCE] instancenumber] [WITH options]

OPEN CURSOR
Required.

ON INSTANCE instancenumber
Optional. instancenumber is the integer instance number assigned when the connection was made to the database. The ON keyword is required if specifying the instance number. The INSTANCE keyword is optional.

[WITH options]
Optional - Specify options to be used for this command.

 

Options

IA

DA

OA

IABASEID

OPTIMIZATION

ESCAPE

APPROX_MATCH

TOLERANCE

TIMEOUT

ASK_RETRIEVAL_THRESHOLD

MDK_RETRIEVAL_THRESHOLD

SORTED_MULTIFIND_THRESHOLD

REQUIRED_OPTIMIZATION

 

Example

Cursor 1 and Instance 1 are automatically created during the first connect.

>connect /users/orders.env
>set cursordisplay on

A second cursor is opened on instance 1.

>open cursor
Opened cursor 2

A new connection is opened on Instance 2. A cursor is automatically opened and is assigned the next available integer as its cursor number, in this case, cursor 3. Instance 2 and cursor 3 become the "current" instance and cursor.

>connect /users/garment.env
Connected to /users/garment.env on instance 2, cursor 3

A new is opened on the current instance, instance 2.

>open cursor
Opened cursor 4

Close cursor 2. Remember this cursor was owned by instance 1. A call to close cursor leaves the "current" instance and cursor undefined.

>close cursor 2
Closed cursor 2

Set cursor 4 to be the current cursor.

>set cursor 4
Current instance is now 2, and current cursor is now 4

Open another cursor. The new cursor is assign the number 2.

>open cursor
Opened cursor 2.
>

Top