Subject | Re: [firebird-support] help me stored procedures coding |
---|---|
Author | Artur Anjos |
Post date | 2003-09-16T20:21:57Z |
Luiz,
Some comments inside your code:
*/
SELECT * FROM autor SUSPEND;
*/
do something like:
CREATE PROCEDURE autores
RETURNS ( List of your variables to return here )
AS
BEGIN
/* If you are expecting multiple rows, put it on a for cicle */
FOR
SELECT BlaBlaBla FROM autor
/* Where do you want the return values to go */
INTO :YourVariable, :YourVariable2
DO
SUSPEND;
END
This is a bad example. You should find good examples in documentation.
Artur
Some comments inside your code:
> CREATE PROCEDURE autores/* As you can see here, your procedure will not return anything */
> AS/* The error you got is that you forgot the INTO clause and terminator here
> BEGIN
> SELECT * FROM autor
*/
> /* Procedure body *//* If you remove your comment your line reads as:
> SUSPEND;
SELECT * FROM autor SUSPEND;
*/
> ENDIf you want your procedure to return something from table autor you should
do something like:
CREATE PROCEDURE autores
RETURNS ( List of your variables to return here )
AS
BEGIN
/* If you are expecting multiple rows, put it on a for cicle */
FOR
SELECT BlaBlaBla FROM autor
/* Where do you want the return values to go */
INTO :YourVariable, :YourVariable2
DO
SUSPEND;
END
This is a bad example. You should find good examples in documentation.
Artur