Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Date Problem

by Anonymous Monk
on Apr 26, 2010 at 09:55 UTC ( #836870=note: print w/ replies, xml ) Need Help??


in reply to Re: Date Problem
in thread Date Problem

my $SQL = "Select tran_seq_nbr, sale_amount From KCPOS_Tran_Header Where org_number = $ai_div And store_number = $ai_store And tran_number = $al_trans And terminal_number = $ai_reg And tran_Date = $adt_h_date"; my $sth = $dbh->prepare( $SQL ) or die "Couldn't prepare statement: " . $dbh->errstr; $sth->execute() or die "Couldn't execute statement: " . $sth->errstr; ( $ac_seq_nbr, $ac_sale_amount ) = $sth->fetchrow();

This what i am doing


Comment on Re^2: Date Problem
Download Code
Re^3: Date Problem
by nagalenoj (Friar) on Apr 26, 2010 at 10:36 UTC
    I think the problem is because of not quoting the date value($adt_h_date) in the query preparation.
Re^3: Date Problem
by marto (Chancellor) on Apr 26, 2010 at 10:59 UTC

    I don't know where you're getting the contents of $adt_h_date, but did you read the section on placeholders from the DBI docs? You want to use placeholders to protect against SQL injection. I'd suggest looking this up in the documentation.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://836870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-09-24 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls