#1 2015-05-16 01:06:24

Celso
Member
Registered: 2013-05-14
Posts: 55

TSQLTable.FieldTypeIntegerDetectionOnAllRows

The introduction of TSQLTable.FieldTypeIntegerDetectionOnAllRows function generated a problem in JSONToClientDataSet command. I already have clientdataset created and this has a Timestamp field. When the JSONToClientDataSet command and executed generates an error with the message "not parse string to timestamp".

Would you help me?

Offline

#2 2015-05-16 10:51:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: TSQLTable.FieldTypeIntegerDetectionOnAllRows

What is the JSON content?
Is the timestamp column containing only timestamp integer values?
Is not datetime best fitted for this column?

Offline

#3 2015-05-16 13:13:52

Celso
Member
Registered: 2013-05-14
Posts: 55

Re: TSQLTable.FieldTypeIntegerDetectionOnAllRows

This is the JSON content:

'{"fieldCount":13,"values":["ID","IDUSER","USER_CODEXT","NAME","IDGROUP","EMAIL","INC_DATE","MOD_DATE","INC_USER","MOD_USER","INC_NAME","MOD_NAME","IDGROUP_NAME",1,1,"","USER 1",1,"","2015-02-17T09:53:36","2015-04-03T19:36:50",0,0,"SUPER USUÁRIO","SUPER USUÁRIO","USUÁRIOS",2,2,"","USER 2",1,"","2015-02-17T09:53:36","2015-04-03T19:36:50",0,0,"SUPER USUÁRIO","SUPER USUÁRIO","USUÁRIOS",3,3,"","USER 3",1,"3","2015-02-17T09:54:00","2015-05-12T20:56:40",0,0,"SUPER USUÁRIO","SUPER USUÁRIO","USUÁRIOS",4,4,"","USER 4",1,"","2015-02-25T19:36:19","2015-05-12T20:56:40",0,0,"SUPER USUÁRIO","SUPER USUÁRIO","USUÁRIOS"],"rowCount":4}

In clientdataset the INC_DATE and MOD_DATE fields are timestamp.

Offline

#4 2015-05-16 14:31:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: TSQLTable.FieldTypeIntegerDetectionOnAllRows

Yes, there are TDateTime timestamps, not Int64 timestamps.

You need to supply the TSQLRecord class to the TSQLTableJSON, so that the appropriate field types are defined.
Or just use SetFieldTypes() method.

Anyway, I added some code changes so that sftDateTime columns should now be recognized as such, similar to what was the case before the latest commits.
See http://synopse.info/fossil/timeline

Offline

#5 2015-05-16 15:35:43

Celso
Member
Registered: 2013-05-14
Posts: 55

Re: TSQLTable.FieldTypeIntegerDetectionOnAllRows

It I downloaded and worked.

Thank you very much.

Offline

Board footer

Powered by FluxBB