Subject | RE: [ib-support] Firebird Workbench, Stored Procedures |
---|---|
Author | Henrik Sitter |
Post date | 2003-01-09T09:29:51Z |
Hello, Martijn. I got it to work. Thank you for responding so fast !
Henrik.
-----Original Message-----
From: Martijn Tonies [mailto:m.tonies@...]
Sent: 9. januar 2003 10:23
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Firebird Workbench, Stored Procedures
Hi Henrik,
you need to finish the statement with a ";".
SUSPEND is only needed for procedures that need to return output data
when called via a SELECT ... FROM procedurename statement.
FROM LEVERANDOR
INTO :LEVERANDORCOUNT;
Drop the SUSPEND unless you want to call it via a SELECT statement.
Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Henrik.
-----Original Message-----
From: Martijn Tonies [mailto:m.tonies@...]
Sent: 9. januar 2003 10:23
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Firebird Workbench, Stored Procedures
Hi Henrik,
> Hello, I get an error when trying to write a (test) stored procedurebut
> using Firebird Workbench. I don't know if this is the correct forum,
> I'll give it a try.giving
>
> I have 3 different codes, all trying to accomplish the same, all
> different errors.A SELECT statement in a procedure always needs an INTO clause. And
>
> Case 1:
>
> SET TERM ^! ;
> CREATE PROCEDURE TEST1 AS
> BEGIN
> SELECT COUNT(*)
> FROM LEVERANDOR
> SUSPEND;
> END ^!
> SET TERM ; ^!
>
> This is the error I get: "ISC ERROR MESSAGE: Dynamic SQL Error, SQL
> error code = -104, Token unknown - line 6, char 3 SUSPEND".
you need to finish the statement with a ";".
SUSPEND is only needed for procedures that need to return output data
when called via a SELECT ... FROM procedurename statement.
> If I comment out SUSPEND, I get another error: "ISC ERROR MESSAGE:1
> Dynamic SQL Error, SQL error code = -104, Token unknown - line 7, char
> END".See above.
> Case 2:SELECT COUNT(*)
>
> SET TERM ^! ;
> CREATE PROCEDURE TEST1 returns (LEVERANDORCOUNT Integer) AS
> BEGIN
> SELECT COUNT(*)
> INTO :LEVERANDORCOUNT
> FROM LEVERANDOR
> SUSPEND;
> END ^!
> SET TERM ; ^!
>
> This is the error I get: "ISC ERROR MESSAGE: Dynamic SQL Error, SQL
> error code = -104, Token unknown - line 4, char 1 INTO".
FROM LEVERANDOR
INTO :LEVERANDORCOUNT;
Drop the SUSPEND unless you want to call it via a SELECT statement.
> Case 3:Put a ";" after the INTO :var to end the SELECT statement.
>
> SET TERM ^! ;
> CREATE PROCEDURE TEST1 returns (LEVERANDORCOUNT Integer) AS
> BEGIN
> SELECT COUNT(*)
> FROM LEVERANDOR
> INTO :LEVERANDORCOUNT
> SUSPEND;
> END ^!
> SET TERM ; ^!
>
> This is the error I get: "ISC ERROR MESSAGE: Dynamic SQL Error, SQL
> error code = -104, Token unknown - line 7, char 3 SUSPEND".
> I am using Firebird Workbench v.1.4.1 (trial version) and Firebirdwas
> v.1.0.0. I could upgrade to Firebird v.1.0.2 (or Alpha5), but there
> another problem with that.With regards,
>
> I'm a bit stuck, and any help will be appreciated :)
Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/