Home » Developer & Programmer » JDeveloper, Java & XML » ORA-30625: error when running code (Oracle, 10,windows)
ORA-30625: error when running code [message #299876] Wed, 13 February 2008 08:27 Go to next message
aadebayo
Messages: 35
Registered: August 2005
Member
When I run the code below, I get ORA-30625: method dispatch on NULL SELF argument is disallowed. With reference to the two lines containing
lengthy_varchar := substr(o_return_xml.getClobVal(),1,10000);. Please can some one help me?

Ade

DECLARE
  o_return_xml XMLTYPE;
  o_return_code   VARCHAR2(32767);
  o_return_msg    VARCHAR2(32767);
  lstart INTEGER;
  lpos INTEGER;
  lengthy_varchar VARCHAR2(32767);
cnt INTEGER;
begin
  XX_LGS_GET_SR_DEFINITIONS_PKG.FETCH_SR_DEFINITION(14002,
                                                o_return_xml,
                                                o_return_code,
                                                o_return_msg);
    dbms_output.put_line('code = ' || o_return_code);
    dbms_output.put_line('msg = ' || o_return_msg);
lengthy_varchar := substr(o_return_xml.getClobVal(),1,10000);
BEGIN
cnt := 0;
lengthy_varchar := substr(o_return_xml.getClobVal(), 1,10000);
WHILE (length(lengthy_varchar) > 0)
LOOP
lstart := 1;
lpos := 1;
WHILE (lpos <> 0)
LOOP
lpos := instr(substr(lengthy_varchar,lstart,255),'>');
if (lpos <> 0) then
	dbms_output.put_line(SUBSTR(lengthy_varchar, lstart, lpos));
end if;
lstart := lstart + lpos;
END LOOP;
cnt := cnt + 1;
lengthy_varchar := substr(o_return_xml.getClobVal(),(cnt * 10000) + 1,10000);
END LOOP;
END;
end;
/


[Updated on: Wed, 13 February 2008 08:38]

Report message to a moderator

Re: ORA-30625: error when running code [message #299891 is a reply to message #299876] Wed, 13 February 2008 09:16 Go to previous message
aadebayo
Messages: 35
Registered: August 2005
Member
I have changed the syntax, but I am getting new errors as below

code = E
msg = ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML
processing
LPX-00229: input source is empty
Error at line 0


as you can see,
lengthy_varchar := substr(o_return_xml.getClobVal(),1,10000);
becomes

select substr(o_return_xml.getClobVal(),1,10000)
 into lengthy_varchar
 from dual;

below is the new syntax

Alter session set nls_language = 'AMERICAN';

  SET SERVEROUTPUT ON SIZE 1000000;

DECLARE
  o_return_xml XMLTYPE;
  o_return_code   VARCHAR2(32767);
  o_return_msg    VARCHAR2(32767);
  lstart INTEGER;
  lpos INTEGER;
  lengthy_varchar VARCHAR2(32767);
cnt INTEGER;
begin
  XX_LGS_GET_SR_DEFINITIONS_PKG.FETCH_SR_DEFINITION(11002,
                                                o_return_xml,
                                                o_return_code,
                                                o_return_msg);
    dbms_output.put_line('code = ' || o_return_code);
    dbms_output.put_line('msg = ' || o_return_msg);
 
 select substr(o_return_xml.getClobVal(),1,10000)
 into lengthy_varchar
 from dual;  
 --lengthy_varchar := substr(o_return_xml.getStringVal(),1,10000);

BEGIN
cnt := 0;
--lengthy_varchar := substr(o_return_xml.getClobVal(), 1,10000);
 select substr(o_return_xml.getClobVal(),1,10000)
 into lengthy_varchar
 from dual;  
WHILE (length(lengthy_varchar) > 0)
LOOP
  dbms_output.put_line('Long varchar hurrah');
lstart := 1;
lpos := 1;
WHILE (lpos <> 0)
LOOP
lpos := instr(substr(lengthy_varchar,lstart,255),'>');
if (lpos <> 0) then
 dbms_output.put_line(SUBSTR(lengthy_varchar, lstart, lpos));
end if;
lstart := lstart + lpos;
 dbms_output.put_line('Long varchar hurrah');
END LOOP;
cnt := cnt + 1;
lengthy_varchar := substr(o_return_xml.getClobVal(),(cnt * 10000) + 1,10000);
  dbms_output.put_line('output is' ||lengthy_varchar );
END LOOP;
END;
end;

/
Previous Topic: Query runs slow inside class file
Next Topic: XML extraction and character encoding error?
Goto Forum:
  


Current Time: Sun Dec 04 15:03:53 CST 2016

Total time taken to generate the page: 0.05211 seconds