Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-27
7
Medium Priority
?
778 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 2000 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
Industry Leaders: 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 2000 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

Technology Partners: 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!

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

636 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