A question pertaining to this:
Why can I use NVL(...) and the FIRST # syntax in ISQL, but in my 4gl
code, the only way I can use them is to prepare them? I think the FIRST
# would be a great way to just get the first row that my query returns
without having to OPEN, FETCH, and CLOSE a cursor, but it kinda defeats
my purpose when I have to prepare the statement instead of just using it
inline.
Do the compiler and the engine have different "grammars"? I thought
that what worked in one would work in the other, but apparently that's
not the case.
Thanks.
Jose Miguel Giraldez wrote:
>
> try
> SELECT a.last|| ',' || a.first
> FROM a
> WHERE a.first IS NOT NULL
> UNION
> SELECT a.last
> FROM a
> WHERE a.first IS NULL>
> on IDS 7.3
> SELECT a.last|| ',' || NVL(a.first," ")
> FROM a
>
> Rafal Furdzik escribi':
>
> > If a.first is null,this select will return nulll
> >
> > Select a.last || ', ' || a.first
> > From a
> >
> > How to return a.last only in case if a.first is null. Please help.