Re: null literal in 9.3
Posted in 2005
Is there a reason for a view with a null column? I am curious how this
could be useful?
You could do this in your select :
select
case when 't'::boolean then null::integer end a,
id
from
test
;
I also wrote a procedure called null() that always returned null. I
don't know what kind of performance hit that takes versus the above or
the view.
Michael Wimmer wrote:
> Doug Lawry wrote:
> > I can't reproduce this on 9.20.F, 9.30.UC7 or 9.40.FC1, so I'm not convinced the
> > problem isn't elsewhere. However, try '':INTEGER as an alternative both to NULL
> > and CAST.
>
> Hi Doug,
>
> thanks a lot, '' did the trick.
>
> create view niltab (a)
> as select cast('' as INTEGER),
> from informix.systables>
> Funny that you can not reproduce the problem. Did you try to create a
> view and select from the view? Only the select on the view fails,
> selecting from a table and creating the view works...
>
> If I change the '' to NULL inside the cast function, the select on the
> view fails....
>
> Regards,
>
> Michael