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!

ORA-00932: inconsistent datatypes: expected CHAR got -

883038Dec 20 2011 — edited Dec 22 2011
hi am getting the error when am writing the code as below...

am trying to concatinate all empnames into single line who belongs to same department..
1 DECLARE
2 ex varchar2(200);
3 BEGIN
4 SELECT xmlagg(xmlelement(e,ename,'(',deptno,')',',')) INTO
5 EX FROM EMP WHERE deptno=30;
6 DBMS_OUTPUT.PUT_LINE(EX);
7* END;
QL> /
DECLARE

ERROR at line 1:
ORA-06550: line 4, column 8:
PL/SQL: ORA-00932: inconsistent datatypes: expected CHAR got -
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored

[\code].

please help me..

thanks for all in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2012
Added on Dec 20 2011
5 comments
1,859 views