SDAC 8.2.8 - stored procedure output parameter

SDAC 8.2.8 - stored procedure output parameter

I am using SDAC 8.2.8 with D 10.2 and have strange problem that I think might have already solved, however it is all strange, maybe someone will be able to explain what is going on.
I have stored procedure in MS SQL Server:

CREATE PROCEDURE [dbo].[AAAA]
-- Add the parameters for the stored procedure here
@p1 numeric(18,0),
@p2 numeric(18,0),
@p3 numeric(18,0) output

I used MSStoredProc1 : TMSStoredProc to run it like this:

MSStoredProc1.ParamByName(p1').Value := 1;
MSStoredProc1.ParamByName('p2').Value := 3000001;
MSStoredProc1.ExecProc;
id_dh := MSStoredProc1.ParamByName('p3').Value; 

In this case id_dh always was zero, whatever the procedure really returned as p3. I used DBMonitor and SQL Profiler and result was:
DBMonitor:
- query was in "pending" status after MSStoredProc1.ExecProc was called and executed and was getting "complete" status after few next commands were executed in delphi, then I could see proper result (p3) in DBMonitor

SQL Profiler:
- shown proper value returned as p3

So it seemed that procedure returned expected result (<> 0) that was lost somewhere between MS SQL Server and Delphi App.

After many more or less random changes I made in my application I found that adding MSStoredProc1.Close after procedure execution seems to solve the problem. Program below seems to work (id_dh has proper value):

MSStoredProc1.ParamByName(p1').Value := 1;
MSStoredProc1.ParamByName('p2').Value := 3000001;
MSStoredProc1.ExecProc;
MSStoredProc1.Close;
id_dh := MSStoredProc1.ParamByName('p3').Value; 

I am almost 100% sure that I have done similar things with SDAC and ODAC in the past and never had to call Close to get output params values.

Does anyone have clue what is going on?