inserting unique id against each record [message #132951] |
Wed, 17 August 2005 00:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
insomniius
Messages: 20 Registered: June 2005 Location: pakistan
|
Junior Member |
|
|
i hve a field list_id in a table(child) which is the primary key as well.
i m not displaying it on the canvas. where as i m inserting multiple records and click the save button at once n using commit_form. how can i insert the unique list_id agaist each id in the database.
list_id is going to be the unique number which will always b inserted against each record.n the number series will go on n on.
|
|
|
|
Re: inserting unique id against each record [message #132958 is a reply to message #132955] |
Wed, 17 August 2005 01:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
insomniius
Messages: 20 Registered: June 2005 Location: pakistan
|
Junior Member |
|
|
martin
i can create the sequence n then the insert statement at the database level trigger...this is wat u hve told me.
but i mentioned wat if i want to do this with commit_form at the save button.
where to apply pre_insert_trigger..
|
|
|
Re: inserting unique id against each record [message #132959 is a reply to message #132958] |
Wed, 17 August 2005 01:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
What I said was "Add a Pre-Insert trigger and if the :block.item_seq is null then select the seq.nextval into :block.item_seq."
What that means is IN THE FORM "Add a Pre-Insert trigger" to the block with the records you are adding, "and if the :block.item_seq is null then select the seq.nextval into :block.item_seq."
This FORM trigger (there is no Pre-Insert trigger in the database, there is a Before Insert) will fire for each row and if there is no seq number then one will be fetched for it.
David
[Updated on: Wed, 17 August 2005 01:16] Report message to a moderator
|
|
|
|
|
|