Q

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.

PER                                               
--------------------------------------------------
(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 first published in June 2012

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

1 comment

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close