on 11-02-2015 5:41 AM
Hi Experts,
I have a requirement in which i need to post the data from a particular character count.
For e.g.:
If the input is like :
distributed update operation failed; rollback required.Invoice date in the future is not allowed at COALXL.WATCH_STL_INVOICE_HDR, line 245 error during execution of trigger 'COALXL.WATCH_STL_INVOICE_HDR' at line 8.
Than i need to send the output like
COALXL.WATCH_STL_INVOICE_HDR, line 245 error during execution of trigger 'COALXL.WATCH_STL_INVOICE_HDR' at line 8.
Means it should truncated from a fixed position and then till the end.
Can you please suggest how can we do this?
Regards,
CB
Yes I understand... But that would hardly effect... because it is failing to calculate the length ... at that node only ... please correct me if am wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try this UDF
public String udf_SubString(String in, int start, int end, Container container) throws StreamTransformationException {
int len = in.length();
if (len < start) {
in = "";
} else if (len < end) {
in = in.substring(start, len);
} else {
in = in.substring(start, end);
}
return in;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.