[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2538
  • Last Modified:

DBMS_XMLDOM.NEWDOMDOCUMENT function call error : ORA-06502: PL/SQL: numeric or value error: raw variable length too long

Hi,
OS : Windows Server 2003
I installed Oracle Patchset 9.2.0.5 recently. I installed Oracle ODBC Driver 9.2.0.6.3 also.

Previously, I had 9.2.0.2 version. On this previous version, a stored procedure which contained the function :  DBMS_XMLDOM.NEWDOMDOCUMENT(ClobParameter) was working fine.

Now, with the 9.2.0.5 version and ODBC Driver 9.2.0.6.3, the call of the  DBMS_XMLDOM.NEWDOMDOCUMENT(ClobParameter)  returns an error :

ORA-06502: PL/SQL: numeric or value error: raw variable length too long
ORA-06512: at "XDB.DBMS_XMLDOM", line 3616

Even if I try to call DBMS_XMLDOM.NEWDOMDOCUMENT without parameter, it returns the same error code.
Could you help me to find out what's happening here?
Thank you!!!

Anne-Marie
0
Modellium
Asked:
Modellium
  • 7
  • 6
  • 3
2 Solutions
 
slightwv (䄆 Netminder) Commented:
Where does ODBC come into play?

Can you post a stub of the failing code?
0
 
ModelliumAuthor Commented:
Here is my stored proc :

FUNCTION FN_CONVERTTOELEMENTTREE
(sXML  clob,
--sXML  in varchar2, --event Varchar2 parameter is not working
groupName in varchar2,
entryName in varchar2)
RETURN dbms_xmldom.DOMDocument
--permet de retourner un dom document avec des éléments au lieu de attributes
AS
   rdxml dbms_xmldom.DOMDocument;
   xmlDoc dbms_xmldom.DOMDocument;
BEGIN
   rdxml := DBMS_XMLDOM.NEWDOMDOCUMENT(sXML); --here,is the error
  --...

  RETURN (xmlDoc);
END;
0
 
slightwv (䄆 Netminder) Commented:
you didn't mention the ODBC part.  How are you calling the procedure?  ODBC has a problem dealing with long character strings.


I had to slightly modify the code for a test stub but it works for me in 10g.  I'm thinking that they may have introduced a bug in 9205.  Depending on your OS, 9206 is out.  I suggest going to this patchset and trying again.

create or replace FUNCTION FN_CONVERTTOELEMENTTREE (sXML  clob)
RETURN char
AS
   rdxml dbms_xmldom.DOMDocument;
BEGIN
   rdxml := DBMS_XMLDOM.NEWDOMDOCUMENT(sXML); --here,is the error
  RETURN 'a';
END;
/

from SQL*Plus:
select FN_CONVERTTOELEMENTTREE('<a>Hello</a>') from dual;
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
ModelliumAuthor Commented:
Event if I call the function with VB6 or with Jdevelopper or with SQL*Plus : same error.
I'll install 9206 patchset.

0
 
ModelliumAuthor Commented:
Ok, I installed 9.2.0.6 patchset. Same error :

SQL> select FN_CONVERTTOELEMENTTREE2('<a>Hello</a>') from dual;
select FN_CONVERTTOELEMENTTREE2('<a>Hello</a>') from dual
       *
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: raw variable length too long
ORA-06512: at "XDB.DBMS_XMLDOM", line 3657
ORA-06512: at "SYSTEM.FN_CONVERTTOELEMENTTREE2", line 6
ORA-06512: at line 1

I think an error could have been inserted during the 9.2.0.5 patchset installation?!?!
0
 
slightwv (䄆 Netminder) Commented:
Did you test with the stub function above?

If so, You have a problem somewhere else.  I just tested the stub script above from a 10g client using SQL*Plus,  connecting to a 9205 DB and it runs fine for me.

If not, try creating the stub function and try it.
0
 
ModelliumAuthor Commented:
yes, I create the stub and test it and i've got the same error.

I will make a clean reinstall of 9.2.0.5 patchset with a ghost file containing Oracle 9.2.0.2.
 
0
 
slightwv (䄆 Netminder) Commented:
I just noticed something: Any particular reason you are creating this function as the 'SYSTEM' user?
0
 
ModelliumAuthor Commented:
hmm no, no particular reason...
But I tried it with a different login, and the same error happens.


0
 
slightwv (䄆 Netminder) Commented:
Ok....  let me know what happens after the re-install.
0
 
grim_toasterCommented:
Slight confusion, you posted the code for the function FN_CONVERTTOELEMENTTREE, however, you are trying to call FN_CONVERTTOELEMENTTREE2, are there any differences between these two functions?  Is line 6 the same?
0
 
ModelliumAuthor Commented:
Sorry,
the FN_CONVERTTOELEMENTTREE2 function is the function that slightwv suggest me to try:

create or replace FUNCTION FN_CONVERTTOELEMENTTREE2 (sXML  clob)
RETURN char
AS
   rdxml dbms_xmldom.DOMDocument;
BEGIN
   rdxml := DBMS_XMLDOM.NEWDOMDOCUMENT(sXML); --here,is the error --line 6
  RETURN 'a';
END;
/
0
 
grim_toasterCommented:
Ah, that makes sense now!  Also, to let you know, I tried out that script on a local 9.2.0.5 database and it fails for me also.  And it worked on a 9.2.0.1 database!  If it still does not work for you on 9.2.0.6, I would suggest raising it as a bug with Oracle, provide them with as small amount of code as possible to recreate the error (something like below).

DECLARE
    rdxml dbms_xmldom.DOMDocument;
BEGIN
    rdxml := DBMS_XMLDOM.NEWDOMDOCUMENT('<a>Hello</a>'); --here,is the error
END;
0
 
ModelliumAuthor Commented:
Hi!
No, it still does not work on 9.2.0.6. :(
I want to submit the problem to Oracle, but I can't find out where I could do it.

The next step for me is to try with 9.2.0.2 or 9.2.0.3 versions.

Could you telle me where I should report this bug?
Thank you!
0
 
grim_toasterCommented:
If you have a support contract with Oracle you can log in to metalink to raise bugs (unfortunately the company I work for won't give me access to it!  So I can't direct you any further).

metalink:
http://www.oracle.com/support/metalink/index.html

However, I believe that the problem was caused by the upgrade process.  My local machine was originally 9.2.0.1 and I updgraded to 9.2.0.5, and I get the same error as you.  However, if you drop the xdb user, and recreate it (connected as SYS, run "@catqm.sql change_on_install XDB TEMP"), then try to run the script you do not get that error anymore.  I would look into this issue a bit more than this, the create script throw up a load of errors (that I'm not going to look into), but the xdb user seems to be set up correctly.  There may be something documented in the update patch that we both missed regarding the xdb user!
0
 
slightwv (䄆 Netminder) Commented:
split?
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 7
  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now