TmyStoredProc output parameters
Posted: Fri 28 Mar 2014 16:15
Hi;
I am calling a stored procedure from my delphi code as below:-
My procedure is being executed, the data is being committed to the DB, when I execute the code manually from the mySQL command line it executes and returns all 4 of my parameters, however in my Delphi code (below) the results are unassigned. When I step through the parameters I see the named parameters, but not their values?
Any ideas?
Delphi 2010 mydac ver 7.5.10
<snip>
with spLogon do
begin
ParamByName('in_Email').AsString := Trim(input.eMail);
ParamByName('in_Password').AsString := Trim(input.password);
ParamByName('in_IPaddress').AsString := Trim(input.ipAddress);
ParamByName('in_Browser').AsString := Trim(input.browser);
Execute;
// result.status := ParamByName('o_ClientStatus').AsString;
// result.userID := ParamByName('o_ClientUser').AsInteger;
// result.token := ParamByName('o_ClientToken').AsString;
result.clientID := ParamByName('Result').Value;
if assigned(spLogon.Params) then
begin
for Idx := 0 to spLogon.Params.Count - 1 do
begin
if (spLogon.Params[Idx].ParamType = ptOutput) then
spLogon.Params[Idx].Value := spLogon.ParamByName(spLogon.Params[Idx].Name).Value;
end;
end;
end;
</snip>
I am calling a stored procedure from my delphi code as below:-
My procedure is being executed, the data is being committed to the DB, when I execute the code manually from the mySQL command line it executes and returns all 4 of my parameters, however in my Delphi code (below) the results are unassigned. When I step through the parameters I see the named parameters, but not their values?
Any ideas?
Delphi 2010 mydac ver 7.5.10
<snip>
with spLogon do
begin
ParamByName('in_Email').AsString := Trim(input.eMail);
ParamByName('in_Password').AsString := Trim(input.password);
ParamByName('in_IPaddress').AsString := Trim(input.ipAddress);
ParamByName('in_Browser').AsString := Trim(input.browser);
Execute;
// result.status := ParamByName('o_ClientStatus').AsString;
// result.userID := ParamByName('o_ClientUser').AsInteger;
// result.token := ParamByName('o_ClientToken').AsString;
result.clientID := ParamByName('Result').Value;
if assigned(spLogon.Params) then
begin
for Idx := 0 to spLogon.Params.Count - 1 do
begin
if (spLogon.Params[Idx].ParamType = ptOutput) then
spLogon.Params[Idx].Value := spLogon.ParamByName(spLogon.Params[Idx].Name).Value;
end;
end;
end;
</snip>