The following articles mainly introduce the five methods for Oracle 11g to call related functions, this article mainly uses Code related to its actual application to introduce how Oracle 11g calls the relevant functions. The following is an analysis of the specific content of this article.
1. This function accepts three optional parameters and returns the sum of three numbers.
- CREATE OR REPLACE FUNCTION add_three_numbers
- (
- a NUMBER:=0, b NUMBER:=0, c NUMBER:=0
- )
- RETURN NUMBER IS
- BEGIN
- RETURN a+b+c;
- END;
Call FUNCTION add_three_numbers
1. Call functions using location notation
- BEGIN
- dbms_output.put_line(add_three_numbers(2,4,5));
- END;
2. Call a function using the naming notation
- BEGIN
- dbms_output.put_line(add_three_numbers(b=>3, a=>4,c=>2));
- END;
3. Call a function by using location representation and naming notation.
- BEGIN
- dbms_output.put_line(add_three_numbers(3, b=>4,c=>2));
- END;
4. Exclusion notation
- BEGIN
- dbms_output.put_line(add_three_numbers(12,c=>2));
- END;
5. SQL call notation-hybrid notation
- SELECT add_three_numbers(3, b=>4,c=>2) FROM DUAL;
The above content is a description of the five methods for Oracle 11g to call functions. I hope it will help you in this regard.