anumoses
asked on
update oracle table
I am adding a new column called area_rep_id to the table ad_request. I have to update all the records with area_rep_no fronm blood_drives table where site_code from ad_request = site code from blood drives and similarly the drive date.
I have a query here.
update ad_request
set area_rep_id = (
select bd.area_rep_no
from ad_request ar, blood_drives bd
where ar.drive_date = bd.drive_date
and ar.site_code = bd.site_code)
Is this correct?
I have a query here.
update ad_request
set area_rep_id = (
select bd.area_rep_no
from ad_request ar, blood_drives bd
where ar.drive_date = bd.drive_date
and ar.site_code = bd.site_code)
Is this correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have altered my table with column name area_rep_no number(4). This is how its in blood_drives table
ASKER
thanks
If not, you might want to consider this one (essentially when dealing with many rows):
Open in new window
Don't forget about recreation of indexes and triggers and recompiling invalid objects (like packages, functions...)