On Apr 15, 3:52 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Mon, Apr 14, 2008 at 7:11 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > snip> > my $sql = q/SELECT Account,Last_Name,First_Name,Email_Address FROM > > > prospects WHERE Email_Address='?'/; > > > Drop the singlequotes. This way your SQL searches for a literal > > questionmark in the Email_Address column. > > snip > > Are you certain? DB2, for instance, requires the use of single quotes > for strings (double quotes are for system objects). Are you confusing > placeholders and Perl/shell interpolation? > > -- > Chas. Owens > wonkden.net > The most important skill a programmer can have is the ability to read.
Most likely Email_Address is set as VARCHAR or whatever. This way " WHERE Email_Address='?' " does find all email addresses that are ? and ? only or depending on settings, query craches. If you want to find all address containing ?-chart use this: " WHERE Email_Address like '%?%' ". For using placeholder you must remove quotes, so the query is: " WHERE Email_Address=? " and execution: my $sth = $dbh->prepare($sql); $sth->execute($email) or die $dbh->errstr; Of course you can first check if query does anything by: my $sth = $dbh->prepare($sql); my $execute_rows = $sth->execute($email); # get affected rows $sth->execute($email) or die $dbh->errstr; # execute it -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/