Oracle-Function)

Source: Internet
Author: User

Format: (not in package)

 
Create or replace function function_name (argu1 [mode1] datatype1, argu2 [mode2] datatype2,...) return datatype is
Result varchar2 (50 );
Begin
Return result; end;

Call:

VaR V1 varchar2 (100)

Exec: V1: = function_name;

 

Package:

(With parameters)Function getagentbroker (p_branchid in varchar2,
P_month in varchar2,
P_agentcode in varchar2)
Return nt_test is
V_count smallint default 0;
V_nt_test nt_test;
Begin

Return v_nt_test

End;

(No parameter)Function getagentbroker
Return nt_test is
V_count smallint default 0;
V_nt_test nt_test;
Begin
Return v_nt_test

End;

Note:

1,The method parameter cannot have a value range (test window is the opposite in batch processing), followed by a comma,Type can use the legal type in any oracle.

2,The variable must have a value range followed by a semicolon

3. You cannot create or replace a package.

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.