About TMyStoredProcedure ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bumblebee
Posts: 6
Joined: Thu 29 Sep 2005 11:36

About TMyStoredProcedure ?

Post by bumblebee » Thu 29 Sep 2005 12:09

Hi...

MyDac version is 3.55.0.22

my stored procedure is ;

CREATE PROCEDURE `xproc`(in param1 Int, in param2 Int, inout param3 Int)
begin

set @a1 = 10*param1;
set @a2 = 11*param2;
set @a3 = 12*param3;

end;

i m execute TMystoredprocedure in delphi and throw exception :

out or inout argument 3 for routine muhasebe.xproc is not a variable...

what s this?

how to use TMyStoredProcedure ?... your docs is not enough...

thanks for....

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 30 Sep 2005 09:51

MySQL does not return parameters to client. Try to declare server variable and place param value to it. Then use SELECT to get its value.

bumblebee
Posts: 6
Joined: Thu 29 Sep 2005 11:36

procedures?

Post by bumblebee » Mon 03 Oct 2005 10:57

Hi Ikar;

can you give examples? :evil:

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 06 Oct 2005 08:22

Code: Select all

CREATE PROCEDURE `xproc`(in param1 Int, in param2 Int, inout param3 Int) 
begin 
  set @a1 = 10*param1; 
  set @a2 = 11*param2; 
  set @a3 = 12*param3; 
  set param3 = @a3;
end
MyDAC 3.55:

Code: Select all

    MyQuery.SQL.Text := 'SET @p3 = 5';
    MyQuery.Execute;
    MyQuery.SQL.Text := 'CALL xproc(:param1, :param2, @p3)';
    MyQuery.Execute;
    MyQuery.SQL.Text := 'SELECT @p3';
    MyQuery.Execute;
MyDAC 4.0:

Code: Select all

    MyQuery.SQL.Text := 'SET @p3 = 5; CALL xproc(:param1, :param2, @p3); SELECT @p3';
    MyQuery.Execute;

ajasja
Posts: 7
Joined: Sun 29 Oct 2006 09:46

Feature request

Post by ajasja » Wed 17 Jan 2007 10:34

Hello!

Could you make TmyStoredProc generate the extra select SQL statements implicitly and then move the result into the parameters? Maybe you only have to modify the stored procedure generator?

So that myDac users could handle the OUT and INOUT parameters transparently. (We wouldn't/shouldn't even know that MySQL doesn’t return parameters)

Best regards,
Ajasja Ljubetič

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 17 Jan 2007 11:06

Support for output parameters has been added to the new version of MyDAC. Beta versions of MyDAC 5 for Delphi 7 and Delphi 2006 are now available for download from here

ajasja
Posts: 7
Joined: Sun 29 Oct 2006 09:46

Post by ajasja » Wed 17 Jan 2007 13:24

Great, thanks.

Post Reply