Componentes.Terceros.RemObj.../official/5.0.35.741/Data Abstract for Delphi/Source/Drivers/uDACRLabsUtils.inc
2009-02-27 15:16:56 +00:00

61 lines
2.0 KiB
PHP

{
!!! DO NOT REMOVE THIS FILE !!!
It's included with an $I directive in the SDAC and ODAC driver units and it's used in
their implementation of the IDAMustSetParams
}
procedure WriteCrLabsParamValues(InputParams : TDAParamCollection; OutputParams: TDAParams; IgnoreBlobType : boolean = false);
var i : integer;
par : uDAInterfaces.TDAParam;
outpar : DBAccess.TDAParam;
blobtype : TFieldType;
begin
for i := 0 to (InputParams.Count-1) do begin
par := InputParams[i];
outpar := OutputParams.ParamByName(par.Name);
// If no blob type is specified, then gets the default field type.
// BlobType is only meaningful to Oracle. MSSQL works fine just setting the DataType
blobtype := BlobTypeMappings[par.BlobType];
if (blobtype=ftUnknown)
then blobtype := DADataTypesMappings[par.DataType];
case par.DataType of
datBlob : begin
outpar.ParamType := TParamType(par.ParamType);
outpar.DataType := DADataTypesMappings[par.DataType];
if VarIsNull(par.Value) then
outpar.Clear
else begin
if VarIsArray(par.Value) then
outpar.Value := VariantBinaryToString(par.Value)
else
outpar.Value := par.Value;
end;
end;
datMemo : begin
outpar.ParamType := TParamType(par.ParamType);
outpar.DataType := ftMemo;
// Only happens with Oracle
if not IgnoreBlobType and (blobtype<>ftUnknown) then
outpar.DataType := blobtype;
if VarIsNull(par.Value) then
outpar.Clear
else
outpar.Value := par.Value;
end;
else begin
outpar.ParamType := TParamType(par.ParamType);
outpar.DataType := DADataTypesMappings[par.DataType];
if VarIsNull(par.Value)
then outpar.Clear
else outpar.Value := par.Value;
end;
end; { case }
end; { for }
end;