DBD Oracle column type



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!!


.



Relevant Pages

  • Re: Problem with DBD::Oracle ora_auto_lob not working
    ... When you try to get a LOB through a SP. ... I never asked for a lob locator, I asked for the contents of column 'x' and if I run this select in Perl I get the clob contents back. ... I have added to my test case a little to actually write utf8 data and get it back - it would seem that the pod warning with respect to utf8 data not coming back from ora_lob_read /may/ be out of date. ... SELECT x from martin; ...
    (perl.dbi.users)
  • Re: Basic LOB Concept
    ... > A LOB instance has a locator and a value. ... The LOB locator is a reference ... > row') or as an 'outline' LOB, where a LOB locator would reference the ... referencing the same BLOB object as the row with pk=1? ...
    (comp.databases.oracle.misc)
  • Re: Basic LOB Concept
    ... Question regarding the LOB data type. ... and I 've got use to the concept of 2 object references can reference the ... The LOB locator is a reference to where the LOB value is physically stored. ... To add more, you can choose if the LOB is stored inlineor as an 'outline' LOB, where a LOB locator would reference the LOB. ...
    (comp.databases.oracle.misc)
  • Re: passing CLOB in Stored Procedure as IN/OUT
    ... lob before doing an in/out operation on a lob being passed as in/out ... using OCILobCreateTemporary call and then we use OCILobWrite or ... CLOB column rather for stored-procedure. ... The only requirement for LOB I/O is that the LOB locator ...
    (comp.databases.oracle.misc)