Oracle-function exercise, oracle-function

Source: Internet
Author: User

Oracle-function exercise, oracle-function

/** Scm_iss.test_imti_fun2 * Function with input parameters */create or replace function TEST_IMTI_FUN2 (P_NO in number) RETURN VARCHAR2 IS P_IMTI_NAME VARCHAR2 (200); P_IMTI_DESC VARCHAR2 (200 ); p_RETURN VARCHAR2 (200); BEGIN -- select I. IMTI_NAME INTO P_IMTI_NAME FROM SCM_ISS.T_IMTI_TEST I where I. IMTI_NO = P_NO; select I. IMTI_DESC, I. IMTI_NAME INTO P_IMTI_DESC, P_IMTI_NAME FROM SCM_ISS.T_IMTI_TEST I where I. IMTI_NO = P_NO; -- P_IMTI_DESC: = P_IMTI_NAME; P_RETURN: = P_IMTI_NAME | ':' | P_IMTI_DESC; RETURN P_RETURN; exception when others then DBMS_OUTPUT.PUT_LINE ('exception: '| SQLERRM); END TEST_IMTI_FUN2;/** scm_iss.test_imti_fun3 * Function with input and output parameters */create or replace function TEST_IMTI_FUN3 (P_NO in number, P_NAME OUT VARCHAR2) RETURN VARCHAR2 ISBEGIN -- call the Stored Procedure SCM_ISS.TEST_IMTI_PRO3 (P_NO, P_NAME); RETURN P_NAME; END; -- Test Call DECLAREA VARCHAR2 (200 ); -- accept output parameter B VARCHAR2 (200); begin B: = scm_iss.TEST_IMTI_FUN3 (1005, A); dbms_output.put_line ('B value:' | B); dbms_output.put_line ('a value: '| A); END;


 

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.