Hello all,
 
I encouter an error with DBD::Oracle and Oracle instances 10g that I
dont understand :
  DBD::Oracle::st execute failed: ORA-01008: not all variables bound
(DBD ERROR: OCIStmtExecute)

This script works fine with Oracle 9i.
I compiled DBD::Oracle (1.19) based on Oracle 9i (on Sun-Solaris10) -
DBI 1.58

I tried to compile DBD::Oracle (1.21) based on Oracle 10g (on
Sun-Solaris10) with the same error.
I tried to use DBI_TRACE=2 or 3 but I dont find the trace usefull.

My tests against Oracle instances :
  9i  (new install)      - ok (it is always ok with 9i)
  10g (new install)      - bad
  10g (migrated from 9i) - bad

My tests against placeholders :
  If I used placeholders like ":param1", it works the first time, then
it will failed in general

My tests against the SQL query :
  If I comment the first column returned (the TO_CHAR(...) AS DT, it
works the first time
  then it failed

So the problem seems to be with CACHE or something like that ?


My script is :
#
------------------------------------------------------------------------
use DBI;
$dsn="dbi:Oracle:host=my_server;port=1521;sid=my_sid";
my $query = "
  SELECT
    TO_CHAR(TO_DATE(col1,'DD/MM/YY'),'YYYYMMDD') AS DT,
    col2,col3,col4 FROM  table1 WHERE     SUBSTR(col1,4) = ? 
";
$DBH = DBI->connect($dsn,"toto","toto",{PrintError => 0, RaiseError =>
1});
$STH = $DBH -> prepare($extraction_query);
my $month_MMAA="03/08";
#$STH->bind_param(":pr1", $month_MMAA);
$STH->bind_param(1, $month_MMAA);
$STH->execute();
 DBI::dump_results($STH);
$STH->finish();
$DBH->disconnect();
#
------------------------------------------------------------------------

I need your help

Regards

Pascal

Reply via email to