No question at this time
DBA Top 10
1 M. Cadot 17000
2 A. Kavsek 14300
3 B. Vroman 10300
4 M. Hidayathullah ... 8400
5 T. Boles 4900
6 P. Wisse 4400
7 J. Schnackenberg 3500
8 K. Van Nieuwenhov... 2100
9 A. Hudspith 800
9 T. P 800
About
DBA-Village
Download PLATO
The free tool for auditing and tuning your database
Version 55 now available
Sep 02, 2016
The DBA-Village forum
Forum as RSS
as RSS feed
Site Statistics
Ever registered users48097
Total active users1702
Act. users last 24h1
Act. users last hour0
Registered user hits last week237
Registered user hits last month1339
Go up

How to SELECT XMLTYPE data with Perl DBD::Oracle?
Next thread: Rman backup is running slow.
Prev thread: Interval Partitioning

Message Score Author Date
You can simply select an XMLTYPE column in SQL*P...... Michel Cadot Aug 18, 2015, 15:40

Follow up by mail Click here


Subject: How to SELECT XMLTYPE data with Perl DBD::Oracle?
Author: Michel Cadot, France
Date: Aug 18, 2015, 15:40, 852 days ago
Oracle info: Oracle: 10.2-11.2, Perl: 5.20.2, DBI: 1.633, DBD::Oracle: 1.74
Message:
You can simply select an XMLTYPE column in SQL*Plus like:
SQL> select  WAREHOUSE_SPEC

2 from OE.WAREHOUSES
3 where WAREHOUSE_SPEC is not null and rownum = 1
4 /
WAREHOUSE_SPEC
--------------------------------------------------------
<?xml version="1.0"?>
<Warehouse>
<Building>Owned</Building>
<Area>25000</Area>
<Docks>2</Docks>
<DockType>Rear load</DockType>
<WaterAccess>Y</WaterAccess>
<RailAccess>N</RailAccess>
<Parking>Street</Parking>
<VClearance>10 ft</VClearance>
</Warehouse>

This is a shorcut for the more correct:
select W.WAREHOUSE_SPEC.getclobval() WAREHOUSE_SPEC

from OE.WAREHOUSES W
where WAREHOUSE_SPEC is not null and rownum = 1
/

Now without changing the first query into the second one, is it possible to get the XML string with Perl DBD::Oracle?

I find one page on the web saying "don't waste your time to search on the web, it is not possible" and another one saying "I succeeded to do it binding a variable with attribute SQLT_STR type" but he did not show the code.
I tried with many different types and failed.

You can find a sample of code at the following link, if you want to try by yourself.

http://www.orafaq.com/forum/t/198320/

Regards
Michel

Goto: Reply - Top of page 
If you think this item violates copyrights, please click here