Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

OmniAccess API

Functions

Syntax

Options

Example

 

OmniAccess API

Programming Basics

Managing Data

Functions

 

OAUPDATE

oaupdate updates the current row in the database and the Omnidex indexes to reflect the change. oaupdate must follow oafetch. By default, oaupdate waits until the physical file (table) that corresponds to table is accessible, then locks it before updating the row. oaupdate then rereads the row to be sure that it wasn’t updated since it was fetched and then updates the Omnidex indexes.

By default, when a row is updated using oaupdate, data updates are reflected in the Omnidex indexes. This ensures that the OmniAccess search routines “find” rows after they are modified. This feature maintains Omnidex index integrity as rows are updated.

 

Syntax

oaupdate (cursor, options, status, table, columns, buffer)

cursor -- Is a 32-bit signed integer returned by OmniAccess. Cursor is passed by value and was first returned by oaopencursor.

options -- Is a 256-byte character string, passed by reference, and terminated by a semicolon or a null character. It indicates the action or actions for oaupdate to take.

status -- indicates the success or failure of the oaupdate routine. A zero status.error means a successful call to oaupdate. The status structure is passed by reference and contains fourteen 32-bit signed integers, followed by a 36-character buffer.

table -- Is a character value passed by reference, not longer than 33 bytes including a semicolon or null terminator. Table contains the name of the table where the updated row resides.

columns -- Is a character array passed by reference, not longer than 4096 bytes. Separate multiple columns with commas and terminate the array with a semicolon or null character. Columns specifies those columns from table that will contain the data passed in buffer. Columns should contain one or more column names separated by commas. Columns may contain an asterisk ( * ) to retrieve all columns if all columns are represented in buffer.

buffer -- Is an array passed by reference that contains the data to overwrite the columns referenced in columns. Buffer must equal the combined length of the columns referenced in columns. The data in buffer must be in native format. If columns references two columns, one 30-byte character column and one four-byte binary integer column, then buffer must reference a buffer that contains 30 bytes of character data followed by four bytes of binary integer data. Binary data may require conversion when rows are transferred from the server to a client. If you pass the CHAR= noption in the options parameter, buffer should have a character column of length n for each numeric column.

 

 

Options

CHAR=n -- converts character numbers to binary format, where n is the byte length of the input number. The default is 32 bytes. The alphanumeric representation of the values is left justified and space-filled to length n. For more information, see “The CHAR=n option”.

DA -- the data-only option updates the row only in the native table. It does not reflect the update in the OMNIDEX indexes.

NOWAIT -- returns an error condition if the table referenced in table is not available for locking. Without NOWAIT, OMNIDEX queues the lock request until a lock can be placed before the update. For more information, see “The NOWAIT option”.

Passing a semicolon or a null character causes default behavior.

 

 

Example

 

Top