I created a package and a package body as below:
Create or replace Package pkg_1
as
procedure main(param1 varchar2, param2 varchar2, param3 int);
procedure one(param1 varchar2, param2 varchar2);
procedure two(param1 varchar2, param2 varchar2);
end pkg_1;
/
create or replace package body pkg_1
as
procedure main (param1 varchar2, param2 varchar2, param3 int)
is
v_sql_script varchar2(1000);
begin
case param3
when 1 then
v_sql_script := 'begin exec pkg_1.one(:param1,:param2); end;';
execute immediate v_sql_script using param1, param2;
end case;
end;
Now when I execute the package procedure with following statement:
exec pkg_1.main('p1','p2',1);
I got the following error:
ORA-06550: line 1, column 12:
PLS-00103: Encountered the symbol "PKG_1" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "PKG_1" to continue.
Can someone please suggest me what I have done wrong here?
Thank You.