3.4.5 for Delphi 6 - Byte Parameters error

I'm migrating our application to Delphi 6 and DOA 3.4.5 (running w Oracle 8.1.7). At runtime, I get this message on execute of at least two CallProcedure()'s in our code:

"Byte parameters can only be used for output parameter types"

This code used to work under Delphi 5 and DOA 3.4.3. Any ideas on workarounds or fixes?
 
I've found the source of the problem on my end. The call to CallProcedure() includes a parameter -- a variant -- that must be resolving to a byte. The call looks like this (look at the last parameter for the problem):

OraclePackage.CallProcedure('city_change',
['srowid_in', EditRowId,
'rgn_id_in', Globals.WorkingRegionId,
'name_in', Trim(edtName.Text),
'crew_change_city_flag_in',
IIF(chkCrewChange.Checked, 1, 0)]);

The last parameter calls IIF(), which is defined as:

function IIF(const ATest: Boolean; const TrueValue, FalseValue: Variant): Variant;
begin
if ATest then
Result := TrueValue
else
Result := FalseValue;
end;

This returns a variant that apparently is treated as a byte by CallProcedure(). The workaround on our end is to typecast IIF calls with Integer(). This is a pain since I have to make changes all over. Alternatively, I could define a bunch of overloaded IIF() functions to specifically handle integers separately.

DOA 3.4.5 shouldn't have this problem. Thus, I still count this as a DOA bug.
 
Back
Top