Hi monks the following is the error that i am getting when running the following script

############################################ # Function: ############################################ #Print deleting line details to file and Continue sub outputdeletedlines { print $JBM " inside outputdeletedlines\n"; my $ai_div = $_[0]; my $ai_store = $_[1]; my $ai_reg = $_[2]; my $al_trans = $_[3]; #my $adt_h_date = $_[4]; my $org_adt_h_date = $_[4]; # print $JBM "-- $adt_h_date --"; my $adt_h_date = "'".$org_adt_h_date."'"; #2010-04-26 14:07:09 my $datetime = localtime(); my $file = $inputfile; my $delete_log = ''; my $ac_seq_nbr; my $ac_sale_amount; #If already has input files, outputs name of current working f +ile #Else puts a default one in the current directory if( $inputfile ) { $delete_log = $file . "_delete_" . $master_job_no . "- +" . $job_number . "\.log"; } else{ $file = 'Default'; $delete_log = $file . "_delete_0-0\.log"; } if( !$Config{delete_dir} ) { $Config{delete_dir} = getcwd(). "/"; } open( my $delete_fh, ">>", $Config{delete_dir} . $delete_log ) or die "Failed to open delete file\n"; my $SQL = "Select tran_seq_nbr, sale_amount From KCPOS_Tran_Header Where org_number = :org_no And store_number = :str_no And tran_number = :tran_no And terminal_number = :term_no And tran_Date = to_date(:tran_dt,'YYYY-MM-DD HH24:MI:SS')"; # And tran_Date = :tran_dt"; print $JBM "preparing delete SQL\n"; my $sth = $dbh->prepare($SQL) or die "Couldn't prepare statement: " . $dbh->errstr; # my $adt_h_date = $dbh->quote('$org_adt_h_date'); print $JBM "-- $adt_h_date --"; print $JBM "prepared SQL\n"; # $sth->execute(q{to_date('$adt_h_date','YYYY-MM-DD HH24:MI:SS +')}) # or die "Couldn't execute statement: " . $sth->errstr; $sth->bind_param(":org_no",$ai_div); $sth->bind_param(":str_no",$ai_store,); $sth->bind_param(":tran_no",$al_trans); $sth->bind_param(":term_no",$ai_reg); $sth->bind_param(":tran_dt",$adt_h_date); $sth->execute() or die "Couldn't execute statement: " . $sth->errstr; ( $ac_seq_nbr, $ac_sale_amount ) = $sth->fetchrow(); $sth->finish(); print $delete_fh "\n Tran_Seq_Nbr: $ac_seq_nbr\t Division: $ai +_div\t Store : $ai_store\t Register: $ai_reg\t Tran: $al_trans\t Date: $adt_h_date\t Sal +e Amt: $ac_sale_amount"; close $delete_fh; return; }

I know its because of $adt_h_date field which has the value like '2007-08-10 00:00:00'

so how should i overcome this error

error is: Placeholder :0 invalid, placeholders must be >= 1 at C:/Perl/lib/DBD/Oracle.pm l ine 273, <$data_fh> line 7.

thanks


In reply to place holder error by Bheema_Tyco

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.