Hi,
I posted this on the cpanforum.org. Could you comment??
I am writing a Perl-DBI program to access two Oracle tables that store BFILE
lobs on the filesystem. After getting the lob locator, I plan to get the
directory path and filename from the lob locator, in order to purge the file
from the filesystem.
Trouble is, I have not been able to bind the lob locator returned so that I
can send it to the dbms_lob.filegetname procedure. I get the error:
PLS-00306: wrong number or types of arguments in call to 'FILEGETNAME'
Here is some of the code:
### Retrieve the returned rows of data
while ( $hashref = $sth->fetchrow_hashref() ) {
print STDERR "FETCH: $hashref->{IMP_IMH_ID}". "
$hashref->{IMP_PAGE_NO}\n" if $DEBUG;
my $sth2 = $dbh->prepare("BEGIN dbms_lob.filegetname". "(:fil,
:dir_alias, :name); END;",
{ ora_auto_lob => 0 }) # get the lob locator
or die "\nCan't prepare SQL statement:\n$DBI::errstr\n";
$fil = ${ $hashref->{IMP_IMAGE} };
$sth2->bind_param(":fil", $fil,
{ ora_type => ORA_BLOB } );
$sth2->bind_param_inout(":dir_alias", \$dir_alias, 100);
$sth2->bind_param_inout(":name", \$name, 100);
$sth2->execute
The problem is that my column type is NOT correctly BLOB. ora_type CLOB and
BLOB are defined as integer values (112 and 113). I am using type BFILE,
which is 114. When I use the integer 114 as the type, I get the error
stating invalid entry from DBD and that it will default to SQLVARCHAR.
Would it be possible to get the BFILE type included in the next change cycle
of DBD::Oracle??
Thanks!!