Closed MikeKutz closed 6 years ago
With "globbing" it could be as simple as
-- template code for "mycompany.tapi.specification"
CREATE OR REPLACE
PACKAGE <%@ include( mycompany.tapi.name ) %>\\n
AS
<%@ include( mycompany.tapi.pldoc ) %>
<%@ include( mycompany.tapi.**.specification ) %>
END;
<%= '/' %>\\n
Which may include all specifications under mycompany.tapi
I would use * instead of % to, so it won't be mistaken with LIKE
expression.
syntax question fo s-oravec Is there a particular reason why you used a double star instead of a single star?
clarification of requirement
In s-oravec's example, should the globing include all specifications
under mycompany.tapi.some.deep.nested.area
also?
I'm thinking: no
*`vs
%** I agree that the usage of
*should be used instead of
%. It should make the
include()syntax easier to read. ( The
%seems to add confusion, for me, when reading within the
<% %>` brackets)
MK
For simplification, I plan on limiting this enhancement to three(3) globbing modes
off
(default) no globbingon
uses the *
character as a wild card; will not span dots( .
). (per @s-oravec recommendation)regexp
will interpret the template name defined in the include
directive as a Regular Expressions.Other limitations
CHR(10)
(but can be set with enhancement #29 )TE_TEMPLATES
will be considered for globbing.MK
I'm adding an additional mode
like
searches for templates using a case insensitive LIKE
conditionThe others are done. I just need to test the regexp
mode and update the README.md
file.
MK
The objective is to include multiple, similarly related templates using one directive command. This feature should only apply to templates stored in TE_TEMPLATES.
Suggested syntax change would allow the use of
%
or*
as a wild card for the include directiveOrder of inclusion would need to be based on the
NAME
of the template. This requirement is needed to insure dependent objects are created in the correct order.Example set of includes:
The enhancement would allow the series of include statements to be simplified to:
This enhancement would also allow the automatic inclusion of new sub-templates. This is useful for quickly adding functions to a Package or UDT.
In turn, a Package specification code can then be simplified to this:
MK