Magic parameter's name "eventyear"
Posted: Wed 24 Aug 2016 13:59
I use UniDAC 6.3.13 with RAD Studio XE7 and MSSQL 2005 database.
There is a stored procedure:
Then the "@eventyear" parameter "name" is case sensitive, but other parameters are not, why?
Delphi test code:
There is a stored procedure:
Code: Select all
CREATE PROCEDURE dbo.SPC_TES01
(
@id INT,
@id2 INT,
@eventyear INT = NULL
)
AS
BEGIN
SET NOCOUNT ON
IF @eventyear <= 0
BEGIN
SET @eventyear = NULL
END
SELECT @id AS id,
@id2 AS id2,
@eventyear AS eventyear,
'alma' AS name
END;
Delphi test code:
Code: Select all
begin
if unstrdprc1.Params.FindParam('ID')<>nil then
unstrdprc1.ParamByName('ID').AsInteger:=1;
if unstrdprc1.Params.FindParam('Id2')<>nil then
unstrdprc1.ParamByName('iD2').AsInteger:=2;
if unstrdprc1.Params.FindParam('eventyear')<>nil then
unstrdprc1.ParamByName('eventyear').AsInteger:=4;
if unstrdprc1.Params.FindParam('EventYear')<>nil then
unstrdprc1.ParamByName('EventYear').AsInteger:=3;
unstrdprc1.Open;
end;