Hi everyone,
I'm creating a small application to manage an MySQL/MariaDB database and I'm struggling to call a stored procedure using TMySQL55Connection and TSQLQuery.
The procedure takes two parameters one: is INPUT (integer) the other is OUTPUT (integer)
The code is simple / should be like this:
Procedure TForm1.ButtonConnectClick(Sender: TObject);
var num_users: integer;
begin
//...
MySQL55Connection1.Connected := true;
MySQL55Connection1.Open;
//
SQLQuery1.Close;
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Text := 'call `count_users_per_client`(:CLIENTID, :NUMUSERS)';
SQLQuery1.Params.CreateParam(ftInteger, 'CLIENTID', ptInput);
SQLQuery1.Params.CreateParam(ftInteger, 'NUMUSERS', ptOutput);
SQLQuery1.ParamByName('CLIENTID').AsInteger := 11;
SQLQuery1.ExecSQL;
num_users := SQLQuery1.ParamByName('NUMUSERS').AsInteger;
ShowMessage('USERS# = ' + IntToStr(num_users));
end;
Should this be working?
Is there any demo / documentation for this?
I also notice that , if I add the parameters for the SQLQuery1 in the interface via Properties, they are not shown in the Components tree view (as child node).
Thank you!
Regards,
Radu G.
PS I know I can do it with ZeosLib but with ZeosLib I have other problems ;-(