Link to home
Start Free TrialLog in
Avatar of talahi
talahi

asked on

insert into tablename select *,colname(s) from similar_tablename; when table columns diff by one or more column names

I know I can do this by listing every column name but without listing every column name, I thought there was a way to do a

INSERT INTO TABLENAME
select *,columnname from tablename_with_less_columns;

using a wildcard * and adding columns that are in the table being loaded into.  

I tried it with column_names and NULLs but nothing worked.

For the specific case I'm working on each table is identical except the table I'm trying to load data into, using this insert statement, has 2 additional columns.  If I just use an * I get an ORA-00947: not enough values error.
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

You will have to list the column names.

ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial