You'd certainly need to use a placeholder, and you'd need to specify
and ora_type for it. Not sure what type, offhand, and I'm not sure
if it'll work anyway. I've not tried it. Head in that direction and
let me know how it goes :)

Tim.

On Tue, Nov 18, 2003 at 01:56:41PM -0800, Steve Main wrote:
> Hello all,
> 
> I have been searching doc/google and have not been able to come up with
> the correct way to get a lob locator from an Oracle table and pass it to
> dbms_trim ( or even if there is a way ).  Can anyone push me in the
> right direction or have a working example?
> 
> Some of the things I have been trying.....
> 
> $lob_loc = $dbh1->selectrow_array(qq{
>         SELECT msg FROM hub_messages where msg_id = '17210' FOR UPDATE
>     }, { ora_auto_lob=>0 });
> 
> #    $sth1 = $dbh1->prepare( <<"SQL", {ora_auto_lob => 0 } );
> #       SELECT msg
> #         FROM hub_messages
> #        WHERE msg_id = '17210'
> #        FOR UPDATE
> #SQL
> 
>     $sth1->execute();
> 
>     ($lob_loc) = $sth1->fetchrow_array();
>     print "lobloc: $lob_loc\n";
>     $sth2 = $dbh1->prepare("BEGIN
>                                sys.dbms_lob.trim(
>                                      lob_loc => '$lob_loc',
>                                      newlen => '0');
>                             END;");
>     $sth2->execute();
> 
> #    ($message_list) = $sth1->fetchall_arrayref();
> 
> #    foreach $row (@$message_list) {
> #        ( $message_id ) = @$row;
> #        oraMSG "INFO: Truncating message id: $message_id....";
> #        $sth2 = $dbh1->prepare("BEGIN
> #                                    sys.DBMS_LOB.TRIM(
> #                                        lob_loc => '$message_id',
> #                                        newlen  => 0);
> #                                END;");
> #        $sth2->execute();
> #        oraMSG "Done.\n";
> #
> 
> Thanks
> 
> Steve
> 
> 

Reply via email to