Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> simple(?) sql question

simple(?) sql question

From: Veres Lajos <vlajos_at_ludens.elte.hu>
Date: 2006-01-05 11:11:49
Message-id: Pine.LNX.4.62.0601051057300.19311@www1.vatera.hu


Hello,

I would like to copy a row in a table, and change some columns values without knowing the exact structure of the table.

Something like:
insert into test select t.*,'val1' as col1,'val2' as col5 from test t where col2='1';

But this doesnt works.
ORA-00913: too many values

The selects result give something like:
SQL> select t.*,'val1' as col1,'val2' as col5 from test t where col2='1';

col1 col2 col3 col4 col5 col1 col5
----- ----- ----- ----- ----- ---- ----
1 1 1 1 1 val1 val2

col1,col5 columns are duplicated.

There is any way to remove column(s) from '*', if it exists after without hardcoding all columns names?

Or maybe other solution?

Thanks.

-- 
Veres Lajos
vlajos_at_ludens.elte.hu
+36 20 438 5909
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 05 2006 - 11:11:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US