Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Set ROW = ...

Status
Not open for further replies.

jquaid

IS-IT--Management
Aug 7, 2001
15
IE
Is it possible to have an Update statement in Oracle 8i that doesn't detail all the field names?
e.g. UPDATE tblA SET ROW = (SELECT * FROM tblB WHERE tblB.id = 1) WHERE tblA.id = 1;

tblA and tblB have the exact same structure.
I found a reference to 'SET ROW' in a 9i manual, but when I try it on 8i, it tells me that it can't find the column name.

Any help would be greatly appreciated. My tblA has about 100 fields; I'd hate to have to detail each one.

Jeremy
 
I don't think you can do this.
However, you might be able to use a script something like this:

DELETE FROM tablea WHERE id = &&the_id;
INSERT INTO tablea (SELECT * FROM tableb WHERE id = &the_id);

 
Hi Carp,

Thanks for your reply.
I was hoping to be able to avoid testing if the records were already in tblA:

i.e. Update....(select from tblB where id IN tblA)
Insert....(select from tblB where id not in tblA)

Just laziness really. Think I'll have to cursor it, and actually write some code.

Thanks again,
Jeremy.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top