my $sth2 = $dbh->prepare("BEGIN cbtno.purge_images". "(:fil, :dir_alias, :name); END;") or die "\nCan't prepare SQL statement:\n$DBI::errstr\n"; sth2->bind_param(":fil", $hashref->{IMP_ID} ); sth2->bind_param_inout(":dir_alias", \$dir_alias, 100); $sth2->bind_param_inout(":name", \$name, 100); $sth2->execute # NOT Perl CREATE OR REPLACE PROCEDURE purge_images (imp_id_in IN NUMBER, dir_out OUT VARCHAR2, file_out OUT VARCHAR2, debug_in IN BOOLEAN := false ) IS fil BFILE; dir_alias VARCHAR2(30); dir_path VARCHAR2(255); name VARCHAR2(2000); BEGIN dir_out := 'none'; file_out := 'none'; FOR l_rec in (select imp_imh_id, imp_page_no, imp_image from daybreak.image_pages where imp_id = imp_id_in) LOOP fil := l_rec.imp_image; dbms_lob.filegetname(fil, dir_alias, name); SELECT directory_path INTO dir_path FROM dba_directories WHERE directory_name = dir_alias; dir_out := dir_path; file_out := name; END LOOP; END;