Link to home
Start Free TrialLog in
Avatar of pp89
pp89

asked on

PLSQL Question

Hi All,

I am inseting data into tables using nested loops and at last I am performing commit of the entire transaction. Now I want to do a update on the same table into which I am inserting. So how do I do this?
Because before commit I cannot do the update on same table. And if I write update statement after commit then I cannot refer cursor variables as all my loops are closed.

Thanks for your help.
Avatar of flow01
flow01
Flag of Netherlands image

After insert you can update the same record,  no commit needed.

But depending on what you need for update,  you can also store records to insert in a pl/sql-collection, update a record in the collection and insert the whole collection with one forall-statement.
ASKER CERTIFIED SOLUTION
Avatar of Naveen Kumar
Naveen Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pp89
pp89

ASKER

Requirement is to insert record by record using nested loops and finally before last loop I am performing a commit operation.
So after insert in a loop can I update the same table in which I am inserting?
yes, you can as already mentioned.
Avatar of pp89

ASKER

Thanks all. It worked.
good and thanks