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

In reply to DBI problem on AIX/Oracle 10g by hibbarra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.