0

I am doing work to convert db2 sqlquery to netezza. I found

select (timestamp("DATE") + current timezone) AS TXN_DATE
from table_name;

which is not supported in Netezza. What is equivalent Netezza query of above db2 sql query?

Dinesh Subedi
  • 2,603
  • 1
  • 26
  • 36
  • 1
    Ideally, you don't need a literal translation, you'd fix it by dealing with underlying datatypes. Especially because I'm suspicious of the validity of use. "Transaction Date"s are usually best dealt with in one of two ways; 1) as a log of the actual, absolute, UTC-based timestamp when the transaction occurred or 2) the "business date" (fiscal or accounting date) when something occurred. In neither case is the current timezone of the session relevant, especially _as this value may be changed_. What does this data look like, and what are you trying to do with it? – Clockwork-Muse Apr 19 '14 at 05:04
  • What does timestamp(TL."DATE") return ? is TL."DATE" a column from table_name ? – r.m Apr 19 '14 at 16:42
  • @r.m yes! DATE is a column from table_name and it's data type is "TIMESTAMP". – Dinesh Subedi Apr 21 '14 at 03:51
  • @Clockwork-Muse I am unknown about data. My job is to convert db2 to netezza. I am discussing with client about both points you mention in comment. – Dinesh Subedi Apr 21 '14 at 04:11
  • I don't think there is a built-in way to retrieve the system time zone setting in Netezza. You could write a user-defined function to do that though. – mustaccio Apr 23 '14 at 18:35

0 Answers0