Problem solve Get help with specific problems with your technologies, process and projects.

Inconsistent data type error in Oracle Database 9i

A reader asks SQL expert Daniel Clamage about an inconsistent data type error he's getting on a query running in Oracle Database 9i.

More on Oracle Database SQL

Read more SQL expert answers from Daniel Clamage

Ask your own SQL or PL/SQL question

Hello. For the following code I'm running in Oracle Database 9i:

CREATE OR REPLACE TYPE Persona AS OBJECT(  ident  varchar2(9),  nombr  varchar2(30) ); create table tper(per Persona); insert into tper values(Persona('111','Lucas')); select * from tper;

I am getting the error:

ORA-00932: inconsistent data type. expected NUMBER get USUT7.PERSONA

Could you help?

I ran your DDL on an 11gR2 database:

CREATE OR REPLACE TYPE Persona as object(
ident varchar2(9), nombr varchar2(30));

create table tper(per Persona);

insert into tper values(Persona('111','Lucas'));
insert into tper values(Persona('AAA','Dan'));

select * from tper;

drop table tper;
drop type Persona;

It worked fine:

Type created.
Table created.
1 row created.
1 row created.

(111, Lucas)                                      
(AAA, Dan)                                        

2 rows selected.
Table dropped.
Type dropped.

It might be a language localization setting. My recommendation is you move from Oracle 9i to Oracle 11gR2.

This was last published in June 2012

Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

Upgrade to 11g IS NOT a solution.









  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...