1. TO_CHAR may convert date items to character items. 2. TO_DATE may convert character items to date items. 3. TO_CHAR may convert numbers to character items. 4. TO_DATE may convert date items to character items.
Correct Answer : 4
Explanation: The syntax for the Oracle/PLSQL TO_DATE function is:
string1 is the string that will be converted to a date.
format_mask is optional. This is the format that will be used to convert string1 to a date.
nls_language is optional. This is the nls language used to convert string1 to a date. Let's look at some Oracle TO_DATE function examples and explore how to use the TO_DATE function in Oracle/PLSQL.
For example:
TO_DATE('2003/07/09', 'yyyy/mm/dd') Result: date value of July 9, 2003
TO_DATE('070903', 'MMDDYY') Result: date value of July 9, 2003
TO_DATE('20020315', 'yyyymmdd') Result: date value of Mar 15, 2002
Question : What value is returned after executing the following statement? TO_CHAR(1210.73, '9999.9')
1. 1210.9 2. 1210.7 3. 1210.73 4. 1210
Correct Answer : 2
Explanation: The syntax for the Oracle/PLSQL TO_CHAR function is: