How do I return the system date or datetime in DB2 for Z/OS using SQL? I am more familiar with SQL Server, where I would use "SELECT getdate()". I've tried a few permutations of this on DB2, but with no luck so far. Seems like I need a predicate, but am not sure where system information would be "FROM". Can anyone enlighten me?
Asked
Active
Viewed 2,450 times
2 Answers
1
Try select current date from sysibm.sysdummy1

MacBrave
- 58
- 5
-
Shouldn't that be `current_date` (with an underscore?) – Sep 20 '12 at 19:53
-
1@a_horse_with_no_name: It works with either on DB2. (same with `CURRENT_TIMESTAMP` vs `CURRENT TIMESTAMP`) – bhamby Sep 20 '12 at 20:51
-
*current_date* actually did not work in my environment. Could be driver-specific. I'm using StarSQL JDBC driver. – FremenFreedom Sep 21 '12 at 21:07