Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: MapRules variable length data parameter overflow


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Oct 6, 2014 7:10 AM Last Post By: Paulo Mariano
Paulo Mariano

Posts: 29
Registered: 11/25/12
MapRules variable length data parameter overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 9, 2014 11:36 AM
Hello.

In a Delphi XE6 application, which accesses an Informix database, when statement
mvareQuery.EnableControls;

is executed, the following exception is raised:
Project app.exe raised exception class EFDException with message '[FireDAC][Stan]-704.
Variable length data parameter [mvare_timestamp] overflow.
Value length - [19], parameter data maximum length - [8]'.

These are the map rules associated with the query:
with MapRules.Add do begin
   SourceDataType := dtDateTimeStamp;
   TargetDataType := dtDateTime;
   SizeMax := 20;
 end;


Could you please provide some assistance to solve the problem?
Thank you in advance.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: MapRules variable length data parameter overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2014 12:48 AM   in response to: Paulo Mariano in response to: Paulo Mariano
Project app.exe raised exception class EFDException with message '[FireDAC][Stan]-704.
Variable length data parameter [mvare_timestamp] overflow.
Value length - [19], parameter data maximum length - [8]'.

This exception is raised, when you are trying to assign a text string value to
a parameter with one of the data types: ftWideString, ftFmtMemo, ftString,
ftFixedChar, ftMemo, ftOraClob, ftADT, ftBytes, ftVarBytes, ftBlob, ftOraBlob,
ftWideMemo, ftFixedWideChar, ftDBaseOle. And the parameter has Size > 0
and the assigning value is more long than Size. So, check how the
"mvare_timestamp" parameter is defined, and what your app is assigning to it.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: MapRules variable length data parameter overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2014 9:18 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Hello, Dmitry.

Thank you for your reply.

In Informix, the column that raises the exception (mvare_timestamp) is defined as DATETIME YEAR TO SECOND.
In the dfm file, object MvareQuerymvare_timestamp is defined this way:
object MvareQuerymvare_timestamp: TDateTimeField
  DisplayLabel = 'Open Time'
  DisplayWidth = 25
  FieldName = 'mvare_timestamp'
  ReadOnly = True
end


You have mentioned that the error happens when "you try to assign a text string value to a parameter with one of the following data types: ...".
None of the data types you mentioned matches the data type of the field (TDateTimeField).
Is there something I am missing?

Thank you.
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: MapRules variable length data parameter overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2014 1:08 PM   in response to: Paulo Mariano in response to: Paulo Mariano
Paulo Mariano wrote:

Hello, Dmitry.

Thank you for your reply.

In Informix, the column that raises the exception (mvare_timestamp)
is defined as DATETIME YEAR TO SECOND. In the dfm file, object
MvareQuerymvare_timestamp is defined this way:
object MvareQuerymvare_timestamp: TDateTimeField
  DisplayLabel = 'Open Time'
  DisplayWidth = 25
  FieldName = 'mvare_timestamp'
  ReadOnly = True
end

The correct data type would be:

 object MvareQuerymvare_timestamp: TSQLTimeStampField
   DisplayLabel = 'Open Time'
   DisplayWidth = 25
   FieldName = 'mvare_timestamp'
   ReadOnly = True
 end
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: MapRules variable length data parameter overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 6, 2014 7:10 AM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Hello, Lajos.

Thank you for your reply.
The problem has been solved.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02