Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDAC fixed length column mismatch



Permlink Replies: 7 - Last Post: Jun 15, 2016 6:29 AM Last Post By: Eric Grajales
Eric Grajales

Posts: 9
Registered: 5/15/99
FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2016 2:40 PM
Hi,

I'm able to access other tables in the DB, however, when I
try to access the table "DGROUPS"

FireDAC raises an exception :
...Class EFDException with message '[FireDAC][DatS]-10. Fixed length
column [Description]
data length mismatch. Value length -[9], column fixed length [4]'.

I've tried
1. Deleting and re-creating the TFDConnection
2. Deleting and re-creating the TFDQuery
3. Setting StrsTrim value to False

I also get the error in the FireDAC Query Editor in the IDE.
What is interesting is that in the FireDAC Query Editor, when I look
at the structure, for "DESCRIPTION", it states the datatype
is UInt32 and the source datatype is WideString(64).

The table in the database I'm accessing is:
CREATE TABLE "DGROUPS"
(
"USERUID" BIGINT NOT NULL,
"DESCRIPTION" VARCHAR(64) NOT NULL COLLATE UNICODE_CI,
"DGRPUID" BIGINT NOT NULL,
);

Here is the connection info:
================================
Connection definition parameters
================================
Database=d:\temp\Database.fdb
User_Name=USER
Password=*****
CharacterSet=UTF8
ExtendedMetadata=True
DriverID=FB
================================
FireDAC info
================================
Tool = RAD Studio XE8
FireDAC = 12.0.1 (Build 78853)
Platform = Windows 32 bit
Defines = FireDAC_NOLOCALE_META;FireDAC_MONITOR
================================
Client info
================================
Loading driver FB ...
Brand = Firebird
Client version = 205049900
Client DLL name = C:\Windows\system32\fbclient.dll
================================
Session info
================================
Current catalog =
Current schema =
Server version = WI-V2.5.4.26856 Firebird 2.5
WI-V2.5.4.26856 Firebird 2.5/XNet (DEV9000)/P12
WI-V2.5.4.26856 Firebird 2.5/XNet (DEV9000)/P12

Suggestions???

Eric

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2016 12:22 AM   in response to: Eric Grajales in response to: Eric Grajales
This looks like you have setup some data type mapping. Try the following:
* remove ExtendedMetadata=True parameter from your connection parameters;
* verify that FormatOptions.MapRules is empty for TFDManager, TFDConnection and TFDQuery.

--
With best regards,
Dmitry
Eric Grajales

Posts: 9
Registered: 5/15/99
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2016 6:44 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:

This looks like you have setup some data type mapping. Try the
following: * remove ExtendedMetadata=True parameter from your
connection parameters; * verify that FormatOptions.MapRules is empty
for TFDManager, TFDConnection and TFDQuery.

I've removed ExtendedMetadata=True parameter, and check that the
FormatOptions.MapRules where empty in TFDConnection and TFDQuery, still
getting the same error.

Eric

Eric Grajales

Posts: 9
Registered: 5/15/99
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2016 6:55 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:

This looks like you have setup some data type mapping. Try the
following: * remove ExtendedMetadata=True parameter from your
connection parameters; * verify that FormatOptions.MapRules is empty
for TFDManager, TFDConnection and TFDQuery.

I also just added a TFDTable accessing the same DB table, opened it
with no problems.

Any other options I should check?

Thanks,
Eric
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2016 9:32 AM   in response to: Eric Grajales in response to: Eric Grajales
I also just added a TFDTable accessing the same DB table, opened it
with no problems.

This confirms, that you have some data type mapping setup.
But you said, no mappings defined. Strange ...

Could you please prepare a test project + test DB to reproduce
the issue and upload it to attachments forum ? Then I will check it.

--
With best regards,
Dmitry
Eric Grajales

Posts: 9
Registered: 5/15/99
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 14, 2016 6:35 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:

This looks like you have setup some data type mapping. Try the
following: * remove ExtendedMetadata=True parameter from your
connection parameters; * verify that FormatOptions.MapRules is empty
for TFDManager, TFDConnection and TFDQuery.

I posted an example in the attachments forums.

You can email me at egrajales at comcast dot com.

Thanks,
Eric
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 14, 2016 8:20 AM   in response to: Eric Grajales in response to: Eric Grajales
Thank you. Found the issue. Your test project has:
  object FDQMySimDiaryGroups: TFDQuery
    ........
    UpdateOptions.AutoIncFields = 'USERUID;DESCRIPTION'

This forces "description" field to become of UInt32 data type. Kind of a
hole / bug in FireDAC. The solution is to remove "description" from
AutoIncFields. We will fix that.

Additionally, there is no need:
1) To put ';' at end of your query.
2) To set UpdateTableName to "SIM_DIARYGROUPS", because FireDAC
will figure out that automatically.
3) To set KeyFields to 'USERUID;DESCRIPTION'. When fiItems is included
into FetchOptions.Items, then FireDAC will automatically get primary key
fields.

--
With best regards,
Dmitry
Eric Grajales

Posts: 9
Registered: 5/15/99
Re: FireDAC fixed length column mismatch
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2016 6:29 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry,

That fixed the issue.

Appreciate all your help and efforts.

Thanks,
Eric
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02