Subject | CASE syntax |
---|---|
Author | rogervellacott |
Post date | 2008-02-24T09:48:45Z |
Can anyone explain why this doesn't work? (It is part of a utility
to sort out disagreement between database versions where one uses T
and F as boolean values, and the other 1 and 0).
UPDATE MY_TABLE SET MY_BOOL =
CASE
WHEN (CAST(MY_BOOL AS VARCHAR(1)) = `T') THEN `1'
ELSE `0'
END
The field MY_BOOL is defined with the domain "BOOLEAN", which is
described as follows;
CREATE DOMAIN "BOOLEAN"
AS Char(1)
DEFAULT "F"
FB 2.03.
Under IB_SQL it reports "unexpected end of command" on line 3.
Under Flamerobin it reports "SQL statement can't be 0."
Am I having a "senior" moment here?
Roger Vellacott
Passfield Data Systems Ltd
to sort out disagreement between database versions where one uses T
and F as boolean values, and the other 1 and 0).
UPDATE MY_TABLE SET MY_BOOL =
CASE
WHEN (CAST(MY_BOOL AS VARCHAR(1)) = `T') THEN `1'
ELSE `0'
END
The field MY_BOOL is defined with the domain "BOOLEAN", which is
described as follows;
CREATE DOMAIN "BOOLEAN"
AS Char(1)
DEFAULT "F"
FB 2.03.
Under IB_SQL it reports "unexpected end of command" on line 3.
Under Flamerobin it reports "SQL statement can't be 0."
Am I having a "senior" moment here?
Roger Vellacott
Passfield Data Systems Ltd