Home » Developer & Programmer » Forms » How to insert record into multiply row
How to insert record into multiply row [message #186245] Mon, 07 August 2006 02:57 Go to next message
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 #186255 is a reply to message #186245] Mon, 07 August 2006 03:26 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
This is a very basic question. I assume that you are doing a course. Search this forum for 'competitive' and read my comments concerning Oracle courses being 'non-competitive'.

You need to go to the end of the block. To do this use the 'down' command. Do this until ":system.last_record = 'TRUE'" then make a new record. For the number research 'sequences' and 'maximum plus one'.

You really need to go to the Oracle website (see the sticky at the beginning of this forum), download the documentation (I prefer the Forms 6.0 manual in pdf format), and SEARCH IT, and READ IT.

David
Re: How to insert record into multiply row [message #186259 is a reply to message #186245] Mon, 07 August 2006 03:34 Go to previous messageGo to next message
asgharmayo
Messages: 5
Registered: March 2006
Location: Faisalabad
Junior Member
Dear ,

the following code will add new index in coloumn
at forms in master block trigger
when-create-record


select nvl(max(id),0)+1 into :screen_variable(:index) from action;


buy
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
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT 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
Previous Topic: Regarding form
Next Topic: Is it possible to read the values through local ports using oracle in windows
Goto Forum:
  


Current Time: Fri Dec 02 21:07:59 CST 2016

Total time taken to generate the page: 0.04667 seconds