<?xml version="1.0" encoding="windows-1252"?>
<node id="1010220" title="DBD Oracle ORA_XMLTYPE Seg Fault" created="2012-12-24 12:44:46" updated="2012-12-24 12:44:46">
<type id="115">
perlquestion</type>
<author id="1010210">
grump-</author>
<data>
<field name="doctext">
&lt;p&gt;Here is the stored procedure:&lt;/p&gt;
&lt;code&gt;PROCEDURE TEST
(
  PARAM1 IN VARCHAR2,
  PARAM2 OUT XMLTYPE
);&lt;/code&gt;
&lt;p&gt;And here is the Perl having trouble:&lt;/p&gt;
&lt;code&gt;#!/usr/bin/perl
use DBI;
use DBD::Oracle qw(:ora_types);
use Data::Dumper;

my $dbh = DBI-&gt;connect( "dsn", "user", "pass", { RaiseError =&gt; 1 } );
$dbh-&gt;trace(15,"trace");

my $query = $dbh-&gt;prepare( qq{BEGIN schema.package.TEST('blah', ?); commit; END;});

my $xml;
$query-&gt;bind_param_inout(1, \$xml, 32000, { ora_type =&gt; ORA_XMLTYPE } );
$query-&gt;execute();
$dbh-&gt;DESTROY;
undef $dbh;

print Dumper($xml);&lt;/code&gt;

&lt;p&gt;The binding causes a segmentation fault and never returns, even when wrapped in an eval statement. Here is the last text in the trace:&lt;/p&gt;
&lt;code&gt;-&gt; bind_param_inout for DBD::Oracle::st (DBI::st=HASH(0x18d6828)~0x18d67c8 1 SCALAR(0x183ddac) 32000 HASH(0x18d67bc))
dbd_bind_ph(): bind :p1 &lt;== undef (type 0 (DEFAULT (varchar)), inout 0x183ddac, maxlen 32000, attribs: HASH(0x18d67bc))
dbd_rebind_ph() (1): rebinding :p1 as NULL (not-utf8, ftype 108 (ORA_XMLTYPE or SQLT_NTY), csid 0, csform 0, inout 1)
 in  dbd_rebind_ph_xml&lt;/code&gt;
&lt;p&gt;Can anyone tell me if I am doing something wrong to get this XMLTYPE out of the stored procedure? I should add that the names of the innocent have been protected in the above code and that I should tell you that this runs in an Apache/MOD Perl environment (I have modified the displayed code to ignore the web bits). Additionally, we are running DBD version 1.42 with Oracle on the 10 version. I should also note that I am able to execute the procedure using Oracle Sql Developer.&lt;/p&gt;</field>
</data>
</node>
