The transformation function of Oracle function encyclopedia

Source: Internet
Author: User

Chartorowid (C1)

"Feature" Conversion varchar2 type is ROWID value

"Parameter" c1, string, string of length 18, string must conform to ROWID format

"Return" returns the ROWID value

"Example" Select Chartorowid (' aaaadeaabaaaazsaaa ') from DUAL; "description" in Oracle, each record has a rowid,rowid that is unique throughout the database, ROWID determines which data file, block, and line in Oracle each record is in. In a repeating record, all columns may have the same contents, but the ROWID will not be the same.

---------------------------------------------------------------------

Rowidtochar (ROWID)

"Function" Convert rowID value to VARCHAR2 type

"Parameters" rowid, fixed parameters

"Return" returns a string of length 18

"Example" Select Rowidtochar (ROWID) from DUAL;

"description" in Oracle, each record has a rowid,rowid that is unique throughout the database, ROWID determines which data file, block, and line in Oracle each record is in. In a repeating record, all columns may have the same contents, but the ROWID will not be the same.

---------------------------------------------------------------------

CONVERT (C1,set1,set2)

Feature converts the source string C1 from one language character set Set2 to another Set1 character set

"Parameter" c1, string, Set1,set2 as character parameter

"Return" string

"Example" select CONVERT (' Strutz ', ' we8hp ', ' F7dec ') "conversion" from dual;

---------------------------------------------------------------------

Hextoraw (C1)

Feature converts a hexadecimal-formed string into a binary

"Parameter" c1, hexadecimal string

"Return" string

"Example" Select Hextoraw (' A123 ') from dual;

---------------------------------------------------------------------

Rawtohex (C1)

Feature converts a binary-composed string to hexadecimal

"Parameter" c1, binary string

"Return" string

"Example" Select Rawtohex (' A123 ') from dual;

---------------------------------------------------------------------

To_char (X[[,C2],C3])

Feature converts a date or data to a char data type

"Parameter" x is a date or number data type. C2 Sets the parameters for the format parameter C3 to NLS if X is the date nlsparm=nls_date_language controls the language that is used for the month and Day returned. If X is a numeric nlsparm=nls_numeric_characters used to specify the separator for the decimal and the kilobits, as well as the currency symbol. nls_numeric_characters = "DG", nls_currency= "string"

"Return" VARCHAR2 character

"Description 1" x is data type

"Example" To_char (1210.73, ' 9999.9 ') returns ' 1210.7 ' To_char (1210.73, ' 9,999.99 ') return ' 1,210.73 ' To_char (1210.73, ' $9,999.00 ') return ' $ 1,210.73 ' To_char (21, ' 000099 ') returns ' 000021 ' To_char (852, ' xxxx ') return ' 354 '

"Description 2" x is date type

"Example" To_char (Sysdate, ' d ') the day of the week To_char (sysdate, ' DD ') the day of the month To_char (sysdate, ' DDD ') the first few days of each year to_char (sysdate, ' ww ') the week to _char (sysdate, ' mm ') annual number of months To_char (sysdate, ' Q ') each year to_char (sysdate, ' yyyy ') year of the first few seasons

Example with C3 example

Select To_char (to_date (' 2002-08-26 ', ' yyyy-mm-dd '), ' Day ', ' nls_date_language = American ') from dual;

Return: Monday

---------------------------------------------------------------------

To_date (X[,C2[,C3])

"Function" converts a string x to a date type

"Parameter" c2,c3, character type, reference To_char ()

"Return" string if x is in date format, the same expression: date x If the x format is datetime (timestamp) format, the same expression: Timestamp x

"Contrary" to_char (DATE[,C2[,C3])

"Example" Select To_date (' 199912 ', ' yyyymm '), to_date (' 2000.05.20 ', ' yyyy.mm.dd '), (date ' 2008-12-31 ') xxdate, To_date (' 2008-12-31 12:31:30 ', ' yyyy-mm-dd hh24:mi:ss '), (timestamp ' 2008-12-31 12:31:30 ') Xxtimestamp from dual;

---------------------------------------------------------------------

To_number (X[[,C2],C3])

"Function" converts the string x to a digital type

"Parameter" c2,c3, character type, reference To_char ()

"Return" number string

"Contrary" to_char (DATE[[,C2],C3])

"Example" Select To_number (' 199912 '), To_number (' 450.05 ') from dual;

Convert to 16 binary. To_char (+, ' XX ') = 64

---------------------------------------------------------------------

To_multi_byte (C1)

Feature converts half-width in a string to full-width

"Parameter" C1, character type

"Return" string

"Example" Select To_multi_byte (' High a ') text from dual;

---------------------------------------------------------------------

To_single_byte (C1)

Feature converts full-width in a string to half-width

"Parameter" C1, character type

"Return" string

"Example" Select To_multi_byte (' High a ') text from dual;

---------------------------------------------------------------------

NLS_CHARSET_ID (C1)

"Feature" returns the character set name parameter ID value

"Parameter" C1, character type

"Return" Numeric type

"Example" Select nls_charset_id (' ZHS16GBK ') from dual;

---------------------------------------------------------------------

Nls_charset_name (N1)

"Feature" returns the character set name parameter ID value

"Parameter" n1, numeric type

"Return" character type

"Example" Select Nls_charset_name (852) from dual;

The transformation function of Oracle function encyclopedia

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.