Subject Re: Stored Procedure
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 4 Jul 2018 12:20:01 +0200
Newsgroups dbase.getting-started
Attachment(s) test_ean.png

On 2018-07-04 11:10 AM, Anna wrote:
> Hallo,
> I need to call a stored procedure created in firebird into a dbase (Ver. 2.21) program. I call in this way
> d= new Mydb();
> p= new StoredProc();
> p.database = d
> p.procedureName = "prova_procedura"
> p.params["column"].value -> return only first row but i need that return a rowset because the stored procedure return more rows
> Help me please
> Thanks
> Anna

I'm using ADO in dBASE 12 to access Firebird 2.5 stored procedures but I
presume using a standard query via the BDE should work the same way.  (I
haven't tried using the BDE for this so this is a case of ...where
Angels fear to tread. :-) )

A screenshot of a little test form is attached.

I've used the procedure name (verify_eancode) in an ADOquery's SELECT
statement. It fetches the correct records from the table and they can be
ordered as necessary.

    this.ADODATABASE1 = new ADODATABASE(this)
    with (this.ADODATABASE1)
      left = 2.0
      width = 10.0
      height = 1.0
      connectionString = "DRIVER=Firebird/InterBase(r)
      loginString = "sysdba/masterkey"
      active = true

    this.ADOQUERY1 = new ADOQUERY(this)
    with (this.ADOQUERY1)
       left = 25.0
       width = 8.0
       height = 1.0
       database = form.adodatabase1
       connected = true
       sql = "select  * from verify_eancode order by eancode"
       requestLive = false
       active = true

A second ADOquery fetches the main table for display and the
executeSQL() method of a read/write ADOdatabase object is used to
execute SQL INSERT, UPDATE or DELETE commands.