MainframeSupports
tip week 26/2018:
As I think I have mentioned before I am sometimes surprised by functionality I did not know about, but have been around for
several years, even decades. Maybe I am just the last man on earth to discover it, but if not here comes a tip that will save you
a lot of keystrokes, if you often key in timestamps in DB2 SQL.
I have always thought timestamps should be specified using the syntax YYYY-MM-DD-HH.MM.SS.ssssss with a total of
26 characters. But it is fully legal to use YYYY-MM-DD-HH.MM.SS, which only fills up 19 characters. DB2 will automatically
add .000000 as replacement for the missing .ssssss in the timestamp. I have keyed in .000000 so many times at the end of a timestamp
making it hard to break this habit. The best thing about writing timestamps without .000000 is the less space it takes up. Now I can
sometimes write TS BETWEEN <first-timestamp> AND <second-timestamp> on the same line which in my view looks smarter.
Previous tip in english
Forrige danske tip
Tip list