Overview
This practice covers the following topics:
• Writing a query that displays the current date
• Creating queries that require the use of numeric, character, and date functions.
Implicit Data-Type Conversion
• Writing a query that displays the current date
• Creating queries that require the use of numeric, character, and date functions.
Implicit Data-Type Conversion
For assignments, the Oracle server can automatically convert the following:
For expression evaluation, the Oracle Server can automatically convert the following:
For expression evaluation, the Oracle Server can automatically convert the following:
Explicit Data-Type Conversion
Using the TO_CHAR Function with Dates
Using the TO_CHAR Function with Dates
The format model:
• Must be enclosed in single quotation marks and is case sensitive
• Can include any valid date format element
• Has an fm element to remove padded blanks or suppress leading zeros
• Is separated from the date value by a comma.
• Must be enclosed in single quotation marks and is case sensitive
• Can include any valid date format element
• Has an fm element to remove padded blanks or suppress leading zeros
• Is separated from the date value by a comma.
Elements of the Date Format Model
• Add character strings by enclosing them in double quotation marks.
• Number suffixes spell out numbers.
• Number suffixes spell out numbers.
Using the TO_CHAR Function with Dates
Using the TO_CHAR Function with Numbers
Using the TO_CHAR Function with Numbers
These are some of the format elements you can use with the TO_CHAR function to display a number value as a character:
Using the TO_NUMBER and TO_DATE Functions
• Convert a character string to a number format using the TO_NUMBER function:
• Convert a character string to a date format using the TO_DATE function:
• These functions have an fx modifier. This modifier specifies the exact matching for the character argument and date format model of a TO_DATE function.
• Convert a character string to a date format using the TO_DATE function:
• These functions have an fx modifier. This modifier specifies the exact matching for the character argument and date format model of a TO_DATE function.