Sample Data: In source schema we have a field PRODUCT_CODE.
PRODUCT_CODE
---------------------------
prod01
prod02
prod03
prod04
prod02
prod04
PRODUCT_CODE
---------------------------
prod01
prod02
prod03
prod04
prod02
prod04
In above image note the row count to memorize is set to 2. It means this component will memorize 2 rows.
tJavaRow code:
String s="";
if(PRODUCT_CODE_tMemorizeRows_1[0].equals(PRODUCT_CODE_tMemorizeRows_1[1]))
{
s=PRODUCT_CODE_tMemorizeRows_1[0];
System.out.println("OUTPUT...");
System.out.println(s);
}
String s="";
if(PRODUCT_CODE_tMemorizeRows_1[0].equals(PRODUCT_CODE_tMemorizeRows_1[1]))
{
s=PRODUCT_CODE_tMemorizeRows_1[0];
System.out.println("OUTPUT...");
System.out.println(s);
}
PRODUCT_CODE_tMemorizeRows_1[0] will give you first index value.
Note: tMemorizeRows_1 perpend the column name.
Final Output:
OUTPUT...
prod02
OUTPUT...
prod04
OUTPUT...
prod02
OUTPUT...
prod04
Very simple and nice example!
ReplyDelete