More on Oracle Database SQL
Read more SQL expert answers from Daniel Clamage
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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:
1 row created.
1 row created.
2 rows selected.
It might be a language localization setting. My recommendation is you move from Oracle 9i to Oracle 11gR2.
Dig Deeper on Oracle and SQL
Related Q&A from Dan Clamage
A reader asks Oracle expert Dan Clamage about a single date condition mucking up a dynamic query.continue reading
Expert Dan Clamage explains how to use SQL SELECT and SQL UNION ALL statements to sort and visualize a set of sales figures.continue reading
One reader asks expert Daniel Clamage about the PL/SQL to_date and to_char functions and how to properly convert date and string values.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.