Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Informix exception class EConvertError: not a valid timestamp


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


Permlink Replies: 3 - Last Post: Oct 17, 2014 7:56 AM Last Post By: Paulo Mariano
Paulo Mariano

Posts: 29
Registered: 11/25/12
Informix exception class EConvertError: not a valid timestamp  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 14, 2014 3:50 PM
Hello.

In an application built with Delphi XE6, which accesses an Informix database, the following statements are executed to update a row:
with DataSet as tClientDataSet do
begin
  if State = dsEdit then
    Post;
  if (ChangeCount > 0) then
    try
      FDManager.Connections[0].StartTransaction;
      ApplyUpdates(-1);
      FDManager.Connections[0].Commit;
    except
      on Exception do
      begin
        FDManager.Connections[0].Rollback;
      end;
    end;
end;


When method ApplyUpdates is called, the following exception is raised:
Project app.exe raised exception class EConvertError with message ''693594.-497258496' is not a valid timestamp'.

The following map rules are used:
with MapRules.Add do begin
  SourceDataType :=dtDateTimeStamp;
  TargetDataType := dtDateTime;
  SizeMax := 25;
end;


All date/time columns (from the database table) have their corresponding objects created as TDateTimeField. For example:
object cdsCashierApptsstartdatetime: TDateTimeField
  DisplayLabel = 'Start'
  FieldName = 'startdatetime'
end


Thank you in advance for any helpful information.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Informix exception class EConvertError: not a valid timestamp  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2014 12:00 AM   in response to: Paulo Mariano in response to: Paulo Mariano
When method ApplyUpdates is called, the following exception is raised:
Project app.exe raised exception class EConvertError with message ''693594.-497258496' is not a valid timestamp'.

Please provide the call stack for the exception.

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

Posts: 29
Registered: 11/25/12
Re: Informix exception class EConvertError: not a valid timestamp  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2014 11:35 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Hello, Dmitry.

Thank you for your prompt reply.
Here is the call stack:

:7539c42d KERNELBASE.RaiseException + 0x58
:00429012 ConvertErrorFmt + $1E
:006d5b92 TDataSet.DataConvert + $10E
:00f96095 TCustomClientDataSet.DataConvert + $D5
:006d51c5 TDataSet.GetFieldData + $11D
:006c290f TField.GetData + $A7
:006c89fd TDateTimeField.GetValue + $3D
:006c88be TDateTimeField.GetAsVariant + $12
:00f958ae CheckNotChanged + $AE
:00f95995 TCustomClientDataSet.GetStateFieldValue + $C1
:00fa7813 TPacketDataSet.GetStateFieldValue + $4F
:006c2d6a TField.GetNewValue + $16
:00952fac TFDDataSet.PSUpdateRecord + $CC
:00facf6f TSQLResolver.InternalDoUpdate + $4B
:00fad0cf TSQLResolver.DoInsert + $B
:00fab0f6 TUpdateTree.DoUpdates + $42
:00fa89d9 TBaseProvider.InternalApplyUpdates + $61
:00fa9be8 TDataSetProvider.InternalApplyUpdates + $E4
:00fa8243 TCustomProvider.DoApplyUpdates + $9B
:00fa81a1 TCustomProvider.ApplyUpdates + $25
:00faf6d9 TLocalAppServer.AS_ApplyUpdates + $51
:00f9a5e5 TCustomClientDataSet.DoApplyUpdates + $8D
:00f92faf TCustomClientDataSet.ApplyUpdates + $73
dmReports.TdmReportBuilder.cdsCashierTickleBeforeClose($55C74F0)
:006d8857 TDataSet.DoBeforeClose + $1B
:006d3fc7 TDataSet.Close + $F
FmAcctMgmt.TfrmAcctMgmt.ActionViewDailyApptsExecute($851FA90)
FmAcctMgmt.TfrmAcctMgmt.PlannerMonthView1DblClick($851FA90,41936)
PlannerMonthView.TPlannerMonthView.WMLButtonDblClk((515, (), 1, (), 925, 159, (), (925, 159), (), 0))
:00566b60 TControl.WndProc + $2C0
:0056b6a6 TWinControl.WndProc + $5CE
PlannerMonthView.TPlannerMonthView.WndProc((515, 1, 10421149, 0, 1, 0, (), 925, 159, (), 0, 0, ()))
:0056aceb TWinControl.MainWndProc + $2F
:004e2bae StdWndProc + $16
:759c62fa ; C:\Windows\syswow64\USER32.dll
:759c6d3a USER32.GetThreadDesktop + 0xd7
:759d0d27 USER32.GetClientRect + 0xc5
:759d0d4d USER32.CallWindowProcW + 0x1b
:745af443 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:745af5ee comctl32.DefSubclassProc + 0x92
:745af5a2 comctl32.DefSubclassProc + 0x46
:745ab64b ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:745af5ee comctl32.DefSubclassProc + 0x92
:745af490 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
:759c62fa ; C:\Windows\syswow64\USER32.dll
:759c6d3a USER32.GetThreadDesktop + 0xd7
:759c77c4 ; C:\Windows\syswow64\USER32.dll
:759c788a USER32.DispatchMessageW + 0xf
Paulo Mariano

Posts: 29
Registered: 11/25/12
Re: Informix exception class EConvertError: not a valid timestamp  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2014 7:56 AM   in response to: Paulo Mariano in response to: Paulo Mariano
Hello, Dmitry.

The problem has been solved by implementing the following changes:

1) Addition of a new map rule:
with MapRules.Add do begin
  SourceDataType :=dtTime;
  TargetDataType := dtDateTime;
end;


2) Removal of the prefix "Informix" before the table name (from the update statement).

3) Property CachedUpdates of the query set to False.

Thank you.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02