Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

OmniAccess API

Functions

Syntax

Options

Example

$VALUES

 

OmniAccess API

Programming Basics

Managing Data

Functions

 

OAASSIGNVALUES

oaassignvalues is used to assign the values contained in a buffer ($VALUES), to be used as selection criteria in oaselect. A call to oaselect that uses $VALUES in its selection criteria, must be followed by a call to oaassignvalues to initialize $VALUES, and then by oafetch. The flow of calls involves oaselect with a $VALUES expression in the criteria, and nested WHILE loops that call oaassignvalues and oafetch.

oaassignvalues is useful for eliminating the overhead of the oaselect process every time the retrieval criterion changes. By performing oaselect outside the oaassignvalues/oafetch loop, the selection process occurs only once. oaassignvalues simply sets up the next row (or number of rows) for oafetch.

oaassignvalues is useful in situations where:

  • the criteria are undetermined, as in an online query application.
  • the criteria are too unwieldy to fit in the criteria parameter of oaselect
  • data is transferred across cursors.

 

Syntax

oaassignvalues (cursor, options, status, label, num_values, values)

cursor -- Is a 32-bit signed integer. This is the value returned by a successful call to oaopencursor and used in the preceding call to oaselect.

options -- Is a 256 byte maximum Character string. The options parameter is currently reserved and must contain a semicolon or a null character

status -- Status returns information about the success or failure of the oaassignvalues routine. See Status Array.

label -- Is a character value passed by reference that contains an alphanumeric alias for $VALUES. The label can be up to 32 characters long, enclosed in single quotes, and must match the label used in the $VALUES expression of oaselect . It is used to resolve ambiguities in oaselect statements where the oaselect criteria contains several $VALUES expressions.

num_values -- Is a 32-bit signed integer and passes the number of values contained in the data parameter. num_values must be equal to or less than the number of parameters specified for $VALUES in oaselect. If no number parameter was specified for $VALUES in oaselect, then num_values must be 1

values -- values is an array, passed by reference, that contains n elements where n is the value of num_values. Each element must be of a size and format to contain a value, as specified by the $VALUES expression of the preceding oaselect.

 

Options

There are currently no options available for use with oaassignvalues. Support was added for future enhancements.

 

Example

OASELECT(0,"CHAR",STATUS,"CUSTOMERS","COMPANY,CONTACT,PHONE",
"ACCOUNT_NO=$VALUES")

OAASSIGNVALUES(0,,STATUS,,1,1234)

OASELECT - 0 is the cursor number, "CHAR" is the option applied to the select, STATUS is a reference to the Status Array, "CUSTOMERS" is the table to retrieve the data from, "COMPANY,CONTACT,PHONE" are the columns to retrieve, "ACCOUNT_NO IN $VALUES" is the criteria.

OAASSIGNVALUES - 0 is the cursor number, "CHAR" is the option applied to oaassignvalues, STATUS is a reference to the Status Array, no label is applied for this $VALUES token, 1 value is contained in $VALUES, 1234 is the value contained in $VALUES.

This example will return a single record: the company, contact and phone columns from the customers table for a row with an account number of 1234.

 

Top