Re: Stored Procedures, help
Posted in 1999
On Wed, 3 Feb 1999, Tony Flaherty wrote:
> We are trying to write some very simple stored procedures using DB-ACCESS.
>
> Versions
>
> cat $INFORMIXDIR/etc/*-cr
> INFORMIX-4GL Interactive Debugger Version 6.05.UC1
> Copyright (C) 1984-1995 Informix Software, Inc.
> INFORMIX-4GL Version 6.05.UC1
> Copyright (C) 1984-1995 Informix Software, Inc.
> INFORMIX-4GL Rapid Development System Version 6.05.UC1
> Copyright (C) 1984-1995 Informix Software, Inc.
> INFORMIX-SQL Version 6.05.UC1
> Copyright (C) 1984-1995 Informix Software, Inc.
> INFORMIX-OnLine Dynamic Server Version 7.24.UC5
> Copyright (C) 1986-1998 Informix Software, Inc.
>
>
> Procedure
OK; I extracted the procedure from your email and tried it in both
my SQLCMD program and in DB-Acccess 7.24.UC1, and both accepted it.
Are you sure you're using dbaccess? You'd get the syntax error if
you tried using isql instead of dbaccess -- ISQL doesn't know about
statements which contain unquoted semi-colons, meaing CREATE PROCEDURE
statements.
> CREATE PROCEDURE ex_cont_ex()>
> DEFINE i,s,j INT;
>
> FOR j = 1 TO 20
>
> IF j > 10 THEN
> CONTINUE FOR;
> END IF
>
> LET i,s = j,0;
>
> WHILE i > 0
> LET i = i - 1;
> IF i = 5 THEN
> EXIT FOR;
> END IF
> END WHILE
> END FOR
>
> END PROCEDURE
>
> The above procedure is straight from the manual but I still get a syntax
> error at the DEFINE statement. I know we're missing something obvious but I
> don't know what it is :o( We're new to SPL. For all I know we don't
> actually have it! Although I take the manual to say that its included with
> Db-Access.
>
> Thanks
>
> Tony Flaherty.
> Analyst Programmer
> Misys Financial Systems
>
> Change at to @ to reply by email
>
>
>
Yours,
Jonathan Leffler (jleffler@informix.com) #include <wish/I/was/skiing.h>
Guardian of DBD::Informix v0.60 (v0.61_02) -- http://www.perl.com/CPAN
Informix IDN for D4GL & Linux -- http://www.informix.com/idn