TAILIEUCHUNG - Oracle XSQL- P11
Oracle XSQL- P11Welcome to the exciting world of eXtended Structured Query Language (XSQL) development! What’s so exciting? Efficiency and ease of use. XSQL isn’t some razzle-dazzle technology to wow your users. It also isn’t the latest X standard du jour that no one can stop talking about until you ask, “But what does it do for me today?” The problem with all of the great stuff out there is that no one technology does it all. | 180 Chapter 8 Table Date-Format Examples SQL RESULT SELECT to_char current_timestamp 2002-05-19 YYYY-MM-DD HH24 MI 01 01 AS date_str FROM dual SELECT to_char sysdate year AS date_str FROM YYYY dual year 2002 SELECT to_char sysdate DAY MONTH DD YYYY AD AS date_str FROM dual SUNDAY MAY 19 2002 AD NOTE You can change the default date format by editing the file or by using the ALTER SESSION statement to change it for a particular SQL session. Altering the session is generally impractical for XSQL and can t be done from the xsql query action. If you change the date format in the file then the default date format will be changed for everyone on your database. This may be ill-advised if your database has other applications. Date-Format Elements An SQL date format mask is made up of elements that are replaced by the appropriate value from the date in the output. Table lists some examples of date formats. Table lists all the elements that you can use in date formats. Table Date-Format Elements ELEMENT DESCRIPTION - . These punctuation marks can appear anywhere in the format mask. They will be included verbatim in the output. text Quoted text can be included anywhere in the format mask. It will be included verbatim in the output. AD . BC or . Outputs if the date is . or . AM . PM or . Outputs if the time is . or . CC Century number. SCC Century number with . dates represented by a negative number. Oracle SQL 181 Table Continued ELEMENT DESCRIPTION D Numerical day of the week. Sunday is 1 and Saturday is 7. DAY Full name of the day . Sunday . DD Day of the month. DDD Day of the year. DY Abbreviated day . Sun . E Abbreviated era name only valid for Japanese Imperial Republic of China Official and Thai Buddha calendars . EE Full era name only valid for Japanese Imperial Republic of China Official and Thai Buddha calendars . FF Fractional seconds. HH HH12 Hour of the day on a 12-hour .
đang nạp các trang xem trước