Re: Informix limitations, should we be using Oracle?
Posted in 2003
John Carlson wrote:
> On Tue, 18 Nov 2003 14:41:05 +0000, Paul Watson <paul@oninit.com>
> wrote:
>
>
>>If you cast null then it should work OK you need 9.x
>>
>>select null::INT
>
>>from systables;
>
>
>
> Same here:
>
> select null::char(1)
> from systables
I was wondering what the equivalent was in SE. In 4GL you used to be able
to use a blank string, like "". I know Jonathan, I know, it was a bug.. :-)
Anyway, that doesn't work in SQL, but strangely, (or not if it's related to
the 4GL "feature") if you convert an empty string to a numeric value by
adding any numeric value, the string gets converted to NULL along the way.
Now NULL plus any value is...
SELECT ""+0 AS col1 -- or ""+9999 or " "+0 or...
FROM systables
INTO TEMP mds
;
SELECT COUNT(*)
FROM mds
WHERE col1 IS NULL;
Well it does in SE version 7.24, so maybe it's been fixed now. ;-)
...Oh, maybe not, it also works in IDS 9.40. 8-)
Personally, I wouldn't be inclined to use this method or expect it to be
supported.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+
sending to informix-list