DISC

Contents | What's New | Quick Links

 

Omnidex's PL/SQL Interface

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

PL/SQL Syntax

Setup InstructionsSample PL/SQL with Omnidex

 

 

connect_env

is_connected

disconnect_env

open_cursor

is_opened

close_cursor

parse_sql

set_variable

set_column_type

execute_sql

get_row

get_column

get_last_sql_function_code

get_last _row_count

get_version

 

Oracle PL/SQL

Setup

Syntax

Sample

connect_env

 

odx_lib.connect_env( filename, options, username, password )

Parameter
Type
Purpose

filename

varchar2

Omnidex environment filename

options

varchar2

oaconnect options string (optional)

username

varchar2

oaconnect username (optional)

password

varchar2

oaconnect password (optional)

Purpose - to connect to an Omndex environment file

Returns - integer - an instance number to be used for open_cursor

Must be disconnected using disconnect_env when finished, otherwise there will be memory leak.

top

is_connected

 

odx_lib.is_connected( instance_num )

Parameter
Type
Purpose

instance_num

integer

OmniAccess Instance Number returned by connect_env

Purpose - to check if an instance number is valid

Returns - boolean - true if the instance number is valid, false otherwise

top

disconnect_env

 

odx_lib.disconnect_env( instance_num, options )

Parameter
Type
Purpose

instance_num

integer

OmniAccess Instance Number returned by connect_env

options

varchar2

oadisconnect options string (optional)

Purpose - to close the connection to an Omndex environment file

Returns - none

top

open_cursor

 

odx_lib.open_cursor( instance_num, options )

Parameter
Type
Purpose

instance_num

integer

OmniAccess Instance Number returned by connect_env

options

varchar2

oaopencursor options string (optional)

Purpose - open a new cursor

Returns - integer - a cursor number

Must be closed using close_cursor when finished, otherwise there will be memory leak.

top

is_opened

 

odx_lib.is_opened( cursor_num )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

Purpose - to check if an cursor number is valid

Returns - boolean - true if the cursor number is valid, false otherwise

top

close_cursor

 

odx_lib.close_cursor( cursor_num )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

options

varchar2

oaclosecursor options string (optional)

Purpose - close a cursor

Returns - none

top

parse_sql

 

odx_lib.parse_sql( cursor_num, statement, options )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

statement

varchar2

SQL statement

options

varchar2

OmniAccess SQL Parser options string (optional)

Purpose - parse a sql statement

Returns - none

The statement is parsed only. It is not executed.

 

top

set_variable

 

odx_lib.set_variable( cursor_num, name, value )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

name

varchar2

variable name specified in the statement

value

number
date
varchar2

value to be replaced in the statement

Purpose - Assign a value to the variable name specified in the sql statement

Returns - none

Only supports bind value for an IN variable.
No support for an OUT variable.
Currently only supports the following datatypes: number, date, varchar2

top

set_column_type

 

odx_lib.set_column_type( cursor_num, position, column )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

position

integer

the column position in the select list items (start at 1)

column

number
date
varchar2

the output datatype for the column in that position

Purpose - Set the datatype for a particular column in the select list

Returns - none

Valid only on SELECT statement.
The datatype is the datatype of the value passed in the "column" parameter.
Currently only supports the following datatypes: number, date, varchar2

top

execute_sql

 

odx_lib.execute_sql( cursor_num, options )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

options

varchar2

oaexecsql options string (optional)

Purpose - execute the sql statement

Returns - integer - number of rows processed (INSERT, DELETE, and UPDATE)
integer - number of rows qualified (QUALIFY)
integer - 0 for all other statements

top

get_row

 

odx_lib.get_row( cursor_num, options )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

options

varchar2

oafetch options string (optional)

Purpose - fetch rows to an internal buffer

Returns - integer - number of rows fetched (0 or 1)

Valid only on SELECT statement.

top

get_column

 

odx_lib.get_column( cursor_num, position, value )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

position

integer

the column position in the select list items (start at 1)

value

number
date
varchar2

the variable that would receive the value from the internal fetch buffer

Purpose - retrieve the value of a particular column in the select list from the internal fetch buffer.

Returns - none

The variable datatype used in the "value" parameter must match the variable datatype used in the "column" parameter for the define_column.
Currently only supports the following datatypes: number, date, varchar2

 

top

get_last_sql_function_code

 

odx_lib.get_last_sql_function_code( cursor_num )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

Purpose - get the SQL function code from the last statement parsed.

Returns - integer - SQL function code (see the list in OCI manual)

 

top

get_last_row_count

 

odx_lib.get_last_row_count( cursor_num )

Parameter
Type
Purpose

cursor_num

integer

OmniAccess Cursor Number returned by open_cursor

Purpose - get the cummulative count of rows fetched

Returns - integer - row count

 

top

get_version

 

odx_lib.get_version( version, options )

Parameter
Type
Purpose

version

varchar2

buffer to receive the version in string format

options

varchar2

oaversion options string (optional)

Purpose - get the version number

Returns - integer - version number in numeric format

If "options" are not specified, the OmniAccess SQL Bridge version is returned.

 

 

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home