How to insert record into multiply row [message #186245] |
Mon, 07 August 2006 02:57 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dinjeff
Messages: 8 Registered: July 2005
|
Junior Member |
|
|
To all my friends
i like to ask all of you how to insert a record in the multiply row in one block.example
i create a table name action. in my action table i have cloumn index and i insert the data is number 123...and so on.
the last number is 3
can any body give me the idea how to create code.
if i clik the add button
system will go to the last record and insert a nombuer 4.
like this;
index
1
2
3
4
i need you help
tq
|
|
|
|
|
Re: How to insert record into multiply row [message #186428 is a reply to message #186259] |
Mon, 07 August 2006 23:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
But only if you do a commit after each row insert.
Get the maximum value from the database in the When-New-Block-Instance trigger on the block and store it into an item in a non-dfatabase control block and increment it yourself. Alternatively, in the When-Create-Record get the value from an Oracle sequence.
If the block is ordered by the 'index' and you ALWAYS retrieve all the records, and you ONLY do your inserts 'after' the last record, then you can get the value from the last record and add one to it (in the When-Create-Record trigger).
David
|
|
|