Following is my function,
create or replace
FUNCTION checkXML
(idx in number , tblname in varchar2)
return xmltype
is
required_xml XMLTYPE;
saved_hash_value raw(50);
current_hash_value raw(50);
xml_not_equal EXCEPTION;
begin
execute immediate 'select checkfield , my_hash(extract(xmlcol,'/')) , xmlcol into saved_hash_value ,
current_hash_value , required_xml from ' || tblname || ' where indexid =' || idx ;
if saved_hash_value = current_hash_value then
return required_xml;
else
RAISE xml_not_equal;
end if;
end;
I want to know where am going wrong.
Error message which am receiving is,
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "SYSTEM.CHECKXML", line 11
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause:
*Action: