[fpc-pascal] Re: How can retrive value from OUT parameter?
Reinier Olislagers
reinierolislagers at gmail.com
Fri Apr 19 11:53:23 CEST 2013
On 19-4-2013 9:26, Toru Takubo wrote:
> With analogical thinking, I expected that the following might work
> for TSQLQuery in FPC:
>
> var
> r,i: Integer;
> DBQ: TSQLQuery;
> begin
> ...
> DBQ.SQL.Text:='IncValue :@Param';
> DBQ.Params.CreateParam(ftInteger,'@RETURN_VALUE',ptResult);
> DBQ.Params.CreateParam(ftInteger,'@Param',ptInputOutput).AsInteger:=3;
> DBQ.ExecSQL;
ExecSQL executes SQL and does not return a value.
Try DBQ.Open to return values. No idea if the mssqlconn connector
supports output parameters in SPs though; best to just try.
> I read fpc db tutorials and googled, but I could not find the answer for
> this specific issue. Would anyone have an idea which of the following
> is the truth?
Documentation:
http://www.freepascal.org/docs-html/fcl/sqldb/index.html
More information about the fpc-pascal
mailing list