Conversion functions of Oracle SQL functions

Source: Internet
Author: User

Chartorowid (C1) "function" conversion varchar2 type is ROWID value "parameter" C1, string, string length 18, string must conform to ROWID format "return" rowID value "Example" SQL> SELECT Chartorowid ('aaaadeaabaaaazsaaa') from DUAL; Chartorowid ('AAAADEAABAAAAZSAA--------------------------------------------------------------------------------aaaadeaabaaaazsaaa "description" in Oracle, each record has a rowid,rowid that is unique throughout the database, ROWID determines which data file, block, and line is in Oracle for each record. In a repeating record, all columns may have the same contents, but the ROWID will not be the same. Rowidtochar (ROWID): The function conversion rowid value is VARCHAR2 type "parameter" rowid, fixed argument "return" returns a string of length 18 SQL>SELECT Rowidtochar (ROWID) from DUAL; Rowidtochar (ROWID)------------------Aaaab0aabaaaaohaaaconvert (C1,set1,set2) "function" converts the source string C1 from one language character set Set2 to another Set1 character set "parameter" C1, string, Set1,set2 to character parameter "return" String "Example"SelectConvert'Strutz','we8hp','F7dec')"Conversion"  fromDual;conver------Strutzhextoraw (C1) "function" converts a hexadecimal-formed string into a binary "parameter" C1, the hexadecimal string "returns" the string "example"SelectHextoraw ('A123') fromdual; To_date (X[,C2[,C3]) "function" converts the string x to the date type "parameter" C2,C3, the character type, the reference To_char () "Return" string if the X format is in date format, the same expression: date x If the x format is a datetime type ( Timestamp) format, the same expression: Timestamp X "opposite" To_char (Date[,c2[,c3]) SQL>SelectTo_date ('199912','yyyymm'),  2To_date ('2000.05.20','yyyy.mm.dd'),  3(Date'2008-12-31') Xxdate,4To_date ('2008-12-31 12:31:30','YYYY-MM-DD Hh24:mi:ss'),  5(timestamp'2008-12-31 12:31:30') Xxtimestamp6   fromdual; To_date ('To_date ('Xxdate To_date ('Xxtimestamp--------- --------- --------- --------- --------------------------------------------------------------------------- on-dec- About  --may-xx  to-dec- ,  to-dec- ,  to-dec- , 12.31.30.000000000Pmto_number (x[[,c2],c3]) "function" converts the string X to a numeric type "parameter" c2,c3, character type, reference To_char () "Return" number string "reverse" to_char (DATE[[,C2],C3]) "Example" SelectTo_number ('199912'), To_number ('450.05') fromdual; To_multi_byte (C1) "function" converts half-width in a string to full-width "parameter" C1, character "return" string "Example" SQL>SelectTo_multi_byte ('High A') text fromdual;test--High Ato_single_byte (C1) "function" converts full-width in string to half-width "parameter" C1, character "return" string "Example" SQL>SelectTo_multi_byte ('High A') text fromdual;test----High Anls_charset_name (N1) "function" returns character set name parameter ID value "parameter" n1, numeric Type "return" character type SQL>SelectNls_charset_name (852) fromDual;nls_char--------Zhs16gbknls_charset_name (N1) "function" returns the character set name parameter value "parameter" n1, numeric Type "return" character type SQL>SelectNls_charset_name (852) fromDual;nls_char--------ZHS16GBK

Conversion functions of Oracle SQL functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.