Getnextkey – Kofax DM API User Manual
Page 220

200 C
HAPTER
4
GetNextKey
GetNextKey
GetNextKey generates the next numeric value for a primary key
column in the SQL database. This is true for all SQL database software
that DM supports. However, the manner in which the GetNextKey
method functions in an Oracle database environment differs slightly
from how it functions in a Microsoft or a Sybase database environment.
The Usage section will note these differences.
Syntax
PCDSQL.GetNextKey( strTableName )
Parameter
Returns
The GetNextKey method returns a long integer that contains the key
value after the previous value for the specified (or default) key is
incremented by 1.
Usage
In order to understand how the GetNextKey input parameter is used,
the API user must know how the GetNextKey method and the SQL
database work together. This discussion summarizes the operational
link as it applies to Microsoft and Sybase SQL database software. A note
explains differences that affect how Oracle SQL database software
operates.
The
DOCS_UNIQUE_KEYS
table in the SQL database stores the most
recently generated key value for each unique key in the database. The
DOCS_UNIQUE_KEYS
table has only two columns: a
TBNAME
column
that normally stores the name of the table for a given key, and a
LASTKEY
column that stores the most recently assigned key value.
strTableName
A string variable that contains the name of the
SQL database table for which the next numeric
key value is requested. Passing no table name
value results in the default primary key value
being incremented.