The basic functions in Oracle (P2)

View: 762    Dowload: 0   Comment: 0   Post by: naruto   Category: Oracle   Fields: Other

0 point/4 review File has been tested

The basic functions in Oracle ( P2 ) Blog / MSSQL database - oracle - Today 2Cwebvn please write to the jaw in a series on Oracle , the first post we have a vision of all the basic functions in Oracle , today I will go all details about the group is the first function of the character and function of the chain . Today's article is quite long and you should be prepared to sit well okay , then we start any time .
Today 2Cwebvn please write to the jaw in a series on Oracle , the first post we have a vision of all the basic functions of Oracle , today I will post details about the group is the first function of the character and function of the chain . Today's article is quite long and you should be prepared to sit well okay , then we start any time .
 
Let's look at the function in group 1 before they learn offline.

Group functions and sequences of characters ( Character / String Functions )

Ascii   Convert   Lower   Soundex  
AsciiStr   Decompose     Lpad   Substr  
Chr   Dump   Ltrim   Translate  
Compose   Initcap   Replace   Trim  
Concat   Instr   Rpad   Upper  
Concat with ||   Length   Rtrim   VSize  

We should note giving examples such as ASCII ( ' t' ) , to test this example , we do the following : SELECT ASCII ( ' t' ) FROM dual ; Table 1 Dual table in our system could borrow it to test the examples , or you can put on one other table name you like , as long as it is in the database of us is . Now we embark on understanding each " child " a public .

1 . ASCII ( single_character )
a) Function : returns the number of characters representing determine if there are more characters it returns only the first character in the string .
b ) Syntax ascii ( single_character )
single_character character is specified to obtain a code . If more than one character is entered , the function will return the value for the first character and ignore all characters behind .
 
c ) application version : Oracle 8i , Oracle 9i , Oracle 10g , Oracle 11g .
d ) For example :

ascii('t') kết quả:  116.
ascii('T') kết quả:   84.
ascii('T2') kết quả:   84.
 

2. ASCIISTR (string)
a) Function: Function: converts any characters in a string that you want to convert a string using the ASCII character set database.
b) Syntax: asciistr (string)
string is a string in any character set that you want to convert a string of ASCII characters in the database.
c) application version: Oracle 9i, Oracle 10g, Oracle 11g.
d) For example:

asciistr('A B C Ä Ê') results:  Chạy rồi sẽ biết
asciistr('A B C Õ Ø') results:   Chạy rồi sẽ biết  
asciistr('A B C Ê Í Õ Ø') results:   Chạy rồi sẽ biết  
 

3. CHR( number_code )

a) Chức năng: ngược lại với hàm ASCII, nó trả về ký tự dựa vào mã số đưa vào.
 
b) Cú pháp: CHR( number_code )
 
number_code là mã số được sử dụng để lấy lại ký tự.
 
a) Phiên bản áp dụng: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
 
d) Ví dụ:
chr(116) results: 't'.
chr(84) results:   'T'.
 

4. COMPOSE (string)
a) Function: returns a Unicode string.
b) Syntax: COMPOSE (string)
string as input values ​​used to generate the Unicode string. It can be a char, varchar2, nchar, nvarchar2, CLOB, or NCLOB.
Below is a list of values ​​unistring can be combined with other characters in the COMPOSE function, you can use the concat function or the operator | | to do okay:

 
  Các hàm cơ bản trong Oracle (P2)
c) application version: Oracle 9i, Oracle 10g, Oracle 11g
d) For example:
compose('o') results: o
compose('a') results: a
compose('e') results: e.
 

5. CONCAT (string1, string2)
a) Function: Allows you to connect two strings together.
b) Syntax: CONCAT (string1, string2)
string1 is the first string to connect.
string2 is the second string to connect.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:

 
concat('Web Design', ' and Development') results: 'Web Design and Development'
concat('2cweb', 'vn') results: '2cwebvn'.
 

6. || Operator

a) Function: Allows you to connect 2 or more strings together.
 
b) Syntax: string1 | | string2 | | string_n
string1 is the first string to connect.
string2 is the second string to connect.
string_n the nth string to connect.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:
'Web Design' || ' and Development' results: 'Web Design and Development'
'www.' || '2cweb' || '.vn' results: 'www.2cweb.vn'.
 

7. CONVERT (string1, char_set_to, [char_set_from])
a) Function: convert a string from one set to another set.
b) Syntax: convert (string1, char_set_to, [char_set_from])
string1 is the string to be converted.
char_set_to character set to convert to.
char_set_from the character set to convert from.
c) Table settings include:

 
 Các hàm cơ bản trong Oracle (P2)
 

d) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
a) For example:
convert ('ABCDE Ä Ê Í o o', 'US7ASCII', 'WE8ISO8859P1') results: 'ABCDEAEI? ? '

8. DECOMPOSE (string)
a) Function: Accepts a string and returns a Unicode string.
b) Syntax: decompose (string)
string is the string will decay.
c) application version: Oracle 9i, Oracle 10g, Oracle 11g
d) For example:

DECOMPOSE('tuấn') results:  'tua^´n'
DECOMPOSE('Très bien') results: 'Tre`s bien'
DECOMPOSE('é') results: 'e´'
 

9. DUMP (expression, [return_format], [start_position], [length])
a) Function: returns a varchar2 value includes the data type code, length in bytes, and internal representation of the expression.
b) Syntax: dump (expression, [return_format], [start_position], [length])
expression is the expression to analyze
return_format is optional. It determines the format of the return value.
This parameter can be any of the following values​​:

 
  Các hàm cơ bản trong Oracle (P2)
 
start_position and length are optional parameters. We define the representation of the inside to show. If this parameter is omitted, it will display the entire internal representation in decimal notation.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:
DUMP('2cweb') results:  'Typ=96 Len=5: 50,67,119,101,98'
DUMP('2cweb', 10) results: 'Typ=96 Len=5: 50,99,119,101,98'
DUMP('2cweb', 16) results: 'Typ=96 Len=5: 32,63,77,65,62'
DUMP('2cweb', 1016) results: 'Typ=96 Len=5 CharacterSet=AL32UTF8: 32,63,77,65,62 '
DUMP('2cweb', 1017) results: 'Typ=96 Len=5 CharacterSet=AL32UTF8: 2,c,w,e,b'
 

10. INITCAP (string1)
a) Function: set the first character in each word to uppercase, the remaining characters to lowercase.
b) Syntax: initcap (string1)
string1 is the string argument first character in each word will be converted to uppercase and all remaining characters converted to lowercase.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:

initcap('design and development'); results:  'Design And Development'
initcap('CHICK CHICK') results: 'Chick Chick'
 

11. INSTR (string1, string2 [, start_position [, nth_appearance]])
a) Function: returns the position of a substring in a string.
b) Syntax: instr (string1, string2 [, start_position [, nth_appearance]])
string1 is the string search.
string2 is in string1 search string.
start_position is the position in string1 where the search will begin, this attribute is optional. If it is omitted, the default is 1. Starting position in the string is 1. If start_position is negative, the function will start counting from the end of string upwards.
nth_appearance is the nth appearance of string2. This is optional. If omitted, the default is 1.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:

instr('design and development', 'e'); kết quả:  2
instr('design and development', 'e',1,1); kết quả:  2
instr('design and development', 'e',1,2); kết quả:  13
instr('design and development', 'e',1,3); kết quả:  15
instr('design and development', 'e',-3,2); kết quả:  15
 

12. LENGTH (string1)
a) Function: returns the length of the string.
b) Syntax: length (string1)
returns string1 is the string length. If string1 is NULL, then the function returns NULL.
c) application version: Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
d) For example:

length(NULL) results:  NULL
length('') results:  NULL
length('Design and Development') results:  22
length('Design and Development ') results:  23
 
I only experienced half way, but your post is too long, so I will cut half the remaining part through a new, remember to welcome you to read offline.
Thank you for visiting my blog, wish you success!

 

The basic functions in Oracle (P2)

The basic functions in Oracle (P2) Posted on 24-03-2014  The basic functions in Oracle ( P2 ) Blog / MSSQL database - oracle - Today 2Cwebvn please write to the jaw in a series on Oracle , the first post we have a vision of all the basic functions in Oracle , today I will go all details about the group is the first function of the character and function of the chain . Today's article is quite long and you should be prepared to sit well okay , then we start any time . 5/10 762

Comment:

To comment you must be logged in members.

Files with category

 
File suggestion for you
File top downloads
Codetitle.net - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.net Develope by Vinagon .Ltd