Is there an example of the selectrow_array method using bind variables?  I
have not been able to successfully use the example in the book "Programming
the PERL DBI".

In my code, I have a previously prepared $dbh handle as follows:

$instance = "crsprod";
$username = "******";
$password = "*******";
%attr = (
          PrintError => 0,
          RaiseError => 1,
         );

$dbh = DBI->connect("DBI:Oracle:$instance",
                    "$username",
                    "$password",
                    \%attr
                    );

The statement is:

    my $pass_type =
       $dbh->selectrow_array ("
                                           select agreement_type
                                           from spcl_agreement
                                           where agency_num = ?
                                          ");

Since I use this $dbh for another statement against the same database, I
cannot put the bind variable in the the $dbh statement.  How can I pass this
query a bind variable without the execute statement?

Thank You

Reply via email to