getGrpByList() Method

Usage

public java.lang.String getGrpByList( java.lang.String pStart, 
java.lang.String pPattern, 
java.lang.String pSeparator, 
java.lang.String pEnd)

Alternative syntax:

public java.lang.String getGrpByList(
java.lang.String pPattern, 
java.lang.String pSeparator)

Description

Offers a list of occurrences of SQL GROUP BY of an interface.

The pPattern parameter is interpreted, then repeated for each element of the list and separated from its predecessor with the pSeparator parameter. The generated string begins with pStart and ends with pEnd.

This list contains an element for each GROUP BY statement on the source or target (according to the Knowledge Module that used it).

In the alternative syntax, any parameters not set are set to an empty string.

Parameters

Parameter

Type

Description

pStart

String

This parameter marks the beginning of the string to generate.

pMotif

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 is used to separate each pattern from its predecessor.

pEnd

String

This parameter marks the end of the string to be generated.

Pattern Attributes List

The following table lists the different values of the parameters as well as their associated description.

Parameter value

Description

ID

Internal identifier of the clause

EXPRESSION

Text of the grouping statement

Examples

insert into <%=odiRef.getTable("L", "COLL_NAME", "W")%>
select <%=getColList("", "[EXPRESSION]", ", ", "", "INS=1")%>
from <%=odiRef.getFrom()%>
where (1=1)
<%=odiRef.getJoin()%>
<%=odiRef.getFilter()%>
<%=odiRef.getGrpByList("group by ", "[EXPRESSION]", " , ", "")%>

<%=odiRef.getHaving()%>

Explanation: the getGrpByList function will be used to generate the group by clause of the select order that must start with "group by" and that repeats a pattern (each grouping expression) separated by commas   for each expression.