ODBC Output using Update Function
Posted: Thu Nov 04, 2021 3:06 am
Hi all,
Looking for a bit of advice on an ODBC Output to a SQL table.
Here are the details:
I have a column in the the table called [Date] format is Date, Null
There are dummy records in this date field which are populated with 1900-01-01.
I would like to convert all of those dates to a NULL.
When I run a simple query in SSMS it works as expected, but when executing it from my TI it fails with the following message:
Operand type clash: date is incompatible with int
Here is the query in SSMS which is working correctly that I'd like to enable running from the Prolog of my TI process:
Update [My Table]
Set [Date] = null
Where [Date] = '1900-01-01'
Here's the TI code:
sSQL = 'UPDATE [My Table] SET [Date] = NULL WHERE [Date] = 1901-01-01';
OdbcOutput ( cODBC, sSQL );
Seems pretty simple enough but not sure where I'm going wrong. I've looked through the forums but haven't come across any posts that could help this specific case.
Thanks in advance for any advice.
Looking for a bit of advice on an ODBC Output to a SQL table.
Here are the details:
I have a column in the the table called [Date] format is Date, Null
There are dummy records in this date field which are populated with 1900-01-01.
I would like to convert all of those dates to a NULL.
When I run a simple query in SSMS it works as expected, but when executing it from my TI it fails with the following message:
Operand type clash: date is incompatible with int
Here is the query in SSMS which is working correctly that I'd like to enable running from the Prolog of my TI process:
Update [My Table]
Set [Date] = null
Where [Date] = '1900-01-01'
Here's the TI code:
sSQL = 'UPDATE [My Table] SET [Date] = NULL WHERE [Date] = 1901-01-01';
OdbcOutput ( cODBC, sSQL );
Seems pretty simple enough but not sure where I'm going wrong. I've looked through the forums but haven't come across any posts that could help this specific case.
Thanks in advance for any advice.