# This is for calling stored procedures by just passing in a dbh, the procedure name and a param hash sub call_plsql { my ( $self, $dbh, $name, $params ) = @_; my @vars; foreach $key ( keys %$params ) { push( @vars, "$key => :$key" ); } my $call = "BEGIN $name( " . join( ', ', @vars ) . ' ); END;'; warn "$call\n" if ( grep(/-v/, @ARGV) ); my $sth = $dbh->prepare( $call ); foreach $key ( keys %$params ) { if ( ref($params->{$key}) eq 'ARRAY' ) { $sth->bind_param_inout( ":$key", @{ $params->{$key} } ); } else { $sth->bind_param( ":$key", $params->{$key} ); } } $sth->execute(); return; }