执行::
CREATE OR REPLACE PROCEDURE "DYNAMIC_SQL"
(
sqlstatement IN VARCHAR2
)
-- Author:Andy Xie
-- Date:2006-09-06
-- Desc: execute the sql statement
IS
BEGIN
EXECUTE IMMEDIATE sqlstatement;
--EXECUTE IMMEDIATE sqlstatement;
--In case, user doesn't set commit on.
COMMIT;
END DYNAMIC_SQL;
查询:
create or replace procedure DYNAMIC_SELECT_SQL(
sqlstatement IN VARCHAR2,
RC1 OUT globalPkg.RCT1
)
--AUTHID DEFINER
IS
BEGIN
OPEN RC1 FOR sqlstatement;
--EXECUTE IMMEDIATE sqlstatement;
--In case, user doesn't set commit on.
--COMMIT;
end DYNAMIC_SELECT_SQL;