Toad World® Forums

dbms_xmldom.domdocument --- Input Parameter for a PL/SQL procedure

Hi,

I have been struggling a lot as to how to pass value to a INPUT PARAMETER of TYPE :

dbms_xmldom.domdocument.

In the standard API, dbms_xmldom.domdocument is a RECORD TYPE and has column id(RAW13).

I have written a code in CUSTOMISATION to convert CLOB into DOMDOCUMENT,but it doesnt give me the ID value explicitly.

Please help me with this.

Regards,

Amol

Hi Amol,

the id value could be specified as an expression, using an existing global variable from the customization. We can declare such a global variable the way that is depicted on following screen shot

Then we are able to reference the global doc variable in the input setup like on the following screen shot:

I created a dummy program with DBMS_XMLDOM.DOMDOCUMENT as an input just to verify my guide. You can see the source code on the following screen shot:

When you create such a test definition, you can run a test that will pass the specified document to your tested function.

Best regards,

Ferdinand

Hi Amol,

I would like to add my 5 cents to Ferdinand’s post.

There is another way to test programs with parameters of DBMS_XMLDOM.DOMDOCUMENT type.

Take a look at this package spec:

CREATE OR REPLACE PACKAGE sq_table

IS

FUNCTION calc_sq (x_in IN INTEGER, doc_in IN DBMS_XMLDOM.domdocument)

RETURN INTEGER;

FUNCTION calc_sq (x_in IN INTEGER, xml_in IN XMLTYPE)

RETURN INTEGER;

END sq_table;

When I have to test the first function with DBMS_XMLDOM.DOMDOCUMENT parameter I just create a wrapping function with XMLTYPE parameter, which calls the first one. And then I create my test against the wrapping function using the fact that the XMLTYPE is supported by Code Tester.

This is my example.
dbms_xmldom.zip (6.34 KB)

What would be the expected value for your function in the package Leok ??