bhushanQA has asked for the wisdom of the Perl Monks concerning the following question:
I have written below script to retrieve BLOB data ( which has XML format) from oracle 11g, IF I run the Select statement in the query builder in some tool (i.e. ORACLE SQL Developer) it is giving me the BLOB values which is XML.
Now I want to write a perl script which will invoke the BLOB as XML and print it on my screen.
Output of this program is :#!/usr/bin/perl use strict; use warnings; use DBI; use DBD::Oracle; my $dbh = DBI->connect('dbi:Oracle:host=<IP ADRESS>;sid=11G;port=1521' +,'username', 'password', { RaiseError => 1, AutoCommit => 0 }) or die + "can not connect to the DB"; my $sth = $dbh->prepare(qq{select xmltype(SERVICE_SPECIFIC_DATA_V,871) + from CONNECTION_ACCOUNTS where account_id_n = 1462}); $sth->execute(); while ( my ($SERVICE_SPECIFIC_DATA_V) = $sth->fetchrow() ) { print STDOUT "BLOB is: $SERVICE_SPECIFIC_DATA_V\n"; } $sth->finish(); $dbh->disconnect;
How Can I print the SERVICE_SPECIFIC_DATA_V xml values. or is there any alternative way where I can do it easily. Also, If I want to Insert or update this BLOB column which has XML, need Monks valuable suggestion on this. Thanks.BLOB is :ARRAY(0xdd705a0)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Handling BLOB data in ORACLE using perl script
by choroba (Cardinal) on Sep 23, 2015 at 13:53 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by BravoTwoZero (Scribe) on Sep 23, 2015 at 13:56 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by CountZero (Bishop) on Sep 24, 2015 at 05:41 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by fishy (Friar) on Sep 24, 2015 at 19:23 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by KurtSchwind (Chaplain) on Sep 24, 2015 at 19:40 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by ramachandrajr (Novice) on Sep 24, 2015 at 05:37 UTC | |
Re: Handling BLOB data in ORACLE using perl script
by sundialsvc4 (Abbot) on Sep 23, 2015 at 14:08 UTC |
Back to
Seekers of Perl Wisdom