Dynamic SQL of stored procedures in the ORACLE package --- create or replace package test_pkg is g_public_flag varchar2 (1); function test_function (p_param1 varchar2, p_param2 varchar2) return varchar2; function hello_function (p_param3 varchar2) return varchar2; procedure ff (p1 varchar2); end; -- create or replace package body test_pkg is g_private_flag varchar2 (1): = 'y '; function test_function (p_param1 varchar2, p_param2 varchar2) return varchar2 is val varchar2 (10): = 'HELO'; begin dbms_output.put_line ('HELO'); return val; end; function hello_function (p_param3 varchar2) -- The parameters must be consistent with the header. return varchar2 is val varchar2 (10): = 'hello'; begin dbms_output.put_line ('World'); return val; end; procedure ff (p1 varchar2) is flag number; pp1 VARCHAR2 (10): = 'P'; p2 VARCHAR2 (10): = 'P'; p3 VARCHAR2 (10 ): = 'P'; p4 VARCHAR2 (10): = 'P'; begin select count (*) into flag from all_all_tables where table_name = 'logtable1'; dbms_output.put_line (flag ); if (flag = 0) then execute immediate 'create TABLE logtable1 (userid VARCHAR2 (10), logdate VARCHAR2 (10), exception_id VARCHAR2 (10), exception_msg VARCHAR2 (10 ))'; end if; execute immediate 'insert into logtable1 values (: 1,: 2,: 3,: 4) 'using '1', '1', '2 ', '3'; -- can only insert end; ---- test declare begin functions (test_pkg.test_function ('1', '1'); dbms_output.put_line (test_pkg.hello_function ('1 ')); test_pkg.ff ('dd'); end; select * from logtable1; drop table logtable1