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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Help in Updating Specific Table Rows on Criteria

AshishKumarMishraJun 14 2013 — edited Jun 14 2013

Hi All,

I have following table Record_Status in oracle. In this table, we have added a new column Batch_id. I need to assign a batch id to existing records based on following criteria

If CREATED_UPDATED_BY, CREATED_UPDATED_DATE,ORG_ID, USER_ID,UDR_ID,PF_ID for records is same, then to all the records matching this criteria should have same Batch_ID from a sequence, unique records will get a new value from an existing sequence.

Let me know if you need more information or example for this.

Column NameData Type
IDNumber
CREATED_UPDATED_BYVarchar2
CREATED_UPDATED_DATE  Date
ORG_IDnumber
USER_ID number
UDR_IDnumber
PF_IDnumber
Namevarchar2
BATCH_IDnumber
TYPE
varchar
Statusvarchar

Could you please provide a sql or procedure to update the record in this manner?

Thanks for your time to look into this question and all your help.

Regards,

Ashish Mishra

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 12 2013
Added on Jun 14 2013
2 comments
175 views