Many Oracle database developers prefer PL/SQL functions, storage, and so on to simplify the code.
Recommended reading:
Use PL/SQL to execute java storage to obtain the MAC address
For example:
Select empno, ENAME, DNAME, loc from emp, dept where emp. DEPTNO = DEPT. DEPTNO;
Developers may think that such an
The decode () function is one of the powerful functions of Oracle Pl/sql, and it is currently available only in Oracle company SQL, and not in the SQL implementations of other database vendors. (But it's not a standard
Many oracle database developers prefer PLSQL functions and storage to simplify the code.
Many oracle database developers prefer PL/SQL functions, storage, and so on to simplify the code.
Many Oracle database developers prefer
A very powerful function in Oracle is to convert functions written in Java into functions in Oracle databases. after conversion, we can use it like a common function. because Oracle is developed in Java, it is naturally compatible with Java. let's talk about the specific ope
Tags: Oracle SQL Report SELECT aggregate functionaggregate functions in Oracle usage of Count, max, Min, Sum, AVG, and NVL functionsThe Grouping function aggregate function performs a calculation on a column in a set of rows and returns a single value. The aggregate function ignores null values. Aggregate
Oracle notes some system functions, user-defined functions, and keyword inscriptions: Collect oracle knowledge points that are commonly used at work, update constantly, and accumulate constantly. Just use it as your own notebook. Some keywords 1 is not null to determine whether the field IS NULL[
Tags: end scalar required POI Nullif Point not contexts preReference: http://docs.oracle.com/database/122/SQLRF/Functions.htm#SQLRF006 Single-row functions return a single result row for every row of a queried table or view. These functions can appear in select lists, WHERE clauses, and START WITH CONNECT BY clauses, and HAVING clauses. The one-line function returns a single result row for each row of the q
Single-record functions in SQL1.ASCIIReturns the decimal number corresponding to the specified character;Sql> Select ASCII (' a ') a,ascii (' A ') a,ascii (' 0 ') zero,ascii (') space from dual;
A A ZERO space--------- --------- --------- ---------65 97 48 32
2.CHRGive an integer and return the corresponding character;Sql> Select Chr (54740) ZHAO,CHR () chr65 f
') from DUAL; --17:NVL (X, VALUE)Returns value if X is null, otherwise returns X SELECT NVL (NULL, ' 2 ') from DUAL; SELECT NVL (' + ', ' 2 ') from DUAL; --18:NVL2 (X, VALUE1, VALUE2)If x is a null value, return VALUE1, otherwise return VALUE2 SELECT NVL2 (NULL, ' 3 ', ' 4 ') from DUAL; --19:nanvi (X, VALUE)Returns value if X is not a number, otherwise returns x SELECT nanvi (' 3DF ', ' a ') from DUAL; --I don't know if it appears in Oracle 11.------
A function is a program that has 0 or more parameters and has a return value. In SQL, Oracle builds a series of functions that can be called SQL or PL/SQL statements, and functions are divided into two main classes: Single-line
In Oracle functions in addition to character functions, date functions, mathematical functions, and conversion functions, and so on, there are some functions are common
into Oracle servers and Oracle tools that can treat PL/SQL as an engine within an Oracle server, and a single SQL statement processor to handle pl/ SQL program block. The SQL statement
This article mainly describes the comparison between common DB2 functions and Oracle functions, including descriptions of type conversion functions, time and date, string functions, and mathematical functions, the following is a d
Comparison of functions between Visual Basic for Applications and SQL Server Transact-SQL (ADP)Note that the information in this topic applies only to the Microsoft Access Project (. ADP ).
The following table compares common functions in Microsoft Visual Basic for Applications (VBA) and Microsoft
A big and comprehensive choice between SQL and functions: Who is a more effective SQL ?, More effective SQL
Reprinted please indicate the source: jiq •'s technical Blog
Note that the Oracle11g database is discussed here. It is not applicable to SQL Server, MYSQL, and other d
that a function can return a value, but a process does not return a value.
L However, both the process and function can specify one or more output parameters through out. We can use the out parameter to return multiple values in the process and function.
Stored Procedure example with out function
/*
Out parameter: query the name, monthly salary, and position of an employee.
*/
Create or replace procedure queryEmpInfo (eno in number,
Pename out varchar2,
Psal out number,
Pjob out varchar2)
A
To create a function:format:Create or Replace function func ( parameter parameter type )Return numberIsBegin-------- business logic ---------End;--Create a functionCreate or Replace functionFunc (DNO Number)return Number isT_max Number;begin Select Max(SAL) intoT_max fromEMP TwhereDeptno=DNO; returnT_max;End ;--examples of calling stored procedures and calling functions (differences)DeclareT_maxsal Number;begint_maxsal:=FuncTen); Dbms_output.put_l
Userenv in Oracle ()
Oracle Userenv functions, Sys_context
Get session ID with Userenv, then connect v$transaction connection v$session, check current transaction number with session ID
Select T.xid from V$transaction t join v$session s on t.addr = s.taddr where s.sid = Userenv (' Sid ')
1, USERENV (OPTION)Returns the current session information.Option= ' Is
deleted. In the actual business, can be used to delete some of the exception data, such as Table A field t_no represents a telephone number, and the phone number itself should be a string consisting of numbers, in order to delete those containing non-numeric exception data, I used the Translate function: SQL> Delete fromA,whereLength (Translate (Trim (a.t_no),'0123456789' ||A.t_no,'0123456789'))Length (Trim (a.t_no));2.ReplaceSyntax:REPLA
In SQL, PL/SQL functions are used. Many oracle database developers prefer PL/SQL functions and storage to simplify the code. for example, select empno, ENAME, DNAME, loc from emp, dept where emp. DEPTNO = DEPT. DEPTNO; for such an
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.