473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

xml input into temp table.

I have this stored procedure that takes some xml as input. What I need
to is use xml as a table so that I can join other tables to the xml
and get information back that matches the criteria.

I can use dxxshredxml to put it into a regular table and everything
works great. but when I try to put it into a temp table it doesn't
work. I get an error saying Session.ACCESSMASK doesn't have a column
name ACCESS_MASK_ID.

Do I have to use a temp table ? or is there some way I can make joins
to the xml directly ?

Thanks in advance.

Here is the my test procedure:

CREATE PROCEDURE WEBADM.ACCESS_MASK ( IN xmlDoc CLOB(1M) )
DYNAMIC RESULT SETS 1
------------------------------------------------------------------------
-- SQL Stored Procedure
-- xmlDoc access masks list
------------------------------------------------------------------------
P1: BEGIN
declare dadDoc clob(1M);
declare retCode integer;
declare retMsg varchar(1000);

DECLARE GLOBAL TEMPORARY TABLE SESSION.ACCESS_MASK (
ACCESS_MASK_ID INTEGER,
DLR_CD VARCHAR(5),
RGN_CD VARCHAR(5),
BRN_CD VARCHAR(5),
REP_CD VARCHAR(5)
)
ON COMMIT PRESERVE ROWS;

-- get Dad file
call WEBADM.DWM_GET_DAD_FILE('ACCESS_MASK',dadDoc);

-- parse xml into database
call DB2XML.DXXSHREDXML(dadDoc, xmlDoc, retCode,retMsg);

drop table SESSION.ACCESS_MASK;
END P1

here is the DAD:

<?xml version="1.0"?>
<!DOCTYPE DAD SYSTEM "/opt/IBM/db2/V8.1/db2xml/dtd/dad.dtd">
<DAD>
<validation>NO</validation>
<Xcollection>
<prolog>?xml version="1.0"?</prolog>
<root_node>
<element_node name="ACCESSMASKS">
<element_node name="ACCESSMASK">
<RDB_node>
<table name="SESSION.ACCESS_MASK" key="ACCESS_MASK_ID"/>
</RDB_node>
<attribute_node name="ACCESS_MASK_ID">
<RDB_node>
<table name="SESSION.ACCESS_MASK"/>
<column name="ACCESS_MASK_ID" type="integer"/>
</RDB_node>
</attribute_node>
<attribute_node name="DLR_CD">
<RDB_node>
<table name="SESSION.ACCESS_MASK"/>
<column name="DLR_CD" type="varchar(5)"/>
</RDB_node>
</attribute_node>
<attribute_node name="RGN_CD">
<RDB_node>
<table name="SESSION.ACCESS_MASK"/>
<column name="RGN_CD" type="varchar(5)"/>
</RDB_node>
</attribute_node>
<attribute_node name="BRN_CD">
<RDB_node>
<table name="SESSION.ACCESS_MASK"/>
<column name="BRN_CD" type="varchar(5)"/>
</RDB_node>
</attribute_node>
<attribute_node name="REP_CD">
<RDB_node>
<table name="SESSION.ACCESS_MASK"/>
<column name="REP_CD" type="varchar(5)"/>
</RDB_node>
</attribute_node>
</element_node>
</element_node>
</root_node>
</Xcollection>
</DAD>
Nov 12 '05 #1
0 1633

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jerry LeVan | last post by:
Hi, I am adding image and large object support in my Cocoa postgresql browser. Are there going to be any enhanced bytea support functions coming along? It seems sorta silly to have to write...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
2
by: adambossy | last post by:
I have a nasty situation in SQL Server 7.0. I have a table, in which one column contains a string-delimited list of IDs pointing to another table, called "Ratings" (Ratings is small, containing...
44
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall...
4
hirak1984
by: hirak1984 | last post by:
Dear Sir/mam, I am new comers for DB2 .I Write a Stored Procedure below in line CREATE PROCEDURE AUS.PROCEDURE1 ( IN var0 VarCHAR(4000), OUT var1 CHAR(6) ) DYNAMIC RESULT SETS 1...
0
hirak1984
by: hirak1984 | last post by:
Dear Sir/mam, I am new comers for DB2 .I Write a Stored Procedure below in line CREATE PROCEDURE AUS.PROCEDURE1 ( IN var0 VarCHAR(4000), OUT var1 CHAR(6) ) DYNAMIC RESULT SETS 1...
5
by: theflyingminstrel | last post by:
Hi I have a question, it's probably very basic but I'm still learning the Javascript basics. The following form outputs a string change (from "input" to "text" box ). When the word "test" is...
9
by: seep | last post by:
hi i m finding following error on the code that i wants to use to get all record from table via store procedure with paging. the error is : Input string was not in a correct...
23
by: angelicdevil | last post by:
wat i m trying to do is delete a line from the xml based on the line generated i.e $mybody dynamically from the values entered by the user. in the code i provide...it simply adds a line...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.