Re: how to: run stored proc from 4gl code
Posted in 1998
Pavel Berzin wrote:
>Hi, all!
>Please help.
>How to run stored procedure from 4gl code?
>
>I did so:
>1. stored procedure returns one value
>2. 4gl code is like this
> DEFINE ii integer
> EXECUTE PROCEDURE aaa() INTO ii>
>Doesn't work.
>
>"You must declare cursor procedure before ... bla-bla-bla"
Sure you have to declare a cursor on stored procedure. More than this
you should prepare the execute procedure statement (at least this
is required in my version of 4GL). So your code should look like:
DEFINE ii integer
PREPARE stmt FROM "EXECUTE PROCEDURE aaa()"
DECLARE crsr FOR stmt
OPEN crsr
FETCH crsr INTO ii
CLOSE crsr
... all that stuff with freeing the cursor/statement
Hope it helps,
Octav
>
>Thank you,
>Berzin Pavel
>
>
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com