Home » SQL & PL/SQL » SQL & PL/SQL » Update table set value => ORA-00904 (Oracle 9.2.0.8)
icon5.gif  Update table set value => ORA-00904 [message #349785] Tue, 23 September 2008 02:15 Go to next message
ade05fr
Messages: 4
Registered: January 2006
Junior Member
hi everyone,

i have a question for you experts.
we have a table p that contains 100 records and we created a new one with exactlyt the same description (table c).
we want to update all the records from p to c that have the same primary key

by what mention in the oracle documentation here is what we have done :

UPDATE copy_table c SET VALUE(c) = (SELECT VALUE(o) FROM original_table o WHERE o.id = c.id)

but we have an error message : ORA-00904: "c": invalid identifier

What do we have done wrong ?

thank you for your support,
ade05fr
Re: Update table set value => ORA-00904 [message #349787 is a reply to message #349785] Tue, 23 September 2008 02:28 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I think you might be misreading the documentation, but as you don't link to it, I can't be sure.

The syntax you're using is for nested object tables.

I don;t quite understand what you're doing.
Surely if you create a new table as a copy of the original, then all the primary keys will match.
Re: Update table set value => ORA-00904 [message #349789 is a reply to message #349785] Tue, 23 September 2008 02:38 Go to previous messageGo to next message
_jum
Messages: 509
Registered: February 2008
Senior Member
guess there are typos in Your update, assuming there are rows o and id try simple:
UPDATE copy_table cop SET o = (SELECT o FROM original_table ori WHERE ori.id = cop.id)

Re: Update table set value => ORA-00904 [message #349795 is a reply to message #349789] Tue, 23 September 2008 02:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
@_jum

Don't guess wait for OP's reply.
And DON'T PUT FULL SOLUTION AS ALREADY REQUESTED TO YOU.

Regards
Michel
[SOLVED] Update table set value => ORA-00904 [message #349800 is a reply to message #349795] Tue, 23 September 2008 03:04 Go to previous message
ade05fr
Messages: 4
Registered: January 2006
Junior Member
thanks for your answers

as you mentionned i didnt understand the doc.
sorry Embarassed

Previous Topic: UPDATE MANY ROWS OF DATA
Next Topic: How to pass table/collection/array to function.
Goto Forum:
  


Current Time: Thu Dec 08 10:10:03 CST 2016

Total time taken to generate the page: 0.07996 seconds