Page 1 of 1

Duplicated Params in SDAC

Posted: Fri 08 Apr 2005 07:56
by Lisichkin
Help to understand with a problem.
I use SDAC v.3.0 Delphi 6.0
The Simplified example:

TMSSQL1:

Code: Select all

BEGIN
  SET PARAM2:=PARAM1+1
END

Code: Select all

BEGIN
  MSSQL1.ParamByName('PARAM1').Value := 1;
  MSSQL1.Execute;
  ShowMessage(MSSQL1.ParamByName('PARAM2').Value); // Результат 2
END;
TMSSQL2:

Code: Select all

BEGIN
  SET PARAM1:=PARAM1+1
END

Code: Select all

BEGIN
  MSSQL2.ParamByName('PARAM1').Value := 1;
  MSSQL2.Execute;
  ShowMessage(MSSQL2.ParamByName('PARAM1').Value); // Результат 1
END;
In both cases PARAM1 and PARAM2 - int, IN/OUT.
The problem in the duplicated parameter.
How to overcome it???

Sorry

Posted: Fri 08 Apr 2005 08:00
by Lisichkin
Sorry, I was sealed up

TMSSQL1:

Code: Select all

BEGIN 
  SET :PARAM2 = :PARAM1+1 
END 
TMSSQL2:

Code: Select all

BEGIN 
  SET :PARAM1 = :PARAM1+1 
END 

Posted: Fri 08 Apr 2005 09:06
by Ikar
It is a common VCL behaviour - parameters with the same names get the same values.

Re: Ikar

Posted: Fri 08 Apr 2005 09:21
by Lisichkin
"It is a common VCL behaviour - parameters with the same names get the same values"

Is this the basic approach, or it will be changed in following versions (can even with v 3.5)?
When I used DOA components for connection to Oracle I could write freely PL/SQL code manipulating one parameter many times, and in the end I receiving result from it.

(Excuse me for my awful English)

Posted: Fri 08 Apr 2005 11:02
by Ikar
Once SDAC supported a separate setting of values for the same named parameters, but then by users' requests we approached behaviour to BDE.