Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
public class MyCode {
/**
* SqlINstr: Emulate SQL IN operator.
*
*
* {talendTypes} boolean | Boolean
*
* {Category} User Defined
*
* {param} String("value") input: The string need to be printed.
*
* {param} String[] ("value2","value3") pattern: The string array to match at least one.
*
* {example} SqlINstr (String EntryValue, String[] MatchingConditions)
*
*/
public static boolean SqlINstr(String EntryValue, String[] CondSet) {
int cnt = 0;
boolean MatchFound = false;
while (cnt < CondSet.length) {
if (EntryValue.equals(CondSet)) {MatchFound = true;}
cnt++;
}
return MatchFound;
}
/**
* SqlINstr: Emulate SQL IN operator
*
*
* {talendTypes} boolean | Boolean
*
* {Category} User Defined
*
* {param} Integer(1) input: The integer need to be printed.
*
* {param} Integer[] (100, 101) pattern: The integer array to match at least one.
*
* {example} SqlINnum (int EntryValue, int[] MatchingConditions)
*
*/
public static boolean SqlINnum(int EntryValue, int[] CondSet) {
int cnt = 0;
boolean MatchFound = false;
while (cnt < CondSet.length) {
if (EntryValue == CondSet) {MatchFound = true;}
cnt++;
}
return MatchFound;
}
/**
* helloExample: not return value, only print "hello" + message.
*
*
* {talendTypes} String
*
* {Category} User Defined
*
* {param} string("world") input: The string need to be printed.
*
* {example} helloExemple("world") # hello world !.
*/
public static void helloExample(String message) {
if (message == null) {
message = "World"; //$NON-NLS-1$
}
System.out.println("Hello " + message + " !"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
String[] AcrGL = {"DND","DOD","SPD","VAG"};
if (SqlINstr(input_row.acr, AcrGL))
{output_row.saldorsd_gl = input_row.saldorsd;}
String[] AcrGL = {"DND","DOD","SPD","VAG"};
if (Routines.MyCode.SqlINstr(input_row.acr, AcrGL))
{output_row.saldorsd_gl = input_row.saldorsd;}
Hi, I'm having the same problem here...
There is no typo error or case sensitive.
I didn't even write into the code manually.
I added it into the expression filter.
and in expression filter, my method is visible and available.
but when i tried to run the job, it gave me that MyMethod cannot be resolved
I tried to import the class manually too....
Please.... tell me how can I fix this.....
Thanks