GetNextNumberWithGaps

Mon 01 January 2018

Syntax

GetNextNumberWithGaps(record.field, max_number, increment [, WHERE_Clause, paramlist])

Where paramlist is an arbitrary-length list of values in the form:

var1 [, var2] ...

Description

Use the GetNextNumberWithGaps function to determine the highest value in a table for the field you specify, and return that value plus increment .

Note: This function has been deprecated and remains for backward compatibility only. Use the GetNextNumberWithGapsCommit function instead.

This function also enables you to specify a SQL WHERE clause as part of the function for maintaining multiple sequence numbers in a single record.

Note: GetNextNumberWithGaps also issues a COMMIT after incrementing the sequence number if no other database updates have occurred since the last COMMIT. This limits the time a database lock is held on the row and so may improve performance.

Parameters

Field or Control

Definition

record.field

Specify the record and field identifiers for the field for which you want the new number. This is the recommended way to identify the field.

max_number

Specify the highest allowed value for the field you're incrementing. You can specify up to 31 digits for this value.

increment

Specify the value you want the numbers incremented by. You can specify up to 31 digits for this value.

WHERE_Clause

Specify a WHERE clause for maintaining multiple sequence numbers.

paramlist

Parameters for the WHERE clause.

Returns

A Number value equal to the highest value of the field specified plus one.

GetNextNumberWithGaps returns an error if the value to be returned would be greater than max_number . The function returns one of the following:

Numeric Value

Constant Value

Description

Number

N/A

The new number

-1

%GetNextNumber_SQLFailure

SQL failure

-2

%GetNextNumber_TooBig

Number too large, beyond max_number

-3

%GetNextNumber_NotFound

No number found, invalid data format