update table query

select ord.id,orditm.order_id,orditm.prior_code
 from dss.orders ord, ordered_items orditm 
  where ord.id = orditm.order_id
   and ord.customer_po in
('8835 SOS','8693 SOS','8614 SOS','8610 SOS','8706 SOS','8757 SOS','8703 SOS','8785 SOS','8653 SOS','8770 SOS',
 '8690 SOS','8807 SOS','8614 SOS','8689 SOS','8687 SOS','8642 SOS','8631 SOS','8126 SOS','8543 SOS','8403 SOS',
 '8519 SOS','8535 SOS','8430 SOS','8548 SOS','8423 SOS','8383 SOS','8397 SOS','8448 SOS','8398 SOS','8080 SOS',
 '8155 SOS','8158 SOS')

Open in new window


I have 32 rows. Need to made the prior_code as null from ordered_items table. Basically remove the data that is in the column prior_code.

tried update ordered_items
  set prior_code = null
where order_id in (select....

gives me error. Need help
LVL 6
anumosesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
what was the error?  IS the select above what you used in the update?

If so, there is the problem.

See if this works:
update ordered_items
  set prior_code = null
where order_id in (
select id
 from dss.orders ord
where ord.customer_po in
('8835 SOS','8693 SOS','8614 SOS','8610 SOS','8706 SOS','8757 SOS','8703 SOS','8785 SOS','8653 SOS','8770 SOS',
 '8690 SOS','8807 SOS','8614 SOS','8689 SOS','8687 SOS','8642 SOS','8631 SOS','8126 SOS','8543 SOS','8403 SOS',
 '8519 SOS','8535 SOS','8430 SOS','8548 SOS','8423 SOS','8383 SOS','8397 SOS','8448 SOS','8398 SOS','8080 SOS',
 '8155 SOS','8158 SOS')
)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anumosesAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.