public java.lang.String getPKColList( java.lang.String pStart,
java.lang.String pPattern,
java.lang.String pSeparator,
java.lang.String pEnd)
Offers a list of columns and expressions for the primary key being checked.
The pPattern parameter is interpreted and then repeated for each element of the list. It is separated from its predecessor by the pSeparator parameter. The generated string starts with pStart and ends with pEnd.
This list contains an element for each column of the current primary key. It is accessible from a Check Knowledge Module if the current task is tagged as an "primary key".
In an action, this method returns the list of the columns of the primary key handled by the DDL command, ordered by their position in the key.
Parameters |
Type |
Description |
---|---|---|
pStart |
String |
This sequence marks the beginning of the string to generate. |
pPattern |
String |
The pattern is repeated for each occurrence in the list. The list of attributes that can be used in a pattern is detailed in the table « Pattern Attributes List » Each attribute occurrence in the pattern sequence is replaced 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 sequence marks the end of the string to generate. |
The following table lists the different values of the parameters as well as their associated description.
Parameter value |
Description |
---|---|
I_COL |
Column internal identifier |
COL_NAME |
Name of the key column |
COL_HEADING |
Header of the key column |
COL_DESC |
Column description |
POS |
Position of the column |
LONGC |
Length (Precision) of the column |
SCALE |
Scale of the column |
FILE_POS |
Beginning position of the column (fixed file) |
BYTES |
Number of physical bytes of the column |
FILE_END_POS |
End of the column (FILE_POS + BYTES) |
IND_WRITE |
Write right flag of the column |
COL_MANDATORY |
Mandatory character of the column (0: null authorized, 1: non null) |
CHECK_FLOW |
Flow control flag for of the column (0: do not check, 1: check) |
CHECK_STAT |
Static control flag of the column (0: do not check, 1: check) |
COL_FORMAT |
Logical format of the column |
COL_DEC_SEP |
Decimal symbol for the column |
REC_CODE_LIST |
List of the record codes retained for the column |
COL_NULL_IF_ERR |
Processing flag for the column (0 = Reject, 1 = Set active trace to null , 2= Set inactive trace to null) |
DEF_VALUE |
Default value for the column |
EXPRESSION |
Not used |
CX_COL_NAME |
Not used |
ALIAS_SEP |
Grouping symbol used for the alias (from the technology) |
SOURCE_DT |
Code of the column's datatype. |
SOURCE_CRE_DT |
Create table syntax for the column's datatype. |
SOURCE_WRI_DT |
Create table syntax for the column's writable datatype. |
DEST_DT |
Code of the column's datatype converted to a datatype on the target technology. |
DEST_CRE_DT |
Create table syntax for the column's datatype converted to a datatype on the target technology. |
DEST_WRI_DT |
Create table syntax for the column's writable datatype converted to a datatype on the target technology. |
SCD_COL_TYPE |
Behavior defined for the Slowly Changing Dimensions for this column in the data model. |
<flexfield code> |
Flexfield value for the current column. |
If the CUSTOMER table has an primary key PK_CUSTOMER (CUST_ID, CUST_NAME)
and you want to generate the following code:
create table T_PK_CUSTOMER (CUST_ID numeric(10) not null, CUST_NAME varchar(50)
not null)
you just have to write:
create table T_<%=odiRef.getPK("KEY_NAME")%> <%=odiRef.getPKColList("(",
"[COL_NAME] [DEST_CRE_DT] not null", ", ", ")")%>
Explanation: the getPKColList function will be used to generate the part (CUST_ID numeric(10) not null, CUST_NAME varchar(50) not null),which starts and stops with a parenthesis and repeats the pattern (column, a data type, and not null) separated by commas for each column of the primary key. Thus
the first parameter "(" of the function indicates that we want to start the string with the string "("
the second parameter "[COL_NAME] [DEST_CRE_DT] not null" indicates that we want to repeat this pattern for each column of the primary key . The keywords [COL_NAME] and [DEST_CRE_DT] reference valid keywords of the Pattern Attributes List table
the third parameter ", " indicates that we want to separate interpreted occurrences of the pattern with the string ", "
the forth parameter ")" of the function indicates that we want to end the string with the string ")"