I've read the older topic on this issue ( viewtopic.php?f=24&t=33341&hilit=default+parameter ), but it seems something has changed.
I have this routine:
Code: Select all
CREATE OR ALTER PROCEDURE DEFAULT_TEST (
I1 Integer,
I2 Integer,
I3 Integer DEFAULT 4)
returns (
O1 Integer,
O2 Integer,
O3 Integer)
AS
begin
o1 = i1 + i2 + i3;
o2 = i1 + i2;
o3 = i3;
end
Code:
Code: Select all
var n: Integer;
begin
IBCStoredProc1.Params.Delete(2);
IBCStoredProc1.ExecProc;
for n := 0 to Pred(IBCStoredProc1.ParamCount)
do if IBCStoredProc1.Params[n].ParamType in [ptOutput]
then Memo1.Lines.Add(Format('%s - %s', [IBCStoredProc1.Params[n].DisplayName,
IfThen(IBCStoredProc1.Params[n].IsNull, 'NULL', IBCStoredProc1.Params[n].AsString)]));
The exact same code works fine in version 5.7.32 (Delphi 2009).Dynamic SQL ErrorSQL error code = -804SQLDA error.
Heck, this - in my opinion far more elegant solution - works to:
Code: Select all
IBCStoredProc1.Params[2].Bound := False;
What has changed, what should be used?
With regards,
Martijn Tonies