Re: SPL Weirdness????
Posted in 2000
From: allenj <allenj@ndr.com>
>
>The facts: IDS 7.31.UC2 HP-UX 10.20 HP K Box 260
>
>Why is it that everytime I get brave and try to write a SP in Informix,
>I wind up beating my head against my office wall????????? Or more to
>the point:
>
>The following SP:
>
> CREATE PROCEDURE displaynewcharts()
> RETURNING CHAR(25),CHAR(135),DATE,CHAR(15) ;>
> DEFINE primary_key CHAR(25);
> DEFINE general_desc CHAR(135);
> DEFINE sysdate DATE;
> DEFINE username CHAR(15);
>
> {SET DEBUG FILE TO "/tmp/trace.sp";}
> {TRACE ON ;}
>
> FOREACH
> select first 5 primary_key,general_desc,sysdate,username
> INTO primary_key,general_desc,sysdate,username
> from audit_trail
> where table = 'charts' and action = 'insert'
> order by sysdate desc
> RETURN primary_key,general_desc,sysdate,username
> WITH RESUME ;> END FOREACH ;
>
> {TRACE OFF ;}
> END PROCEDURE
>
>Generates the following error when I execute procedure
>displaynewcharts()
>
> 309: ORDER BY column (sysdate) must be in SELECT list.>
>Looks to me line column sysdate IS IN THE %$#@&*^% BLOODY SELECT
>LIST.........
Maybe you can try renaming your variables? Maybe it's trying to sort by the
variable? Or you could try ORDER BY 3 DESC?
Just a guess.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com