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