Subject | Re: [firebird-support] Prepared Statement with "? IS NULL" Generates error |
---|---|
Author | Helen Borrie |
Post date | 2005-02-23T04:59:37Z |
At 01:22 AM 23/02/2005 +0000, you wrote:
It's not valid to parameterise column names. The parameterised statement
should be
UPDATE SIMPLENAME
SET PKEY = ?,
FNAME = ?
WHERE
((aField IS NULL AND PKEY IS NULL) OR PKEY = ?)
AND
((aField IS NULL AND FNAME IS NULL) OR FNAME = ?)
./heLen
>Hi,It aint gonna get fixed because it aint broke.
>
>I'm trying to create the Prepared Statement below with "? IS NULL" in
>it. This generates an error in Firebird 1.5.2 SS.
>
>Is there a workaround for this, or is this going to be fixed anytime
>soon? MySQL, Postgres, Oracle, etc., etc. support this syntax, so it
>creates a signifucant incompatibility if you are trying to migrate to
>Firebird.
>
>The statement is:
>
>UPDATE SIMPLENAME SET PKEY = ?, FNAME = ? WHERE ((? IS NULL AND PKEY
>IS NULL) OR PKEY = ?) AND ((? IS NULL AND FNAME IS NULL) OR FNAME = ?)
It's not valid to parameterise column names. The parameterised statement
should be
UPDATE SIMPLENAME
SET PKEY = ?,
FNAME = ?
WHERE
((aField IS NULL AND PKEY IS NULL) OR PKEY = ?)
AND
((aField IS NULL AND FNAME IS NULL) OR FNAME = ?)
./heLen