public java.lang.String getSrcTablesList( java.lang.String pStart,
java.lang.String pPattern,
java.lang.String pSeparator,
java.lang.String pEnd)
Alternative syntax:
public java.lang.String getSrcTablesList(
java.lang.String pPattern,
java.lang.String pSeparator)
Offers a list of source tables of an interface. This method can be used to build a FROM clause in a SELECT order. However, it is advised to use the getFrom() method instead.
The pPattern pattern is interpreted and then repeated for each element of the list and separated from its predecessor with the parameter pSeparator. The generated string begins with pStart and ends with pEnd.
In the alternative syntax, any parameters not set are set to an empty string.
Parameter |
Type |
Description |
---|---|---|
pStart |
String |
This parameter marks the beginning of the string to generate. |
pPattern |
String |
The pattern is repeated for each occurrence in the list. The list of possible attributes in a pattern is detailed in the table « Pattern Attributes List » Each attribute occurrence in the pattern string is substituted with its value. The attributes must be between brackets ([ and ]) Example « My string [COL_NAME] is a column » |
pSeparator |
String |
This parameter separates each pattern from its predecessor. |
pEnd |
String |
This parameter marks the end of the string to generate. |
The following table lists the different values of the parameters as well as the associated description.
Attribute |
Description |
---|---|
I_TABLE |
odi internal number of the current source table if available. |
MODEL_NAME |
Name of the model of the current source table, if available. |
SUB_MODEL_NAME |
Name of the sub-model of the current source table, if available |
TECHNO_NAME |
Name of the technology of the source datastore |
LSCHEMA_NAME |
Logical schema of the source table |
TABLE_NAME |
Logical name of the source datastore |
RES_NAME |
Physical access name of the resource (file name or
JMS queue, physical name of the table, etc.). |
CATALOG |
Catalog of the source datastore (resolved at runtime) |
WORK_CATALOG |
Work catalog of the source datastore |
SCHEMA |
Schema of the source datastore (resolved at runtime) |
WORK_SCHEMA |
Work schema of the source datastore |
TABLE_ALIAS |
Alias of the datastore as it appears in the tables list, if available |
POP_TAB_ALIAS |
Alias of the datastore as it appears in the current interface, if available. |
TABLE_TYPE |
Type of the datastore source, if available. |
DESCRIPTION |
Description of the source datastore, if available. |
R_COUNT |
Number of records of the source datastore,if available. |
FILE_FORMAT |
File format, if available. |
FILE_SEP_FIELD |
Field separator (file) |
XFILE_SEP_FIELD |
Hexadecimal field separator (file) |
SFILE_SEP_FIELD |
Field separator string (file) |
FILE_ENC_FIELD |
Field beginning and ending character (file) |
FILE_SEP_ROW |
Record separator (file) |
XFILE_SEP_ROW |
Hexadecimal record separator (file) |
SFILE_SEP_ROW |
Record separator string (file) |
FILE_FIRST_ROW |
Number of header lines to ignore, if available. |
FILE_DEC_SEP |
Default decimal separator for the datastore, if available. |
METADATA |
Description in odi format of the metadata of the current resource, if available. |
OLAP_TYPE |
OLAP type specified in the datastore definition |
IND_JRN |
Flag indicating that the datastore is including in CDC. |
JRN_ORDER |
Order of the datastore in the CDC set for consistent journalizing. |
<flexfield code> |
Flexfield value for the current table. |
insert into <%=odiRef.getTable("L", "COLL_NAME",
"W")%>
select <%=odiRef.getColList("", "[EXPRESSION]",
", ", "", "INS=1")%>
from <%=odiRef.getSrcTablesList("", "[CATALOG].[SCHEMA].[TABLE_NAME]
as [POP_TAB_ALIAS]", ", ", "")%>
where (1=1)
<%=odiRef.getJoinList("and ","([EXPRESSION])","
and ","")%>
<%=odiRef.getFilterList("and ","([EXPRESSION])","
and ","")%>
<%=odiRef.getGrpBy()%>
<%=odiRef.getHaving()%>
Explanation: the getSrcTablesList function will be used to generate the FROM clause of the SELECT STATEMENT that repeats the pattern (CATALOG.SCHEMA.TABLE_NAME as POP_TAB_ALIAS) separated by commas for each table in source.
The first parameter "" of the function indicates that we want do not want to start the string with any specific character.
The second parameter "[CATALOG].[SCHEMA].[TABLE_NAME] as [POP_TAB_ALIAS]" indicates that we want to repeat this pattern for each source table. The keywords [CATALOG], [SCHEMA], [TABLE_NAME] and [POP_TAB_ALIAS] reference valid keywords of the table Pattern Attributes List
The third parameter" , " indicates that we want to separate each interpreted occurrence of the pattern with the string ", "
The fourth parameter "" of the function indicates that we want to end the string with no specific character