Re: Stored procedures from 4gl?
Posted in 1993
In <rromero.740784714@mtecv2> rromero@academ01.mty.itesm.mx (Ricardo Javier Romero Elizondo) writes:
>I am currently trying to see if I an execute stored procedures from 4gl. After
>creating the procedure using DB-Access, I am currently trying to see if I can
>execute that procedure from 4gl.
>I got as far as a prepare statement and it DOES execute said procedure, but I
>still don't know how to handle the returning values that the procedure returns.
>Can anyone PLEASE shed some light in the subject?
If the procedure returns data then you need to use a cursor to handle
the data. For example, the following code uses the read_address()
procedure from Figure 8-1 of the Guide to SQL Reference manual (Pg 8-7):
DATABASE stores
MAIN
DEFINE cust RECORD LIKE customer.*
PREPARE stm FROM "EXECUTE PROCEDURE read_address(?);"
DECLARE curs CURSOR FOR stm
OPEN curs USING cust.lname
FETCH curs INTO cust.fname THRU cust.zipcode
DISPLAY cust.*
END MAIN
Hopefully, in I4GL 5.0 the four statements will become simply:
EXECUTE PROCEDURE read_address(cust.lname) INTO cust.fname THRU cust.zipcode
graeme
--
Disclaimer: The author's opinions are his own, and not necessarily
those of Pyramid Technology Ltd. or Pyramid Technology Inc.
---------------------------------------------------------------------------
-m------- Graeme Sargent Voice: +44 (0)252 373035
---mmm----- Senior Database Consultant Fax : +44 (0)252 373135
-----mmmmm--- Pyramid Technology Ltd. Telex: Tell who???
-------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk
---------------------------------------------------------------------------
We have the technology. The tricky bit is learning how to use it.