Subject Re: [Firebird-Java] Error in making stored procedure
Author Carlos Alberto Panizza
Hi Sudarshan,

you should write you procedure as:

set term ^ ;
CREATE PROCEDURE X(
A integer
)
AS
BEGIN
delete from job where id=:a;
END ;
set term ; ^

The "SUSPEND" is not necessary since your procedure is not returning values.
The "set term" are necessary to change the terminator (normally the ";").

Carlos A. Panizza



-----Mensagem Original-----
De: "Sudarshan Wad" <sudan5757@...>
Para: <Firebird-Java@yahoogroups.com>
Enviada em: sexta-feira, 29 de agosto de 2003 02:18
Assunto: [Firebird-Java] Error in making stored procedure


> hi,
> I am sudarshan.I am working on project involving firebird 1.0 as a
> database.I have to write a stored procedure which takes integer as a
> parameter and has some local variables and stored procedure will only
> do all deleting.Offcourse i can write trigger as well.
> Code as simple as like this-->
>
> CREATE PROCEDURE X(
> A integer
> )
> AS
> BEGIN
> delete from job where id=:a;
> SUSPEND;
> END ;
>
>
> gives me errors -->
>
> 1)
> Statement #1:
> Dynamic SQL Error
> SQL error code = -104
> Unexpected end of command
>
> CREATE PROCEDURE X(A integer)AS BEGIN delete from job where id=:a;
>
> 2)
> Statement #2:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 2, char 1
> SUSPEND
>
> 3)
> Statement #3:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 2, char 1
> END
>
>
> Can any one tell me why these errors are comming.I referred to site:-
> http://www.ibphoenix.com/a498.htm
> so check for how to write stored procedures and triggers.I found same
> format.
> If anyone knows the answer please let me know.
>
> Thank you
>
>
> sudarshan
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>