Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help - how do I pass XML documents to a Oracle procedure

Status
Not open for further replies.

john9

Programmer
May 31, 2002
16
0
0
US
Question : HOW do I PASS xmldata as an XMLdata type parameter to a procedure.

We are using Oracle 9i rel 2.

I built a relational table with xmldata type as a column:

CREATE TABLE PRISM.NODALXML
(
NODALXML_PK NUMBER(10),
NODEID NUMBER(10),
DOCTYPE VARCHAR2(20),
DOCREF NUMBER(10),
XMLDOC SYS.XMLTYPE
)
XMLTYPE COLUMN XMLDOC STORE AS CLOB
NOPARALLEL;

We are not using XMLDB. The XML documents are created and validated in JAVA. I built the following stored procedure to populate the Oracle table:

CREATE OR REPLACE PROCEDURE Load_Xml (????, ????, ????, ????) - I am not sure what to put here

AS

BEGIN

DBMS_LOB.createtemporary (l_clob, TRUE);

INSERT INTO PRISMR.NODALXML
(
NODALXML_PK,
NODEID,
DOCTYPE,
DOCREF,
XMLDOC
)
VALUES
(
NODALXML_seq.NEXTVAL,
NODEID,
DOCTYPE,
DOCREF,
XMLTYPE.createXML(l_clob)
);
COMMIT;

DBMS_LOB.freetemporary (l_clob);
END;
/


I am not sure if the above procedure is correct. Any suggestions on the contents will be helpful.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top