TeaAddictedGeek
Programmer
Hi,
I'm trying to read an XML variable returned from a stored proc within another stored proc which is processing it using OpenXML. However, it's not returning any data in the rows.
Here's roughly what the XML looks like that is stored in the table:
<RECORD id="1" city="BOS" date="5/1/2006">
<DATA1 ... ></DATA1>
<DATA2 ... ></DATA2>
</RECORD>
And here's the SQL:
exec getfreezeddata @pDate, @pCity, @pXML output
-- this retrieves the XML from the table by date and city
EXEC sp_xml_preparedocument @idoc OUTPUT, @pXML
SELECT id, date, city FROM
OPENXML(@idoc, '/FREEZE_RECORD', 1)
with (
id int,
date varchar(15),
city varchar(10)
)
What could be going wrong here? I've verified that the XML is indeed well formed by copy/pasting the string into XMLSpy.
Thanks in advance!
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
I'm trying to read an XML variable returned from a stored proc within another stored proc which is processing it using OpenXML. However, it's not returning any data in the rows.
Here's roughly what the XML looks like that is stored in the table:
<RECORD id="1" city="BOS" date="5/1/2006">
<DATA1 ... ></DATA1>
<DATA2 ... ></DATA2>
</RECORD>
And here's the SQL:
exec getfreezeddata @pDate, @pCity, @pXML output
-- this retrieves the XML from the table by date and city
EXEC sp_xml_preparedocument @idoc OUTPUT, @pXML
SELECT id, date, city FROM
OPENXML(@idoc, '/FREEZE_RECORD', 1)
with (
id int,
date varchar(15),
city varchar(10)
)
What could be going wrong here? I've verified that the XML is indeed well formed by copy/pasting the string into XMLSpy.
Thanks in advance!
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum