Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BULK COLLECT for Update

Don07May 10 2017 — edited May 10 2017

Hello There,

I have an existing table which has several 1000's of rows. A new column will be added and it needs to be updated with a sequence. The details below:

Table Name            : Actual_Table

New Column Added: Review_ID

Sequence                : Actual_Table_S

<Select statement>

SELECT       review_id

FROM          actual_table

ORDER BY  creation_date

,                    business_number;

<Update Statement>

UPDATE    actual_table    SET review_id = actual_table_s.NEXTVAL;

Note: The column review_id must be populated (by sequence) for all existing rows sorted by creation_date and Business_number

I would like to know how can this be done using in PL/SQL using Bulk Collect Update the table with example.

Look forward to hearing from you.

Thanks & regards,

Don

Message was edited by: Don07

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2017
Added on May 10 2017
38 comments
1,810 views