Stored procedure giving syntax error in different version of informix
Posted in 2007
A poster reported that a stored procedure with 'create procedure p (c char(20)) returning int, char(20);' compiled fine on IDS 9.40.FC8 but raised error -201 (syntax error) on 9.40.FC5W2, with dbaccess pointing at the RETURNING clause. Responders asked where exactly the error appeared and for the full procedure text (Doug Lawry offered to reproduce it on a 9.4 HP-UX box). Art Kagel suggested the comma should be a semicolon, but Paul Watson corrected him that multiple return types are comma-separated, and Art agreed. No resolution is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Platform-Specific Issues
Hi,
i am new to informix sql procedures..
the sql below works fine in my development box
IBM Informix Dynamic Server Version 9.40.FC8
INFORMIX-SQL Version 7.20.UD8
HP-UX B.11.11
but it throws a syntax error in testing box
IBM Informix Dynamic Server Version 9.40.FC5W2
INFORMIX-SQL Version 7.20.UD8
HP-UX B.11.11
create procedure p (c char(20))
returning int,
char(20);
define en int;
define is int;
define r1 int;
define r2 char(20);
.
.
.
.
.
return r1,
r2;
end procedure;
looking forward for your help.
Regards
Raghu
raghu.shivaiah@gmail.com wrote:
> Hi,
>
> i am new to informix sql procedures..
> the sql below works fine in my development box
>
> IBM Informix Dynamic Server Version 9.40.FC8
> INFORMIX-SQL Version 7.20.UD8
> HP-UX B.11.11
>
> but it throws a syntax error in testing box
> IBM Informix Dynamic Server Version 9.40.FC5W2
> INFORMIX-SQL Version 7.20.UD8
> HP-UX B.11.11
>
> create procedure p (c char(20))
> returning int,
> char(20);>
> define en int;
> define is int;
> define r1 int;
> define r2 char(20);
>
>
> .
> .
> .
> .
> .
>
> return r1,
> r2;
> end procedure;
>
> looking forward for your help.
>
> Regards
> Raghu
>
What error do you get ?
NB! I would recommend to use dbaccess instead of isql
Claus
And the syntax error is reported where ?
Paul Watson
Tel: +44 1414161772 +1 913-400-2620
Mob: +44 7818003457 +1 913-636-2858
Web: www.oninit.com
Failure is not as frightening as regret.
> -----Original Message-----
> From: raghu.shivaiah@gmail.com [mailto:raghu.shivaiah@gmail.com]
> Posted At: 16 April 2007 04:51
> Posted To: comp.databases.informix
> Conversation: Stored procedure giving syntax error in
> different version of informix
> Subject: Stored procedure giving syntax error in different
> version of informix
>
>
> Hi,
>
> i am new to informix sql procedures..
> the sql below works fine in my development box
>
> IBM Informix Dynamic Server Version 9.40.FC8
> INFORMIX-SQL Version 7.20.UD8
> HP-UX B.11.11
>
> but it throws a syntax error in testing box IBM Informix
> Dynamic Server Version 9.40.FC5W2
> INFORMIX-SQL Version 7.20.UD8
> HP-UX B.11.11
>
> create procedure p (c char(20))
> returning int,
> char(20);>
> define en int;
> define is int;
> define r1 int;
> define r2 char(20);
>
>
> .
> .
> .
> .
> .
>
> return r1,
> r2;
> end procedure;
>
> looking forward for your help.
>
> Regards
> Raghu
>
On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
> And the syntax error is reported where ?
>
> Paul Watson
> Tel: +44 1414161772 +1 913-400-2620
> Mob: +44 7818003457 +1 913-636-2858
> Web:www.oninit.com
>
> Failure is not as frightening as regret.
>
>
>
> > -----Original Message-----
> > From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
> > Posted At: 16 April 2007 04:51
> > Posted To: comp.databases.informix
> > Conversation: Stored procedure giving syntax error in
> > different version of informix
> > Subject: Stored procedure giving syntax error in different
> > version of informix
>
> > Hi,
>
> > i am new to informix sql procedures..
> > the sql below works fine in my development box
>
> > IBM Informix Dynamic Server Version 9.40.FC8
> > INFORMIX-SQL Version 7.20.UD8
> > HP-UX B.11.11
>
> > but it throws a syntax error in testing box IBM Informix
> > Dynamic Server Version 9.40.FC5W2
> > INFORMIX-SQL Version 7.20.UD8
> > HP-UX B.11.11
>
> > create procedure p (c char(20))
> > returning int,
> > char(20);>
> > define en int;
> > define is int;
> > define r1 int;
> > define r2 char(20);
>
> > .
> > .
> > .
> > .
> > .
>
> > return r1,
> > r2;
> > end procedure;
>
> > looking forward for your help.
>
> > Regards
> > Raghu- Hide quoted text -
>
> - Show quoted text -
I am using dbaccess only. below is the error.
201: A syntax error has occurred.
create procedure p (c char(20))
returning int,
char(20); --------- The cursor points to this line.
<raghu.shivaiah@gmail.com> wrote in message
news:1176795673.271660.105850@n59g2000hsh.googlegroups.com...
> On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
>> And the syntax error is reported where ?
>>
>> Paul Watson
>> Tel: +44 1414161772 +1 913-400-2620
>> Mob: +44 7818003457 +1 913-636-2858
>> Web:www.oninit.com
>>
>> Failure is not as frightening as regret.
>>
>>
>>
>> > -----Original Message-----
>> > From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
>> > Posted At: 16 April 2007 04:51
>> > Posted To: comp.databases.informix
>> > Conversation: Stored procedure giving syntax error in
>> > different version of informix
>> > Subject: Stored procedure giving syntax error in different
>> > version of informix
>>
>> > Hi,
>>
>> > i am new to informix sql procedures..
>> > the sql below works fine in my development box
>>
>> > IBM Informix Dynamic Server Version 9.40.FC8
>> > INFORMIX-SQL Version 7.20.UD8
>> > HP-UX B.11.11
>>
>> > but it throws a syntax error in testing box IBM Informix
>> > Dynamic Server Version 9.40.FC5W2
>> > INFORMIX-SQL Version 7.20.UD8
>> > HP-UX B.11.11
>>
>> > create procedure p (c char(20))
>> > returning int,
>> > char(20);>>
>> > define en int;
>> > define is int;
>> > define r1 int;
>> > define r2 char(20);
>>
>> > .
>> > .
>> > .
>> > .
>> > .
>>
>> > return r1,
>> > r2;
>> > end procedure;
>>
>> > looking forward for your help.
>>
>> > Regards
>> > Raghu- Hide quoted text -
>>
>> - Show quoted text -
>
> I am using dbaccess only. below is the error.
>
> 201: A syntax error has occurred.>
> create procedure p (c char(20))
> returning int,> char(20); --------- The cursor points to this line.
Please post the entire procedure (or email it to me off-line if you prefer). I
have a 9.4 HP-UX system here on which I can replicate the problem and then work
out which syntax is actually being rejected.
--
Regards,
Doug Lawry
www.douglawry.webhop.org
raghu.shivaiah@gmail.com wrote:
> On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
Your CREATE PROCEDURE .... RETURNING... should end in a semi colon not a comma:
create procedure p (c char(20))
returning int;char(20);
Art S. Kagel
>>And the syntax error is reported where ?
>>
>>Paul Watson
>>Tel: +44 1414161772 +1 913-400-2620
>>Mob: +44 7818003457 +1 913-636-2858
>>Web:www.oninit.com
>>
>>Failure is not as frightening as regret.
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
>>>Posted At: 16 April 2007 04:51
>>>Posted To: comp.databases.informix
>>>Conversation: Stored procedure giving syntax error in
>>>different version of informix
>>>Subject: Stored procedure giving syntax error in different
>>>version of informix
>>
>>>Hi,
>>
>>>i am new to informix sql procedures..
>>>the sql below works fine in my development box
>>
>>>IBM Informix Dynamic Server Version 9.40.FC8
>>> INFORMIX-SQL Version 7.20.UD8
>>>HP-UX B.11.11
>>
>>>but it throws a syntax error in testing box IBM Informix
>>>Dynamic Server Version 9.40.FC5W2
>>>INFORMIX-SQL Version 7.20.UD8
>>>HP-UX B.11.11
>>
>>> create procedure p (c char(20))
>>> returning int,>>> char(20);
>>
>>>define en int;
>>>define is int;
>>>define r1 int;
>>>define r2 char(20);
>>
>>>.
>>>.
>>>.
>>>.
>>>.
>>
>>>return r1,
>>> r2;
>>>end procedure;
>>
>>>looking forward for your help.
>>
>>>Regards
>>>Raghu- Hide quoted text -
>>
>>- Show quoted text -
>
>
> I am using dbaccess only. below is the error.
>
> 201: A syntax error has occurred.>
> create procedure p (c char(20))
> returning int,
> char(20); --------- The cursor points to this line.>
>
> -----Original Message-----
> From: Art S. Kagel [mailto:kagel@bloomberg.net]
>
> raghu.shivaiah@gmail.com wrote:
> > On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
>
> Your CREATE PROCEDURE .... RETURNING... should end in a semi
> colon not a comma:
>
> create procedure p (c char(20))
> returning int;> char(20);
>
Disagree, to return two variables they are comma separated
> Art S. Kagel
>
> >>And the syntax error is reported where ?
> >>
> >>Paul Watson
> >>Tel: +44 1414161772 +1 913-400-2620
> >>Mob: +44 7818003457 +1 913-636-2858
> >>Web:www.oninit.com
> >>
> >>Failure is not as frightening as regret.
> >>
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: raghu.shiva...@gmail.com [mailto:raghu.shiva...@gmail.com]
> >>>Posted At: 16 April 2007 04:51 Posted To: comp.databases.informix
> >>>Conversation: Stored procedure giving syntax error in different
> >>>version of informix
> >>>Subject: Stored procedure giving syntax error in different
> version of
> >>>informix
> >>
> >>>Hi,
> >>
> >>>i am new to informix sql procedures..
> >>>the sql below works fine in my development box
> >>
> >>>IBM Informix Dynamic Server Version 9.40.FC8
> >>> INFORMIX-SQL Version 7.20.UD8
> >>>HP-UX B.11.11
> >>
> >>>but it throws a syntax error in testing box IBM Informix Dynamic
> >>>Server Version 9.40.FC5W2
> >>>INFORMIX-SQL Version 7.20.UD8
> >>>HP-UX B.11.11
> >>
> >>> create procedure p (c char(20))
> >>> returning int,> >>> char(20);
> >>
> >>>define en int;
> >>>define is int;
> >>>define r1 int;
> >>>define r2 char(20);
> >>
> >>>.
> >>>.
> >>>.
> >>>.
> >>>.
> >>
> >>>return r1,
> >>> r2;
> >>>end procedure;
> >>
> >>>looking forward for your help.
> >>
> >>>Regards
> >>>Raghu- Hide quoted text -
> >>
> >>- Show quoted text -
> >
> >
> > I am using dbaccess only. below is the error.
> >
> > 201: A syntax error has occurred.> >
> > create procedure p (c char(20))
> > returning int,
> > char(20); --------- The cursor points to this line.> >
> >
Paul Watson wrote:
>>-----Original Message-----
>>From: Art S. Kagel [mailto:kagel@bloomberg.net]
>>
>>raghu.shivaiah@gmail.com wrote:
>>
>>>On 16 Apr, 17:10, "Paul Watson" <p...@oninit.com> wrote:
>>
>>Your CREATE PROCEDURE .... RETURNING... should end in a semi
>>colon not a comma:
>>
>>create procedure p (c char(20))
>> returning int;>>char(20);
>>
>
>
> Disagree, to return two variables they are comma separated
>
>
> <SNIP>
You're right Paul. I thought the 'char(20) was declaring a variable. Read
too quickly.
Art S. Kagel