Oracle function creation and invocation

Source: Internet
Author: User

definition of the function:

CREATE OR REPLACE FUNCTIONFunction_test (PARAMER1inch VARCHAR,--the type of the parameter does not write length PARAMER2 outVARCHAR, PARAMER3inch VARCHAR) RETURN VARCHAR--function to write return value
As--Indicates the beginning of the function bodyPARAMER4VARCHAR( +); --Define internal parameters PARAMER5VARCHAR( +);BEGINPARAMER4:=CONCAT (PARAMER1, PARAMER3); --the assignment symbol is: = PARAMER5:=CONCAT (PARAMER3, PARAMER1); PARAMER2:=CONCAT (PARAMER4, PARAMER5); RETURN 'SUCCESS';End [Function_test]; --the function name after end can be omitted
Execute code: SQL> varPARAMER2varchar2SQL> varYvarchar2SQL> exec: Y:=Function_test ('123',:P ARAMER2,'ASD'); Results: PL/Sqlproceduresuccessfully completedy---------SUCCESSPARAMER2---------123

Oracle function creation and invocation

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.