Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle12c,[Err] ORA-00932: inconsistent datatypes: expected CHAR got DTYCWD,how to resolve?

MadFrogSep 27 2016 — edited Sep 27 2016

I consult this link :http://stefan-armbruster.com/index.php/12-it/pl-sql/12-oracle-xml-and-json-goodies

use the SQL to create table:

create table ex01_person_tb (

  id number,

  name varchar2(50)

);

insert into ex01_person_tb values (1, 'Roger Waters');

insert into ex01_person_tb values (2, 'David Gilmour');

create table ex01_phone_tb (

  id number,

  person_id number,

  phone_number varchar2(50)

);

insert into ex01_phone_tb values (1, 1, '543 454433');

insert into ex01_phone_tb values (2, 1, '512 4776443');

insert into ex01_phone_tb values (3, 1, '521 6454423');

insert into ex01_phone_tb values (4, 2, '212 8332464');

insert into ex01_phone_tb values (5, 2, '312 6736423');

When I use this to query:

select a.id, a.name,

  cursor (select b.id, b.phone_number

  from ex01_phone_tb b

  where b.person_id = a.id) as phone_numbers

from ex01_person_tb a;

The message  is :[Err] ORA-00932: inconsistent datatypes: expected CHAR got DTYCWD.

Can you tell me how to resolve?

This post has been answered by Anton Scheffer on Sep 27 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2016
Added on Sep 27 2016
21 comments
1,862 views