DtvLong dal_dbi_ret_max_idn (tab, flg)

Returns a new record ident number in the table passed.

Input Parameters Significance
char *tab table name of the records
char flg table flag:
S = system table
U = user table

Output Parameters Significance
no -

Return Code Significance
value next record ident number

The DataView record ident number always has 10 digits and is - with the exception of the system entries - within a value range of 1000000000 and 2000000000.

The record ident number is generated by the internal number generators as random number. The probability that a returned ident number has already been assigned is calculated as the quotient of the number of existing table entries and the total number of 1000000000. This means that even a if a table is filled with one million records, the probability of a double usage is 1/1000. If the returned ident number has already been assigned, you have to re-initialize the internal random-numbger generator via dal_dbi_res_ran before you call the function for the next time.

Whenever possible, create new records in tables using virtual widgets. DataView will then automatically start all actions required to assign unique record ident numbers. You do not have to explicitly re-initialize the random-number generator using the function dal_dbi_ret_max_idn.