Breck Carter
Last modified: October 6, 1997
mail to: bcarter@bcarter.com
Generate Surrogate Keys
The code for generating surrogate or artificial primary keys has been
implemented to address some of the difficulties described in
Intelligent Versus Surrogate Keys.
Click
here
to download fgetcode.zip.
The function f_get_next_surrogate_id takes 4 parameters:
-
string - table name
-
string - column name for which the next surrogate id is needed
-
transaction - e.g., SQLCA
-
boolean - issue a commit after the surrogate_id table is updated
For more documentation refer to the code itself.
See also:
Intelligent Versus Surrogate Keys.
Breck Carter can be reached by phone at (416) 763-5200
or via email at
bcarter@bcarter.com.