- This topic has 0 replies, 1 voice, and was last updated 5 years, 1 month ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- You must be logged in to reply to this topic.
Tagged: FireDAC, INOut Params
Hoi there seesm to be a problem when tryo to get back values for INOut and Out Params. Checking the sources it seems the method: kbmMWFireDACCopyInputParamsValueAndType check for already existing paramsin the FireDAC query and stored procedure, but if they doesnt exists, so there is no value assigned or param created, so there will be InOut and Out params to assign value after the Query or Procedure is executed, the issue is specially wioth the InOut params because the INPut value will never be assigned before calling the Srtored procedure /query.
Chgecking the sources the ‘q.Prepare;’ is called after the kbmMWFireDACCopyInputParamsValueAndType, so is has to be called before. so the source perfomexecute and performquery of the TkbmMWCustomFireDACStoredProc should look liek this:
try
sp.Connection:=c.Database;
sp.StoredProcName:=CookedStoredProcName;
sp.Prepare;
if Assigned(FOnSetupSQLObject) then
FOnSetupSQLObject(self,sp,mwqotQuery);
kbmMWFireDACCopyInputParamsValueAndType(Params,sp.Para ms,Connection.ConnectionPool.CurrentMetaData.UnicodeOptions) ;
FIsCursor := sp.OpenOrExecute;
// After the stored procedure is open, also remember to get the resulting params from it.
Params.Assign(sp.Params); //commented by fduenas
Result:=sp;
except
sp.Free;
raise;
end;