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?

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

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: