Question : Reading / Using BLOB Columns

Hi All:
So, I've never really worked with Oracle BLOBs and I've come into a situation where the research I've done hasn't really helped. So I figured I'd ask here as it would save me time.

I have a table with a BLOB column. Inside the blob is XML. I'd like the best ways to look into the blob and extract a piece of the XML within an Oracle function.

So for example sake, lets say the name of the table is table_blob and it has two columns:
1. id, number (pri)
2. zBlob, BLOB

I'd like to have a function that takes in a string to search for in the BLOB, which has XML, an return the corresponding value that matches my search string. So, the XML structure is something like this:

...

Search Name



So the function would tak in "Search Name" and return "theValueIWant" if found, or null otherwise.

I have some ideas about how to do this, but it involves a function that reads the BLOB data using things like instr.. which I don't think will be very efficient.

Thoughts?

Thanks,
Anthony

Answer : Reading / Using BLOB Columns

For inserting an XML document into your DB , have a look at this page i think its useful

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html#PLSQLCode

Have a look at this manual to use XMLPARSER  which will help you parse your XML document and extract any information about the nodes without the need to parse any strings

http://www.acs.ilstu.edu/docs/Oracle9iAS/web.902/a88894/adx28ppl.htm

Hope that helps !
Random Solutions  
 
programming4us programming4us