Home >Common Problem >what is oracle function
The oracle function is a PL/SQL subroutine. It is stored in the Oracle database as a database object. It will process the parameters passed in and return a processing result, that is, return a value. It is usually used to return a specific Data, oracle functions can be divided into two categories: system functions and user-defined functions.
The operating environment of this tutorial: Windows 10 system, Oracle version 19c, Dell G3 computer.
Definition of Oracle function
Function is stored in the oracle database as a database object, and the function is also called a PL/SQL subroutine.
The function will process the parameters passed in and return a processing result, that is, return a value. Usually used to return specific data.
Oracle functions can be divided into two categories: system functions and user-defined functions.
ORACLE function single-line function
pseudo table: a real table that exists temporarily to facilitate data verification; table name: dual
1. Character function
Function name | Function | Example | Result |
---|---|---|---|
Capitalize the first letter | initcap('nice') | Nice | |
Convert to lowercase | lower('NICE') | nice | |
Convert to uppercase | upper('nice') | NICE | |
left shear | ltrim( 'nice','ni') | ce | |
Right cut | rtrim(' nice','e') | nic | ##concat(char1,char2) |
concat(' ni','ce') | nice | substr(char,pos,len) | |
substr ('nice',2,2) | ic | instr(char,substr) | |
instr('nice','c') | 3 | ##translate(char,key,value) | |
translate('nice','ne','01') | 0ic1 | ##replace(char,old,new) | String replacement |
nicce | 2. Numerical function |
Function name
Result | ##abs(n) | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | ##mod( m,n) | Module | mod(3,2) | ||||||||||||||||||||||||||||||||||||||||||
sign(n) | Get the sign | sign(-3) | |||||||||||||||||||||||||||||||||||||||||||
ceil(n) | Round up | ceil(3.2) | |||||||||||||||||||||||||||||||||||||||||||
floor(n) | Round down | floor( 3.2) | |||||||||||||||||||||||||||||||||||||||||||
##round(m,n) | Round to the specified number of decimal places | round(3.236,2 ) | |||||||||||||||||||||||||||||||||||||||||||
power(m,n) | m to the nth power | power(3,2) | |||||||||||||||||||||||||||||||||||||||||||
sqrt(n) | square root | sqrt(4) | |||||||||||||||||||||||||||||||||||||||||||
trunc(m,n) | Truncation | trunc(3.233,2) | |||||||||||||||||||||||||||||||||||||||||||
sin(n) | sine | sin(0) | |||||||||||||||||||||||||||||||||||||||||||
cos(n) | cosine | cos(0) | |||||||||||||||||||||||||||||||||||||||||||
3.Date function
Note:
Oracle function multi-row function
Oracle function conversion function
Other functions of oracle functions
|
The above is the detailed content of what is oracle function. For more information, please follow other related articles on the PHP Chinese website!