GetNextNumberWithGapsCommit
Mon 01 January 2018Syntax
GetNextNumberWithGapsCommit(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 GetNextNumberWithGapsCommit function to return the sequence number value plus increment for the given field residing in the given record . 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.
This function is typically used for obtaining a new sequence number for the application, for example, getting a new Purchase Order number to be used in the application transaction.
Use this function instead of the GetNextNumberWithGaps function. The GetNextNumberWithGaps function is very restrictive in its usage. The GetNextNumberWithGapsCommit function can be used in any event. The sequence number ( record.field ) is incremented right away and it doesn't hold any database internal row lock beyond the execution of this function.
Note: A secondary database connection is used to increment and retrieve record.field . The default behavior is to keep the secondary database connection persistent in order to improve performance for the next GetNextNumberWithGapsCommit usage. If the database administrator finds the persistent connection too high an overhead for the production environment (which should not be the case since PeopleSoft uses application server to mulitplex the database connection), the database administrator can change the default behavior to use an on-demand connection method. The persistent second connection is disabled using DbFlags bit eight in the application server and process scheduler configuration files. The second connection can be completely disabled using DbFlags bit four in the application server and process scheduler configuration files
Parameters
Field or Control |
Definition |
---|---|
record.field |
Specify the record and field names 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 SQL Where clause for maintaining multiple sequence numbers. |
paramlist |
Specify the parameters for the SQL Where clause. |
Returns
A number value equal to the highest value of the field specified plus one increment.
The GetNextNumberWithGapsCommit function 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 |
None |
The new number |
-1 |
%GetNextNumber_SQLFailure |
SQL failure |
-2 |
%GetNextNumber_TooBig |
Number returned is too large, beyond max_number . |
-3 |
%GetNextNumber_NotFound |
No number found, invalid data format. |