PL/SQL _ Stored Procedure example

Source: Internet
Author: User
Tags stored procedure example

1> write process in PL/SQL, Edit.

Create or replace procedure pro _ ***** (P _ ***** in varchar2, P _ ***** in varchar2, P _ ***** out varchar2) is/* declare */P _ ***** varchar2 (20): = P _ *****; P _ ***** varchar2 (20 ); P _ *** varchar2 (10); begin while p_subject <> '-1' loop select count (*) into p_count from CW. * ** where ** = ***; If p_count = '0' then insert into CW. * *** else update CW. * *** set end if; *****: = P _ *****; end loop; update CW. * *** set *** = ***** | '. '| rownum where ***** = ***** commit; Exception when others then raise_application_error (-20002, 'Pro _ id_scatter_sum, cause:' | sqlcode | ', '| sqlerrm | p_out_result); end;

2>. Java Service

map.put("p_****", map.get("****")+"");map.put("p_****", map.get("****")+"");map.put("p_****", map.get("****")+"");dao.update("****.PRO_****", map);

3> set the in out parameter in. xml

<parameterMap id="PRO_****" class="map" ><parameter property="p_****"   jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/><parameter property="p_****"   jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/><parameter property="p_****"  jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/></parameterMap><procedure id="PRO_****" parameterMap="PRO_****" >     <![CDATA[{ call PRO_****(                ? ,               ? ,               ?)}]]>   </procedure>

4> perform the operation to verify that the end is incorrect...
Put parameters in the class

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.