Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL MONTH Keyword      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: MONTH

Definition:
In Oracle PL/SQL, MONTH is a datetime field which specifies a month contained by a date value in either a numeric or string format. It is valid for both DATETIME and INTERVAL data type values. The valid value range for MONTH in datetime values is 1-12, while for INTERVAL values it is 0-11. It can be extracted using the EXTRACT function from a DATETIME or INTERVAL value.

Example Usage:

The SQL below extracts the month from the current date.

SQL> SELECT EXTRACT(MONTH FROM SYSDATE) FROM DUAL;

EXTRACT(MONTHFROMSYSDATE)
-------------------------
12


The SQL below extracts month from the Interval period.

SQL> SELECT EXTRACT(MONTH FROM TO_YMINTERVAL('1-4')) FROM DUAL;

EXTRACT(MONTHFROMTO_YMINTERVAL('1-4'))
--------------------------------------
4



Related Links:

Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 64 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?