Accessing TOraParam as TParam returns different values.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
a-s-z
Posts: 106
Joined: Wed 03 Dec 2008 06:01

Accessing TOraParam as TParam returns different values.

Post by a-s-z » Wed 28 Oct 2009 07:46

Hi,

I have a problem using parameters in TOraQuery. When accessing the parameters as TParam, the value is not the same, i.e. accessing TParam(AParam).Value will return an other value than TOraParam(AParam).Value or TDAParam(AParam).Value!

I am using reflection in a custom component to get the parameter from a TDataSet reference.
How can I solve the problem without needing direct reference to Odac?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 28 Oct 2009 09:17

You can use the following code to call TOraParam.Value:

Code: Select all

GetVariantProp(Param, 'Value')

a-s-z
Posts: 106
Joined: Wed 03 Dec 2008 06:01

Post by a-s-z » Wed 28 Oct 2009 12:04

Thanks,

I have wrapped this functionality in a little class helper. Instead of calling Clear, I am assigning Null to Value. Is this correct, or do I have to call Clear?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 29 Oct 2009 08:15

Assinging Null to Value is the same as calling Clear.

Post Reply