Home » RDBMS Server » Server Administration » Update script
Update script [message #373092] Tue, 27 March 2001 06:37 Go to next message
sonia
Messages: 22
Registered: March 2001
Junior Member
I am trying to update a column in a table which needs to reference another table column to only update certain clients. I have written this script which works in SQL Server (my background) but will not run on Oracle with the message command not properly ended. What do I need to change?

update CUSTOMER
set VALUE= VALUE/0.2
from CUSTOMER a, ACCOUNT b
where a.id = b.id
and b.code = 'S'
Re: Update script [message #373094 is a reply to message #373092] Tue, 27 March 2001 07:09 Go to previous messageGo to next message
Prem
Messages: 79
Registered: August 1998
Member
Sonia,

You cannot perform an update statement with a join because the update can work on only one table. Try this instead.

update CUSTOMERS
set VALUE = VALUE / 0.2
where ID in (select ID from ACCOUNT where CODE='S');

hth

Prem :)
Re: Update script [message #373095 is a reply to message #373094] Tue, 27 March 2001 08:38 Go to previous message
sonia
Messages: 22
Registered: March 2001
Junior Member
Thanks Prem. Iv'e changed this and it works.
Cheers Sonia
Previous Topic: Constraint removal
Next Topic: Database Failures
Goto Forum:
  


Current Time: Mon Dec 23 05:35:52 CST 2024