Using PL/SQL to create, test Oracle stored Procedures

Source: Internet
Author: User

First select the procedures folder in the left folder and create a new stored procedure, as follows:

Create or Replace procedure Uc_users_amount_pro (endDate in varchar2) is insmember number;  Permember number;  Insmembermon number; Permembermon number;--variable Name table name. Field name%type;--RowType indicates that the type is a row data type, storing a row of data, a row of data can have multiple columns, similar to a row of data in the table, or can be a row of data in the cursor, such as:--Vs_ro W1 Table%rowtype;--VS_ROW2 cursor%rowtype;--cursor cursor name [(parameter in type)] is--Select statement BEGIN SELECT COUNT (*) into INSMEMB Er from uc_users u, uc_form f where u.form_id = f.id and F.FORM_CN = ' Corporate Members ' and U.gmt_create < To_timestam  P (endDate, ' yyyy-mm-dd '); Select COUNT (*) into permember from Uc_users U, uc_form f where u.form_id = f.id and F.FORM_CN = ' individual member ' an  D u.gmt_create < To_timestamp (endDate, ' yyyy-mm-dd ');     Select COUNT (*) into Insmembermon from Uc_users U, uc_form f where u.form_id = f.id and F.FORM_CN = ' Corporate Members '  and To_char (u.gmt_create, ' yyyy-mm ') = To_char (To_timestamp (endDate, ' yyyy-mm-dd '), ' yyyy-mm '); Select COUNT (*) into Permembermon from Uc_users u, uc_forM f Where u.form_id = f.id and F.FORM_CN = ' individual member ' and To_char (u.gmt_create, ' yyyy-mm ') = To_char (to_time  Stamp (endDate, ' yyyy-mm-dd '), ' yyyy-mm '); Dbms_output.put_line (Insmember | | ' ' || Permember | |                       ' ' || Insmembermon | | '' || Permembermon); end Uc_users_amount_pro;
Then right-click on the name of the stored procedure->test


Input parameters


Click, then click on the right side of the single step or directly out of the results, the mouse on the variable name will see the results

Test complete

Using PL/SQL to create, test Oracle stored Procedures

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.