Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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

Replies are listed 'Best First'.
Re^3: Date Problem
by marto (Bishop) 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.

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2016-10-26 14:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (341 votes). Check out past polls.