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;