Tanel Poder gives ‘A tip for lazy Oracle users – type less with ANSI DATE and TIMESTAMP SQL syntax’


Got a handy hint from Tanel Poder’s blog: IT & Mobile for Geeks and Pros about A tip for lazy Oracle users – type less with ANSI DATE and TIMESTAMP SQL syntax.

The tip was about the DATE and TIMESTAMP prefixes for ANSI date and timestamp literals. And when I went looking, I found the documentation in the SQL Reference Manual at Datetime Literals. Things are easier once you know that something exists.

This even works in RMAN 11.2.0.1.0 on Windows XP as the following commands show:

list backup completed after "DATE'2012-12-27'";
list backup completed after "TIMESTAMP'2012-12-27 00:00:00 +11:00'";

Although, it is still better to set NLS_DATE_FORMAT before starting RMAN in order to get the values for the timestamps in a more accurate and readable format.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s