![]() |
|||
|
![]() |
![]() |
|
FULL A - Z Oracle Function Library (formerly named "Morgan's Library")
![]() Term: EXTRACT
Definition:
EXTRACT(date time) The Oracle EXTRACT(Date Time) function splits a datetime or interval expression and returns the value of the specified datetime field (YEAR, MONTH, DAY from DATE and TIMEZONE_HOUR, TIMEZONE_MINUTE from TIMEZONE). It is useful while working with datetime values in tables with large volumes of data. Example Syntax: EXTRACT ( Example Usage: SELECT EXTRACT(YEAR FROM DATE '2010-01-12') FROM DUAL; SELECT The SQL query below returns the month that was current (in effect) 40 days ago: SELECT EXTRACT(MONTH FROM SYSDATE-40) FROM DUAL; EXTRACT(xml) The EXTRACT(XML) function is used to select a node (or set of nodes) along with its leaf nodes. It takes two parameters, object_value and XPath, and returns XMLType output. The XPath parameter can be an absolute or relative type. Example Syntax: EXTRACT(xml-type-instance, 'xpath') EXTRACT(xml-type-instance, 'xpath', 'namespace') Example Usage: SQL> SELECT EXTRACT(OBJECT_VALUE, '/Orders/MailAddressTo') Related Links: Related Code Snippets:
![]() ![]() |
![]() |
Home | Search | Code Library | Sponsors | Privacy | Terms of Use | Contact Us | © 2003 - 2025 psoug.org |