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_column s;
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.
INSERT INTO TABLENAME
select *,columnname from tablename_with_less_column
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.
You will have to list the column names.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.