Can anyone help with my embedded SQL in a old mainframe COBOL application that also runs on Windows. The SQL that is failing is a pretty standard SELECT and in the WHERE clause I am comparing some date/time columns in the selected rows with a timestamp of two COBOL host variables.
My SQL has been working for 10 years on various releases and still works just fine today on DB2 z/OS 10.1 and ok with SQL Server 2005 and 2008 and on Oracle 10g and 11g. But for some reason it just does not work on DB2 9.7 for Windows any more. Any ideas?
SELECT blah-blah where
timestamp(a.date_row_last_alt, a.time_row_last_alt)
> timestamp(:date-last-notified,:time-last-notified)
On DB2 9.7 I now get the following error:
[IBM][CLI Driver][DB2/NT] SQL0245N The invocation of routine "TIMESTAMP" is ambiguous. The argument in position "1" does not have a best fit. SQLSTATE=428F5
Any ideas why this is no longer supported?
I have also tried the following and they don't work either:
> timestamp(date(cast(:date-last-notified as char(10))),
time(cast(:time-last-notified as char(8))))
> timestamp(cast(:date-last-notified as char(10)),
:time-last-notified as char(8))