Subject | Re: [firebird-support] Selectable sored procedure and SP inside it |
---|---|
Author | Raigo |
Post date | 2004-09-21T08:35:52Z |
Helen and Martijn thanks :)
I got it to work :)
The question was in putting SUSPEND inside the second begin/end block,
like you said.
CREATE PROCEDURE SP_TOOPAEV_TUNNID RETURNS (
FKOOD VARCHAR(10),
ISIKID VARCHAR(11),
TOO_TEGEVUS VARCHAR(2),
ALGUS TIMESTAMP,
LOPP TIMESTAMP,
TOOTATUD_OOSEL DOUBLE PRECISION,
TOOTATUD_PAEVAL DOUBLE PRECISION,
TOOTATUD_OHTUL DOUBLE PRECISION
) AS
BEGIN
for select fkood, isikid, too_tegevus, algus, lopp from v_toopaev into
:fkood, :isikid, :too_tegevus, :algus, :lopp
DO
BEGIN
execute procedure SP_TOOPAEV_TUNDE(:algus, :lopp)
returning_values (:tootatud_oosel, :tootatud_paeval, :tootatud_ohtul) ;
SUSPEND;
END
END
I got it to work :)
The question was in putting SUSPEND inside the second begin/end block,
like you said.
CREATE PROCEDURE SP_TOOPAEV_TUNNID RETURNS (
FKOOD VARCHAR(10),
ISIKID VARCHAR(11),
TOO_TEGEVUS VARCHAR(2),
ALGUS TIMESTAMP,
LOPP TIMESTAMP,
TOOTATUD_OOSEL DOUBLE PRECISION,
TOOTATUD_PAEVAL DOUBLE PRECISION,
TOOTATUD_OHTUL DOUBLE PRECISION
) AS
BEGIN
for select fkood, isikid, too_tegevus, algus, lopp from v_toopaev into
:fkood, :isikid, :too_tegevus, :algus, :lopp
DO
BEGIN
execute procedure SP_TOOPAEV_TUNDE(:algus, :lopp)
returning_values (:tootatud_oosel, :tootatud_paeval, :tootatud_ohtul) ;
SUSPEND;
END
END