Sirs. I have DBI code which connects to a newly installed
Oracle 10g database. When I run this code under Sun Solaris
it works fine. However when I move the same code to an AIX
machine I get the following error.
DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DB
+D ERROR: OCIStmtExecute) [for Statement "SELECT count(*)
FROM trans_hist
WHERE TO_CHAR(sched_dttm,'YY/MM/DD') = ? and
dep_id = ? and
file_id = ?" with ParamValues: :p1='07/03/07', :p2=
+'1', :p3='300'] at QueMgrDaemon.pl line 2318.
Can't execute statement: SELECT count(*)
FROM trans_hist
WHERE TO_CHAR(sched_dttm,'YY/MM/DD') = ? and
dep_id = ? and
file_id = ? , ORA-01008: not all variables bound (D
+BD ERROR: OCIStmtExecute) at QueMgrDaemon.pl line 2318.
I am connecting using host, user, password and sid therefore I am bypassing the client and tnsnames.ora. I have to do this as I could not wait for tnsnames.ora to be edited, been 2 months still waiting.
{
my $sth;
sub CheckTransmissionHist {
my ( $FileId, $DepartmentID, $ScheduleDttm) = @_;
$ScheduleDttm = '07/03/07';
my $ltqs_dbh = &ConnectToDatabase();
my $SelStatement =
"SELECT count(*)
FROM trans_hist
WHERE TO_CHAR(sched_dttm,'YY/MM/DD') = ? and
dep_id = ? and
file_id = ?";
unless( defined($sth)) {
$sth = $ltqs_dbh->prepare($SelStatement)
or die "Can't prepare statement:$SelStatement , $DBI::errst
+r";
}
$sth->bind_param( 1, $ScheduleDttm ) or die "BOOM";
$sth->bind_param( 2, $DepartmentID ) or die "BOOM";
$sth->bind_param( 3, $FileId ) or die "BOOM";
$sth->execute()
or die "Can't execute statement: $SelStatement , $DBI::
+errstr";
....
....
The error is encountered the second time the execute statement is run, first time thru is fine. This leads me to belive its due to some cashed statement not being handled correctly. I don't think it's the code as it runs ok on the SUN box with Perl 5.005_03, but blows up under AIX with Perl v5.8.2. Any and all ideas are welcome, and thanks in advance. Hibbarra