Hi list
When I run the following program, I am getting the following error

 
$perl code1.pl
Line_of_buss_id 100 with insured_number 00279
execute called with 2 bind variables when 0 are needed at C:/perl/site
/lib/DBI.pm line 1347.
#!C:\perl\ActivePerl\Perl\bin\perl -w
use DBI;
use strict;
use DBI qw(:sql_types);
DBI->trace( 2, 'dbitrace.log' );

my $dbh1 = DBI->connect("dbi:Oracle:db1", "user1", "user1" ) or die "C
an't make 1st database connect: $DBI::errstr\n";

my $sel1 = $dbh1->prepare("select line_of_buss_id,insured_number
from coverage_app
where status='Posted'
and cover_app_id in (select cover_app_id from report.submits)");
$sel1->execute();
my ( $line_of_buss_id, $insured_number );
$sel1 -> bind_columns( \( $line_of_buss_id, $insured_number ) );
my $sel2 = $dbh1->prepare("select count(*)
from coverage_app
where status='Posted'
and cover_app_id in (select cover_app_id from report.submits)");

my $ins  = $dbh1 -> prepare("insert into app_renewal
(renewal_id,line_of_buss_id,status,insured_number)
values
(app_renewal_seq.nextval,?,'New',?)"); <----------------------Need to pass two 
parameters
my $comp_rows;
while ( $sel1 -> fetch ) {
   print "Line_of_buss_id $line_of_buss_id with insured_number $insure
d_number\n";
   $comp_rows = $dbh1 -> selectrow_array( $sel2, {}, $line_of_buss_id,
$insured_number );
   if ( ! $comp_rows ) {
   print "Inserting Insured Number $insured_number for $line_of_buss_id\n";
   $ins ->bind_param(1, $line_of_buss_id ); <----------------------Problem is here
   $ins ->bind_param(2, $insured_number );  <----------------------Problem is here
   $ins -> execute();}
   else
   {print "$insured_number already exists\n"};
}
$dbh1->disconnect();

I need to pass two parameters to the insert statement, the way I am binding looks like 
wrong.
Any one has suggestions?.





---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today

Reply via email to