日期:2014-05-17 浏览次数:21028 次
create or replace procedure test_select as select * from test_table t where t.subsystem_id = 4
exec test_select
create or replace procedure test_select as begin --select * from test_table t where t.subsystem_id = 4 dbms_system.output_line('this is my first proc in oracle !'); end
------解决方案--------------------
举个例子如下:
CREATE OR REPLACE PROCEDURE secure_dml
IS
BEGIN
IF TO_CHAR (SYSDATE, 'HH24:MI') NOT BETWEEN '08:00' AND '18:00'
OR TO_CHAR (SYSDATE, 'DY') IN ('SAT', 'SUN') THEN
RAISE_APPLICATION_ERROR (-20205,
'You may only make changes during normal office hours');
END IF;
END secure_dml;
------解决方案--------------------
oracle的存储过程是不支持简单的select ... from...输出结果集的,不同于sql server
------解决方案--------------------