Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL update statement problem!
try it like that ;
UPDATE nls_crafts
SET inc_in_renew = 1
WHERE tariff_id = ( SELECT a.tariff_id
FROM nls_tariffs a WHERE a.inc_in_renew = 1 );
of course only if you got the constraint right
In article <37c0d545.2729314_at_news.globalnet.co.uk>,
adrianh_at_globalnet.co.uk (Adrian Harrison) wrote:
> Using Oracle 7.3.4
>
> I'm trying to create a SQL statement that will update (see tables
below), nls_crafts.inc_in_renew
> field to 1 if nls_tariffs.inc_in_renew field = 1. The fields are
related via the tariff_id field.
>
> nls_crafts nls_tariffs
> =========== ===========
> tariff_id (Foreign Key) tariff_id (Primary
Key)
> inc_in_renew inc_in_renew
>
> Something like -
>
> UPDATE nls_crafts SET inc_in_renew = 1 WHERE nls_crafts.tariff_id =
nls_tariffs.tariff_id AND
> nls_tariffs.inc_in_renew = 1;
>
> I keep getting error "ORA-00904" - invalid column name
on "nls_tariffs.inc_in_renew" field even
> though the column definately exists
>
> Any ideas? - I'm sure it must be something really simple!
>
> Thanks
>
> Adrian Harrison
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Sun Aug 22 1999 - 06:55:35 CDT