我正在从SQL Server迁移到Firebird。
在SQL Server中
CREATE PROCEDURE Departments_GetAll
AS
SELECT * FROM Departments
我在Firebird中尝试
CREATE PROCEDURE DEPARTMENTS_DELETEALL
AS
BEGIN
SELECT * FROM "Departments";
END^
SET TERM ; ^
但这不起作用。
它返回错误“SQL Code -104”
答案 0 :(得分:10)
存储过程需要返回参数和suspend
命令才能返回多行。
CREATE PROCEDURE DEPARTMENTS_GET_ALL
returns(id integer, name varchar(100))
AS
BEGIN
FOR SELECT id, name
FROM "Departments"
into :id, :name do
BEGIN
SUSPEND;
END
END^
SET TERM ; ^