Skip to main content

I cannot understand why I get the error message

 

MS SQL Server Spatial (JDBC) Writer: Error writing feature. Error: Attribute 'DATECOLLECTED' does not contain a valid timestamp

 

The timestamp I want to write is for the moment hard coded as 2021-07-20.

The databse accept this format confirmed with successful update SQL

 

update dbo.Feature

set "DATECOLLECTED" = '2021-07-20'

where ID = ...

 

Why does FME fail to write to my db? Any suggestions?

Hello @so_much_more​ , is the writer returning an error at all? Have you tried manually setting a value? Or setting the value with SQL? Best, Kailin.


Hello @so_much_more​, What is the data type of the field? Is the data type date or datetime? You might need to add a time to your string.


The datatype is datetime. as @philipwhitten​ mentioned what was missing is to also add time to the string.

So after adding "00:00:00" to the date it worked fine.

I assume SQL Management studio throw that on itself if its missing to match the datatype in the database.


Hello @so_much_more​ , is the writer returning an error at all? Have you tried manually setting a value? Or setting the value with SQL? Best, Kailin.

Error from writer was my message "MS SQL Server Spatial (JDBC) Writer: Error writing feature. Error: Attribute 'DATECOLLECTED' does not contain a valid timestamp". I just needed to be a bit more verbose and specific adding time to the record "2021-07-20 00:00:00"


Reply