Cricketer
|
| Posted: 04/30/2002, 4:01 PM |
|
I have created a basic table (cricketer_id, name, club) with the primary key being an auto incremented number and here is the code below:
CREATE SEQUENCE "cricketer_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
CREATE TABLE "cricketers" (
"cricketer_id" int4 NOT NULL DEFAULT NEXTVAL('cricketer_id_seq'),
...(blah blah .. more sql statements)
How do I make adding a new cricketer automatically give the "cricketer_id" a unique incremented number?
I found below line in the help file but couldn't quite figure out how/where to use it.
fldPK=dlookup("dual", "sequence.nextval", "")
|
|
|
 |
Nicole
|
| Posted: 05/02/2002, 3:35 AM |
|
Hello,
just select cricketer_id field on CC record form as 'Key' field and set its type to Hidden. CC will generate all the necessary code for you.
As for mentioned code it could be used in Before Insert event to retrieve the sequence value that is to be inserted (e.g. when you want to pass it from the form).
|
|
|
 |
|