1.) When I copy a timestamp from an existing cell to a new one, the milliseconds are lost. So when the original value is '2007-03-20 08:00:07.109', ADS will insert '2007-03-20 08:00:07.0'. I think, the full precision should be preserved. When instead of copying a single cell I'm cloning the whole row, it works as intended (full precision preserved).
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/discussion/GeneralDiscussions/post/99/Feature-request-Table-data-editor
The date, time and timestamp objects in the TableDataEditor are handled by the cell renderers called SQLTimestampCellEditor, SQLDateCellEditor and SQLTimeCellEditor. If you trace through the code you will see that you can set a millisecond, but it will only render the value without the millisecond. Then it will generate the INSERT without the milliseconds. You can see DataTableModel.getUpdateScriptStatements() where it generates the statement. The utility methods used to format and parse the timestamps are AFResultValueUtil.prepareTimestamp() and AFResultValueUtil.toStringLocale().
When copying a cell in the Table Data Editor, the displayed value is copied. So, if the millisecond portion is not displayed, it will be lost in the copied value.
You can change the default display format using the File -> Options dialog. Go to General -> Appearance and set the "Date/Time Format" to "M/d/yyyy h:mm:ss.SSS a", which displays the milliseconds .SSS for timestamp values. The millisecond data should now be displayed in the Table Data Editor. When copying a timestamp cell value, the millisecond portion is also copied.
Note that this is a general display option. We have logged an improvement to provide a display option for the Table Data Editor in the future.
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8253
When copying a cell in the Table Data Editor, the displayed value is copied. So, if the millisecond portion is not displayed, it will be lost in the copied value.
You can change the default display format using the File -> Options dialog. Go to General -> Appearance and set the "Date/Time Format" to "M/d/yyyy h:mm:ss.SSS a", which displays the milliseconds .SSS for timestamp values. The millisecond data should now be displayed in the Table Data Editor. When copying a timestamp cell value, the millisecond portion is also copied.
Note that this is a general display option. We have logged an improvement to provide a display option for the Table Data Editor in the future.
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8253
I guess that you have a model behind the table in the TableDataEditor, which is holding the values in the correct datatype and initially with full precision, as returned by the database. Why copy is working with the display value, instead of copying the model value? And why cloning works different?
I guess that you have a model behind the table in the TableDataEditor, which is holding the values in the correct datatype and initially with full precision, as returned by the database. Why copy is working with the display value, instead of copying the model value? And why cloning works different?
Hi,
Regarding your question "why is copying working with default value instead of copying the model value?" The reason is that if it worked w/ the model value, then you would get an error when you do the paste (because the model value doesn't match the expected display format). I agree that this is not ideal behavior and hence we have logged an enhancement request. The "cloning" operation works differently because it has access to both the display value and the model value.
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8253
Hi,
Regarding your question "why is copying working with default value instead of copying the model value?" The reason is that if it worked w/ the model value, then you would get an error when you do the paste (because the model value doesn't match the expected display format). I agree that this is not ideal behavior and hence we have logged an enhancement request. The "cloning" operation works differently because it has access to both the display value and the model value.
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8253
Issue #8252 |
| Closed |
| Fixed |
| Resolved |
Completion |
| No due date |
| No fixed build |
| No time estimate |
The date, time and timestamp objects in the TableDataEditor are handled by the cell renderers called SQLTimestampCellEditor, SQLDateCellEditor and SQLTimeCellEditor. If you trace through the code you will see that you can set a millisecond, but it will only render the value without the millisecond. Then it will generate the INSERT without the milliseconds. You can see DataTableModel.getUpdateScriptStatements() where it generates the statement. The utility methods used to format and parse the timestamps are AFResultValueUtil.prepareTimestamp() and AFResultValueUtil.toStringLocale().