Database Reference
In-Depth Information
Figure 8.17
Formatting Dates
Globally for a
Session.
Also, because all date formatting is changed globally, we have to alter the
previous query to comply with the required date formatting. Otherwise, the
query will produce an error.
COLUMN TITLE FORMAT A30 WRAP
SELECT S.TITLE, S.RECORDING_DATE FROM SONG S
WHERE S.RECORDING_DATE > ' Sunday, July 01, 2001 ';
The result of the query is shown in Figure 8.17.
Making global changes like that is a little drastic and can be dangerous
because other things can be altered, usually where you least expect it, very
likely causing headaches and problems. The better way to format a date is
by using the TO_CHAR function. However, using functions in queries can
cause performance problems. Restore the default date format by typing and
executing this command.
 
Search WWH ::




Custom Search