@PARAMETER issue

Hi guys,

Latest SQL Server 2019. Latest ODBC Driver.

FireDacDriver on DA.

Stored procedure added under tables schema section.

It contains one parameter called ‘@Something’.

FireDac fails saying

“TryGetSomething: Exception EROUnregisteredServerException in module Test.exe at 00000000015C4125.
[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function ‘SomethingGetOne’ expects parameter ‘@Something’, which was not supplied.”

The parameter was specified on the TDAMemTable as “Something”.

It seems it is not including the ‘@’ when sending it to the db.

Hi,

can you send DDL of this procedure and simple testcase that reproduces this issue to support@, pls?


EDIT: try to change statement type to SQL and use statement like

EXEC sp_name :param1

fixed as #84812

Hi,

If there was a bug could you please include the updated code. It is kind of a big regression for every single stored procedure I use.

Thank you.

Hi,

pls update uDASchema.pas as

function TDASchema.DoNewDataset(const aRec: PDASchemaExchange;
  aStatementName: string; OpenIt: boolean; aConnectionType:String): IDADataset;
var
  s: string;  //added
  i:Integer;  //added
..
        aRec^.lFields := ds.Fields;
// begin changes
        case aRec^.lstatement.StatementType of
          stAutoSQL: begin
            if aRec^.lstatement.TargetTable = '' then begin
              if aRec^.lstatement.Name = '' then
                lstatname:= '['+aRec^.lstatement.ConnectionType+']'
              else
                lstatname:= aRec^.lstatement.Name;
              DAError(True,err_StatementSTargetTableMustBeSpecified,[aRec^.lName,lstatname])
            end;
            sql := GenerateSelectSQL(aRec);
          end;
          stStoredProcedure: begin
            sql :=  aRec^.lConnection.GetSPSelectSyntax(ds.Params.Count > 0);
            sql := StringReplace(sql,'{0}', aRec^.lstatement.SQL, [rfReplaceAll]);
            s:= '';
            for I := 0 to ds.Params.Count-1 do begin
              if s <> '' then s := s+', ';
              s := s + ':'+ds.Params[i].Name;
            end;
            sql := StringReplace(sql,'{1}', s, [rfReplaceAll]);
          end;
        end;
// end changes
        if Assigned(fOnGetSQL) then fOnGetSQL(Self, aRec^.lName, setDataset, sql);

after changes, you may launch install_DA.cmd from C:\Program Files (x86)\RemObjects Software\Build for recompiling IDE packages