Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2007

Tip: Looking for answers? Try searching our database.

How to see/get the contents ina CLOB field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pai - 14 Dec 2007 12:35 GMT
Hi All,

      I have a field which had a field of DATA TYPE CLOB and in that
I have inserted an XML.
How can I see the contents of that XML file.

Please Help

Regards
Pai
rhino - 15 Dec 2007 00:41 GMT
> Hi All,
>
[quoted text clipped - 3 lines]
>
> Please Help

In future, please post information on which version of DB2 you are using and
what operating system you have; this can change the answer to the question.

For now, assuming that you are using DB2 V8 on Windows, it might be better
for you to store your XML in an XML column. The details of how to do this
and of how to get the data back out is in the manual entitled DB2 XML
Extender Administration and Programming. It describes how to create a DAD
file and the various other steps you should take.

According to the SQL Reference for DB2 V8: "the XML data type is an internal
representation of XML and can only be used as input to functions that accept
this data type as input. XML is a transient data type that cannot be stored
in the database or returned to an application.... Currently, the only
supported operation is to serialize (by using the XML2CLOB function) the XML
value into a string that is stored as a CLOB value."

However, if you simply want to _see_ your XML data in its CLOB column, you
can do this, assuming that:
- your table name is MYCLOBS
- the primary key of the table is called SEQNO
- your CLOB column is called CLOB1

and you want to see the first 50 characters of the CLOB for the row whose
primary key is 1:

   select clob(clob1, 50) from myclobs where seqno is 1

If you want to _WORK_ with your XML as a proper XML structure, I think you
need to read the XML Extender Administration and Programming manual, as I
mentioned above.

--
Rhino
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.