Page 1 of 1

StoredProcedure not shown at design neither runtime

Posted: 17.02.2009, 07:05
by manz
Dear All,

We using D2007 December Update, with Mysql and Zeos 6.6.4-stable.

Currently we using the stored procedure, but at zStoredProc1.StoredProcName (at design time) not shown, even the connection already connected to the database.

This zStoredProc1 at runtime want to use the parameters:

Code: Select all

with zStoredProc1 do
begin
   StoredProcName := 'sp_BalanceReport';
   ParamByName('MODEL').AsString := Mode;  <-- Point the error
   ParamByName('BegDate').AsDate := Manz.IIf(cxCheckBox1.Checked, cxDateEdit3.Date, d1);
   ParamByName('EndDate').AsDate := d2;
   ParamByName('BegMatNum').AsString := quotedStr(c1);
   ParamByName('EndMatNum').AsString := quotedStr(c2);
   ParamByName('BinLoc').AsString := quotedStr(cxTextEdit3.Text + '*');
   active := true;
end;
In this one, we catch the error : No parameter defined for 'MODEL';

but when we use the zQuery1, this code :

Code: Select all

with zQuery1, SQL do
begin
      Clear;
      active := false;
      text := format('call sp_BalanceReport(%s, %s, %s, %s, %s, %s)',
                     [ quotedStr(Mode), Manz.IIf(cxCheckBox1.Checked, Manz.D(cxDateEdit3.Date), Manz.D(cxDateEdit1.Date)) ,
                      Manz.D(cxDateEdit2.Date), quotedStr(cxLookupComboBox1.Text), quotedStr(cxLookupComboBox2.Text),
                      quotedStr(cxTextEdit3.Text + '*')]);
     active := true;  <-- Point Error
end;
In this query has an error shown :

Exception class EZSQLException with message 'SQL Error: PROCEDURE logistic.sp_BalanceReport can't return a result set in the given context'. Process Logistic.exe (2660)

When we test this sp on console, sqlmanager, even at navicat, the sp run correctly, no error, But, on Delphi ... error ..

Can someone help me for this kind of error ? :cry:

Version:
MySQL: 5.1.30-community
CodeGear™ Delphi® 2007 for Win32® R2 Version 11.0.2902.10471
ZeosLib 6.6.4-stable

Thanks
Man'z

Posted: 25.02.2009, 10:36
by mdaems
Hi Manz, The Stored Procedure component isn't implemented for mysql. So this will not work anyway.

If you'll look around the mysql section of the forum you'll probably find more comments on the stored procedure problem for mysql. Part of the problem is mysql can return multiple resultsets with different layouts from a stored proc. So we see no reasonable way to implement this in zeoslib. It MAY be possible to implment this using the dbc interfaces directly, but I've no experience doing that.

Mark