I have a Sybase table with multiple VARCHAR columns to hold information. When I tried to insert a string that looks like a date, Sybase performs an implicit conversion, which results in the insertion failure.
insert into INCOMING (DATA1, DATA2, DATA3) values ("15:20:00.000000 +0900","15:30:00.000000 +0900", "60") Error : 20018 - General SQL Server error: Check messages from the SQL Server. Message : 249 - Syntax error during implicit conversion of CHAR value '15:20:00.000000 +0900 ' to a DATE field. Severity: 5
In this particular case, the inserted data is a date, but it is not always true. The data is extracted from a logging system where everything is stored as a string and whose type is variable. I have no control over the source and very little on the database itself. I am only an intermediate layer extracted from a source and inserted into a database table.
How should I change my insert order to avoid the errors I see?
I have tried this:
insert into INCOMING (DATA1, DATA2, DATA3) values (convert(char(32), "15:20:00.000000 +0900"),convert(char(32), "15:30:00.000000 +0900"),convert(char(32), "60"))
But that gives me the same mistake.
I'm using Sybase ASE 15-0