1 2 3 4 5 6 7 8 | CREATE [OR REPLACE] PROCEDURE procedure_name [(parameter_list)] {IS|AS} [local_declarations] BEGIN executable_statements [EXCEPTION exception_handlers] END [procedure_name]; |
1 | parameter_name1 [in | out | in out] type, parameter_name1 [in | out] type [,........] |
1 2 | outcur OUT BASIC_CURSOR: OPEN outcur FOR SELECT col1,col2 FROM tablename |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | create or replace procedure putNum(P_Date in date, P_year out varchar2) is v_num number(8) := 1; v_days number; v_date date; begin dbms_output.put_line('intput value:' || P_year); v_num := 1; v_days := 1; v_days := to_number(to_char(P_Date, 'dd')); -- to_char(sysdate-20,'dd') for i in 1 .. v_days Loop v_date := to_date('2011/11/' || to_char(i), 'yyyy/MM/dd'); --dbms_output.put_line(v_date); end loop; P_year := '2012'; end; |
1 | [EXECUTE]|[CALL] procedure_name[(parameter,…n)] |
1 2 3 4 | begin Proc_Insert('hello6',25,'2005-12-24'); commit; end; |
1 | DBMS_OUTPUT.put_line ('Hello World!'); |
1 2 | show serveroutput; set serveroutput on; |
1 | select object_name,object_type,status from user_objects where OBJECT_TYPE='PROCEDURE'; |
1 | SELECT text FROM user_source WHERE NAME = 'procedure_name'; |
1 | DROP PROCEDURE procedure_name; |
欢迎光临 度量快速开发平台-专业、快速的软件定制快开平台 (http://plat.delit.cn/) | Powered by Discuz! X3.2 |