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.
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.