Re: SPL Weirdness????
Posted in 2000
Allen,
You might try NOT creating a local variable that is the same name as a column
name. Try defining a local variable like "sys_date" rather than
"sysdate". Also "user_name" rather than username, "prim_key" rather than
"primary_key" ... well you get the idea...
I'm sure that will fix your problem.
At 08:16 PM 4/19/00 +0000, allenj wrote:
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.........
Any help appreciated.
Allen
Mark Griebling
mailto:mgriebling@acm.org