6 messages in com.mysql.lists.perlRe: selecting NULL values
FromSent OnAttachments
Clifford Meece27 Aug 1999 18:36 
Jochen Wiedmann28 Aug 1999 09:45 
Stork28 Aug 1999 19:52 
Jochen Wiedmann29 Aug 1999 02:34 
Jochen Wiedmann29 Aug 1999 02:40 
Jochen Wiedmann29 Aug 1999 02:40 
Subject:Re: selecting NULL values
From:Jochen Wiedmann (jo@ispsoft.de)
Date:08/29/1999 02:40:12 AM
List:com.mysql.lists.perl

Clifford Meece wrote:

I have a script that calls:

$sth=$dbh->prepare(qq{select acctId from accounts where acctNum='$acctNum' and subAcct=NULL});

This command works fine from the msql command propt(with $acctNum replaced with an actual value) but fails from my perl script with the error:

DBD::mSQL::st execute failed: parse error at line 2 near "= *end of input*" at ./findacct.new line 70.

What's $acctNum? Is it possible that it includes NUL bytes, single quotes or something else?

If it doesn't include NUL bytes, you should never use '$acctNum', but $dbh->quote($acctNum).

If it includes NUL bytes, forget about mSQL: It cannot deal with that.

Bye,

Jochen