Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help!!! syntax error

 
   Database Forums (Home) -> Informix RSS
Next:  Set some dim-properties per database  
Author Message
Oskr

External


Since: Dec 03, 2009
Posts: 2



(Msg. 1) Posted: Thu Dec 03, 2009 9:16 am
Post subject: Help!!! syntax error
Archived from groups: comp>databases>informix (more info?)

Hi everybody, Im trying to create a simple store procedure but I get
an error when I define the variables.

Code:

CREATE PROCEDURE scope()
DEFINE x,y,z INT;
LET x = 5;
LET y = 10;
LET z = x + y; --z is 15
BEGIN
DEFINE x, q INT;
DEFINE z CHAR(5);
LET x = 100;
LET q = x + y; -- q = 110
LET z = 'silly'; -- z receives a character value
END
LET y = x; -- y is now 5
LET x = z; -- z is now 15, not 'silly'
END PROCEDURE;



Error:

Error: A syntax error has occurred.
SQLState: 42000
ErrorCode: -201
Position: 41
Error occured in:
CREATE PROCEDURE scope()
DEFINE x,y,z INT

 >> Stay informed about: Help!!! syntax error 
Back to top
Login to vote
Oskr

External


Since: Dec 03, 2009
Posts: 2



(Msg. 2) Posted: Thu Dec 03, 2009 9:55 am
Post subject: Re: Help!!! syntax error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 3 dic, 11:24, Art Kagel wrote:
> You need a semi-colon after the closing parenthesis of the procedure's
> argument list.  So:
>
> CREATE PROCEDURE scope();
>        DEFINE x,y,z INT;
>        LET x = 5;
>        LET y = 10;
>        LET z = x + y; --z is 15
>        BEGIN
>                DEFINE x, q INT;
>                DEFINE z CHAR(5);
>                LET x = 100;
>                LET q = x + y;     -- q = 110
>                LET z = 'silly'; -- z receives a character value
>        END
>        LET y = x; -- y is now 5
>        LET x = z; -- z is now 15, not 'silly'
> END PROCEDURE;
>
> Art
>
> Art S. Kagel
> Oninit (www.oninit.com)
> IIUG Board of Directors (a...@iiug.org)
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions and
> do not reflect on my employer, Oninit, the IIUG, nor any other organization
> with which I am associated either explicitly or implicitly.  Neither do
> those opinions reflect those of other individuals affiliated with any entity
> with which I am affiliated nor those of the entities themselves.
>
>
>
> On Thu, Dec 3, 2009 at 12:16 PM, Oskr wrote:
> > Hi everybody, Im trying to create  a simple store procedure but I get
> > an error when I define the variables.
>
> > Code:
>
> > CREATE PROCEDURE scope()
> >        DEFINE x,y,z INT;
> >        LET x = 5;
> >        LET y = 10;
> >        LET z = x + y; --z is 15
> >        BEGIN
> >                DEFINE x, q INT;
> >                DEFINE z CHAR(5);
> >                LET x = 100;
> >                LET q = x + y;     -- q = 110
> >                LET z = 'silly'; -- z receives a character value
> >        END
> >        LET y = x; -- y is now 5
> >        LET x = z; -- z is now 15, not 'silly'
> > END PROCEDURE;
>
> > Error:
>
> > Error: A syntax error has occurred.
> > SQLState:  42000
> > ErrorCode: -201
> > Position: 41
> > Error occured in:
> > CREATE PROCEDURE scope()
> >        DEFINE x,y,z INT
> > _______________________________________________
> > Informix-list mailing list
> > Informix-l... DeleteThis @iiug.org
> >http://www.iiug.org/mailman/listinfo/informix-list- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Now I get the next error:

Error: A syntax error has occurred.
SQLState: 42000
ErrorCode: -201
Position: 23
Error occured in:
CREATE PROCEDURE scope()

 >> Stay informed about: Help!!! syntax error 
Back to top
Login to vote
Jonathan Leffler

External


Since: May 09, 2007
Posts: 9



(Msg. 3) Posted: Fri Dec 04, 2009 3:17 am
Post subject: Re: Help!!! syntax error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 3, 9:16 am, Oskr wrote:
> Hi everybody, Im trying to create  a simple store procedure but I get
> an error when I define the variables.
>
> Code:
>
> CREATE PROCEDURE scope()
>         DEFINE x,y,z INT;
>         LET x = 5;
>         LET y = 10;
>         LET z = x + y; --z is 15
>         BEGIN
>                 DEFINE x, q INT;
>                 DEFINE z CHAR(5);
>                 LET x = 100;
>                 LET q = x + y;     -- q = 110
>                 LET z = 'silly'; -- z receives a character value
>         END
>         LET y = x; -- y is now 5
>         LET x = z; -- z is now 15, not 'silly'
> END PROCEDURE;
>
> Error:
>
> Error: A syntax error has occurred.
> SQLState:  42000
> ErrorCode: -201
> Position: 41
> Error occured in:
> CREATE PROCEDURE scope()
>         DEFINE x,y,z INT

Are you using ISQL to create the stored procedure?
If so, don't; it won't work.

-=JL=-
 >> Stay informed about: Help!!! syntax error 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
syntax of insert like mysql - is there an option to allow : insert into customer (fname) values ('a'),('b'); thanks. jack

Split table syntax and take out all constraints... - Hi All, I have a dbschema output for a large database, and I want to create all tables as RAW tables first in order to load data and then change the type to STANDARD. My problem is that I can't create a RAW table if the table syntax contains constraint...

Error only at ids 10: Why? - Hi, using the following SQL-Command I copy a lot of rows from a INFOMIX DB (source) into a ACCESS DB (destination) very fast: INSERT INTO tab SELECT * FROM [ODBC;DSN=DB;UID=name;PWD=test;].tab WHERE tab_typ = 50; After changing the IDS Server to..

617 error - Greetings, I have a user that needs to insert a char into a text datatype. The following 617 error is being received. I've looked into cast's but not sure if it will work. The sql statement is below. I know I've seen chatter on this before but do no...

4GL error -4339 - Hi there, I have very funny problem with 4GL, version 7.30, running on IDS 9.40 FC4, SparcV9 Solaris 8. Our non-interactive 4GL program (not modified for years) begun to fall with "4GL run-time error number -4339. 4GL has run out of data space mem...
   Database Forums (Home) -> Informix All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]