Re: Stored procedure help
Posted in 1999
In article <7ffiv3$3kc$1@isn.dac.neu.edu>,
sbandaru@lynx.dac.neu.edu wrote:
> Greeting All,
>
> I am very new to Informix and infact I am not a database champion. I
> have to right a small stored procedure in informix for a project that I
> am working on and I read through the help files and had the skeleton
> ready
> but could not execute it as I am getting a syntax which I am not able ti
> figure out. I wiam including the stored proedure below and was hoping to
> get some help from some one.
>
> Heres the small Stored Procedure
> ------------------------------------------------------------------------
> CREATE FUNCTION GetNextSeqNumber (tablename char(20))>
> RETURNING INTEGER;
>
> -- Define the variables Now
> DEFINE Keyvalue INTEGER;
> DEFINE RowsUpdated INTEGER;
>
> -- NOW EXECUTE THE SQL STATEMENT
> UPDATE SequenceNumber
> SET KeyValue = CurrentSeqNumber = NextSeqNumber,
> NextSeqNumber = (NextSeqNumber + IncrementBy),
^^^
> --LastUpdateDate = today
Probably me being silly here, but it looks as though someone has commented out
the above line thereby leaving the previous line terminating in a comma.
Just a thought ?
Also see Art's comments re ending lines with a ';'.
Also, if you are using "vi" to edit the procedure source, where is the cursor
positioned after the "syntax error" is returned?
> WHERE TableName = tablename
> AND MaximumValue > (NextSeqNumber + IncrementBy)
(SNIPPED)
Regards
"Nothing succeeds like a toothless budgerigar"
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own