I am trying to select a string from a parameter set value file which holds a timestamp. This is my delta date to pull delta records. My source is SQL Server. However, when I try to compare this parameter value to the source column (USTIMESTAMP), it does not pull any records and throws this information in the Director log:
WHERE USTIMESTAMP > convert(timestamp, '#ps_AppraisalFormSection_DeltaDate.EXTRACT_TIMESTAMP#')
Note that I have to convert my parameter to a timestamp since it is stored as a string.
Do I have to use a different driver? Or is my Where clause incorrect? I know this same job was working months ago, however I ran it today and cannot get it to work.
Thanks in advance.
Jweir
--- If strength were all, tiger would not fear scorpion.
ODBC function "SQLExecute" reported: SQLSTATE = 22007: Native Error Code = 241: Msg = [IBM(DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Conversion failed when converting date and/or time from character string. (CC_OdbcDBStatement::executeSelect, file CC_OdbcDBStatement.cpp, line 1,389)
Jweir
--- If strength were all, tiger would not fear scorpion.
Update. I have gotten rid of the first problem. I altered the odbc.ini file to include quoted identifiers. The line in the Director log is no longer there.
ODBC function "SQLExecute" reported: SQLSTATE = 22007: Native Error Code = 241: Msg = [IBM(DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Conversion failed when converting date and/or time from character string. (CC_OdbcDBStatement::executeSelect, file CC_OdbcDBStatement.cpp, line 1,389)
Jweir
--- If strength were all, tiger would not fear scorpion.
The first message is just a warning and isn't applicable to your problem. What is the value of #ps_AppraisalFormSection_DeltaDate.EXTRACT_TIMESTAMP# at runtime?
Is your SQL-Server datatype "datetime" or "datetime2"?
Oh, I just saw the error - your convert() is backwards... plus you don't want to convert to a timestamp in SQL-Server, that is a very different type of field - you want datetime or datetime2
Did you look up the correct Style-value for the conversion you want?
I do not use SQL-Server a lot, but there are dozens of conversion formats and it may be necessary to specify the correct one corresponding to your data.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
Scratch my last post. Since it is in my WHERE clause, it has no place in my table definition. I got one of my test jobs mixed in with the final version.
Jweir
--- If strength were all, tiger would not fear scorpion.
WHERE USTIMESTAMP > convert(datetime,'1800-01-01 16:07:48')
Do I have to do something unique when I am dealing with parameter set value files? Since I am selecting the time from a value file of a parameter set...
Jweir
--- If strength were all, tiger would not fear scorpion.
My problem has been magically fixed. I re-ran my job and it now pulls the rows I need. The only thing I did was cleared out my SELECT statement and made sure I copied and pasted my entire parameter. Here is my code that works. Let me know if someone spots something that is different from what I had before, but I could not see anything:
ArunaDas_Maharana - that "20" is an optional parameter the SQL-Server "Convert()" which specifies the string format. It should be used to make sure that no incorrect parsing of the string date is made.