How to pass XMLData type as parameter to Stored procedure from JAVA [message #91956] |
Tue, 09 December 2003 10:09 |
MK
Messages: 31 Registered: June 2001
|
Member |
|
|
We are using Oracle 9i rel 2 .
I have a relational table with xmldata type as a column.
CREATE TABLE proposal (
PROPOSAL_ID NUMBER NOT NULL,
PROPOSAL_DOCUMENT XMLTYPE NOT NULL,
CONSTRAINT PK_proposal_id
PRIMARY KEY ( PROPOSAL_ID ) ) ;
We are not using XMLDB. XML document is validated in JAVA.
Table entries are created from Java using a stored procedure which accepts proposal_document as xml data type parameter.
CREATE OR REPLACE PROCEDURE AP_PROC_STORE_XML_DOCS1( xmldata IN SYS.XMLType , status out varchar2) IS
BEGIN
INSERT INTO proposal (proposal_id, proposal_documentl)
VALUES (seq_proposal_id.nextval,xmldata );
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('exception for others is ' || SUBSTR(SQLERRM(SQLCODE),1,50)) ;
raise;
status := 'N' ;
END;
Question : HOW TO PASS xmldata as an XMLdata type parameter for the stored procedure in JAVA.
Any help appreciated .
Thanks in advance.
MK
|
|
|
|