nextVal Method

Class: Db

Description

This method returns the highest key value +1 from the specified table. Only use this method with tables that have numeric key values.

Syntax

Db.nextVal(literal String table,literal String accessKeys)

Parameters

table

A valid database table name.

accessKeys

A comma-separated list of access keys for the table.

Returns

The next available key value (i.e., the highest key value +1).

When Became Available

v6.0

Example

set CID = Db.nextVal ("DEP") // Next deposit account number

set seq = Db.nextVal("HIST","CID") // Next history sequence

                                   // for CID account