Skip to content
Advertisement

INSERT into statement not working in oracle when using INSERT INTO .. SELECT * FROM

I have vh_emp table whose table structure is(This is empty table):

enter image description here

I am taking data from employee table as source table where I wrote some query to match with vh_emp table:

The query is running fine and the output is coming fine from this query:

enter image description here

So,I wanted to insert these data in vh_emp tables using :

But,I executed this query I got error as:

The structure of table employee is: enter image description here

why is this error coming? I reviewed and saw that datatype is same for the column and value of select statement.This error should not appear as column datatype is matching.

Advertisement

Answer

Order of your insert clause column name and select clause column name should match.

Please match the positions of them as following:

Cheers!!

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement