Hello,
i wrote a simple stored procedure to update a dataset. Now i want to execute the SP from my program but it doesn´t work. I found an advice like this "select StoredProcedureName(Insert1,Insert2)". That´s all i found to this topic. I tried this and nothing happens. What i must add to my code....TQuery.ExecSql and TQuery.open produce an error.
Here is my code:
procedure TForm1.Button4Click(Sender: TObject);
var nr:Integer;
begin
nr:=qrmain.FieldByName('ID').AsInteger;
dbmain.Close;
dbmain.Open;
if dbmain.Connected=true then
begin
dbmain.Connected:=false;
end;
qrmain.sql.text:='select SPTEST1(:ID,'''+edsp.text+''')';
qrmain.params.ParamByName('ID').AsInteger:=nr;
qrmain.Open;
trmain.Commit;
end;