dbTalk Databases Forums  

xml conversion in pl/sql

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss xml conversion in pl/sql in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shishir
 
Posts: n/a

Default xml conversion in pl/sql - 07-02-2007 , 02:56 PM






hi ,

How do i map the xml handling code in t-sql to pl/sql??
for example , here is the t-sql code :

CREATE PROCEDURE [dbo].[usp_LIBRARYHideUnhideTreeNodes]
-- Add the parameters for the stored procedure here
@paramMyXml text,
@XmlHandle int output
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

/*Update statements*/
EXEC sp_xml_preparedocument @XmlHandle output,@paramMyXml

UPDATE LIBRARYTree SET IsVisible = ~IsVisible WHERE NodeId in(
SELECT xNodeID FROM OPENXML (@XmlHandle, 'HiddenNodes/Node',1)
WITH ( xNodeID int '@id'))

EXEC sp_xml_removedocument @XmlHandle


END

The corresponding code in pl/sql by sql developer is :


CREATE OR REPLACE PROCEDURE usp_LIBRARYHideUnhideTreeNodes

(
-- Add the parameters for the stored procedure here
v_paramMyXml IN CLOB DEFAULT NULL ,
v_XmlHandle OUT NUMBER
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
NULL/*TODO:SET NOCOUNT ON*/;
/*Update statements*/
sp_xml_preparedocument(v_XmlHandle,
v_paramMyXml);
UPDATE LIBRARYTree
SET IsVisible = UTL_RAW.BIT_COMPLEMENT(IsVisible)
WHERE NodeId IN ( SELECT xNodeID
FROM DUAL/*TODO:OPENXML (@XmlHandle, 'HiddenNodes/Node',1)
WITH ( xNodeID int '@id'))*/ );
sp_xml_removedocument(v_XmlHandle);
END;

This on compilation for obvious reasons gives errors.

how is sp_xml_preparedocument,openxml,sp_xml_removedocume nt handled in
pl/sql??

any help in this direction will be appreciated..

Cheers,
Shishir.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.