I started working on the oddgen project. The goal is to support several template languages, one of them is tePLSQL.
I've tried to include a template using <%@ include(templ, my_package, package_body, demo) %>. This was not working for several reasons:
There is a typo in tePLSQL.pkb on line 532 (l_object_type instead of l_schema).
dbms_metadata.get_ddl fails when called from another user, because dbms_metadata requires the SELECT_CATALOG_ROLE which is not visible in a definer rights package.
The first problem is easy to fix ;-). For the second one I see the following options:
from 12.1 on you may grant the role to the package directly, e.g. GRANT select_catalog_role TO PACKAGE teplsql.teplsql;. This was my solution.
to support older Oracle versions you may switch to invoker rights or you may access the dba_source view directly
Hello Oscar,
I started working on the oddgen project. The goal is to support several template languages, one of them is tePLSQL.
I've tried to include a template using
<%@ include(templ, my_package, package_body, demo) %>
. This was not working for several reasons:l_object_type
instead ofl_schema
).The first problem is easy to fix ;-). For the second one I see the following options:
GRANT select_catalog_role TO PACKAGE teplsql.teplsql;
. This was my solution.Thanks.
Best Regards, Philipp