Several common methods of Oracle 11g call function

Source: Internet
Author: User
Tags mixed

1. The function accepts 3 optional parameters, returns 3 digits and

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. Position notation Call function

BEGIN

Dbms_output.put_line (Add_three_numbers (2,4,5));

END;

----2. Named notation Call function

BEGIN

Dbms_output.put_line (Add_three_numbers (b=>3, a=>4,c=>2));

END;

----3. Mixed use positional notation and named notation call functions

BEGIN

Dbms_output.put_line (Add_three_numbers (3, b=>4,c=>2));

END;

----4. Exclude representations

BEGIN

Dbms_output.put_line (Add_three_numbers (12,c=>2));

END;

----5. SQL invocation notation--Mixed notation

SELECT add_three_numbers (3, b=>4,c=>2) from DUAL;

Originating From: http://database.51cto.com/art/201005/198980.htm

Several common methods of Oracle 11g call function

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.