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 last published in June 2012

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Upgrade to 11g IS NOT a solution.

Cancel

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close