Solved

How to locate/fix the insert error(ORA-932)?

Posted on 2011-02-27
7
761 Views
Last Modified: 2012-05-11
Have two tables T1, and T2 with same 50+ columns. T2 is located but T1 isn't.
Want to load the data into T1 from T2, so
insert into T1 select * from T2;
Unfortunately I got the error:
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got DATE

When I check the two tables and seems same:

SQL> select COLUMN_NAME, DATA_TYPE,DATA_LENGTH from dba_tab_columns where OWNER='schema1' and table_name = 'T1' minus
  2  select COLUMN_NAME, DATA_TYPE,DATA_LENGTH from dba_tab_columns where OWNER='schema1' and table_name = 'T2';

no rows selected

How to check/fix the error???
0
Comment
Question by:jl66
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 

Author Comment

by:jl66
ID: 34992454
Columns contain date, varchar2, number, char, etc. I checked it. It seems the exactly same.
0
 

Author Comment

by:jl66
ID: 34992460
Have two tables T1, and T2 with same 50+ columns. T2 is located but T1 isn't.
=> Have two tables T1, and T2 with same 50+ columns. T2 is loaded but T1 isn't.
Sorry for that.
0
 
LVL 18

Accepted Solution

by:
sventhan earned 500 total points
ID: 34992461
How about this...

select COLUMN_NAME, DATA_TYPE,DATA_LENGTH from dba_tab_columns where OWNER='schema1' and table_name = 'T2
minus
select COLUMN_NAME, DATA_TYPE,DATA_LENGTH from dba_tab_columns where OWNER='schema1' and table_name = 'T1'

How many date's do you have?

Check the Date columns on both  the tables.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Assisted Solution

by:sventhan
sventhan earned 500 total points
ID: 34992470
or,

Create table t1 as select * from t2
0
 

Author Comment

by:jl66
ID: 34992618
For your 1st response it is the same. No rows selected...
T1 has several constraints and T2 hasn't and use the different tablespaces. They are the defferences. This is also why I want  to keep the structure of T1.
0
 
LVL 18

Expert Comment

by:sventhan
ID: 34992666
< T1 has several constraints and T2 hasn't

It could be related to data issue. The tablespace does not cause any issues here. Apply the same constrains over T2 and see if you getting the same error.

0
 

Author Closing Comment

by:jl66
ID: 34993753
Thanks a lot. The issue was resolved by listing every column.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question