# Incorrect dataparameter type in the update and insert calls

**URL:** https://talk.remobjects.com/t/incorrect-dataparameter-type-in-the-update-and-insert-calls/31228
**Category:** Data Abstract
**Tags:** delphi
**Created:** [December 19, 2024, 2:56pm UTC](https://talk.remobjects.com/t/incorrect-dataparameter-type-in-the-update-and-insert-calls/31228 "2024-12-19T14:56:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![is2software](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/b5ac83/32.png) [@is2software](https://talk.remobjects.com/u/is2software)
#### Post date: [December 19, 2024, 2:56pm UTC](https://talk.remobjects.com/t/incorrect-dataparameter-type-in-the-update-and-insert-calls/31228/1 "2024-12-19T14:56:14Z")

</div>

We are having some errors on updates and inserts where the parameter datatype is incorrect.

Where or what function is called in DataAbstract to assign the datatype, etc for the data parameters for the sql statement?

The specific data items are all strings but seem to be coming back as numeric. Does the function look at the schema itself or the actual database fields? Or the datatable field descriptions?

We are using the FireDAC driver. But this is a very similar problem that we encountered with our own Liodden driver that we were building. Possibly the answer here may direct us to where we can modify our Linden driver.

Thanks.  
Bill Brittain

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [December 19, 2024, 3:29pm UTC](https://talk.remobjects.com/t/incorrect-dataparameter-type-in-the-update-and-insert-calls/31228/2 "2024-12-19T15:29:16Z")

</div>

Hi,

You can fix parameter type in Schema Modeler:

[![](https://docs.dataabstract.com/Tools/SchemaModeler/Windows/SchemaModelerEditingAField.PNG) ](https://docs.dataabstract.com/Tools/SchemaModeler/Windows/SchemaModelerEditingAField.PNG)

* * *

> [@is2software](#):
>
> Possibly the answer here may direct us to where we can modify our Linden driver.

try to override `intVCLTypeToDAType`.

we do this for ODAC driver:

```auto
function TDAEODACQuery.intVCLTypeToDAType(aFieldType: TFieldType; ASize: Integer = 0; ADecimalPrecision: Integer = 0; aDecimalScale: Integer = 0): TDADataType;
begin
  if Ord(aFieldType) in [{$IF (DACVersion >= '8.2.7') or (DACVersion >= '10.0.0')}ftOraTimeStampTZ, ftOraTimeStampLTZ{$ELSE}ftTimeStampTZ, ftTimeStampLTZ{$IFEND}] then
    aFieldType := ftTimeStamp;
  if Ord(aFieldType) in [ftBFile] then aFieldType := ftBlob;
  if Ord(aFieldType) = ftXML then aFieldType := {$IFNDEF DA_WideMemoSupport}ftBlob{$ELSE}ftWideMemo{$ENDIF DA_WideMemoSupport};
  if Ord(aFieldType) in [ftNumber] then begin
    if (TSmartQuery(Dataset).Session.Options.EnableIntegers) and (aDecimalScale = 0) and (ADecimalPrecision < IntegerPrecision) then aFieldType := ftInteger
    else if (TSmartQuery(Dataset).Session.Options.EnableIntegers) and (aDecimalScale = 0) and (ADecimalPrecision < LargeIntPrecision) then aFieldType := ftLargeint
    else if (TSmartQuery(Dataset).Session.Options.EnableNumbers) and (ADecimalPrecision > FloatPrecision) then aFieldType := ftFMTBcd
    else aFieldType := ftFloat;
  end;
  Result := inherited intVCLTypeToDAType(aFieldType, ASize, ADecimalPrecision, aDecimalScale);
end;

```

---

<div class="post-metadata">

### Author: ![is2software](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/b5ac83/32.png) [@is2software](https://talk.remobjects.com/u/is2software)
#### Post date: [December 19, 2024, 3:48pm UTC](https://talk.remobjects.com/t/incorrect-dataparameter-type-in-the-update-and-insert-calls/31228/3 "2024-12-19T15:48:33Z")

</div>

Thanks. Will try.

Schema setup is correct so it must be somewhere the driver or DA is picking up the field datatype somewhere.
