Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
My requirement is to load data from excel to oracle table which satisfies the condition written in tmap expression filter and I'm storing the rejected records in one file.
For example: In excel file which contains following records
VendorName,Type,Payment
John,Credits,10.23
Richard,credits,10.23
Maddy,credits,12.45
ABCD,Debit,12.87
cdef,debit,14.65
Expected output:
vendorname(varchar),Type(varchar),Payment(bigdecimal)
VendorName,Type,Payment
John,Credits,10.23
Richard,credits,10.23
Rejected records are :
Maddy,credits,12.45
ABCD,Debit,12.87
cdef,debit,14.65
The condition in tmap expression filter:
row1.Type.equals("Credits") && row1.payment == BigDecimal.valueOf(10.23)
In my case, its works fine for the single condition that is row1.Type.equals("Credits") and All the records gets rejected for this condition row1.Type.equals("Credits") && row1.payment == BigDecimal.valueOf(10.23).
row1.Type.equals("Credits") && row1.payment == BigDecimal.valueOf(10.23).
can anyone help me out to resolve this issues?
Hi,
Try to compare using:
row1.Type.equalsIgnoreCase("Credits") && row1.payment.compareTo(BigDecimal.valueOf(10.23)) == 0
Hope this helps.
Hi,
Try to compare using:
row1.Type.equalsIgnoreCase("Credits") && row1.payment.compareTo(BigDecimal.valueOf(10.23)) == 0
Hope this helps.
Hi,
I looks a bit like it could be down to logic formatting.
So you're using:
row1.Type.equals("Credits") && row1.payment == BigDecimal.valueOf(10.23)
But what you really mean is:
Type must equal credits AND payment must equal 10.23
The problem is, it will be reading the query as:
Type equals credits and payment EQUALS 10.23
It's worth separating the key conditions like so, and giving that a bash:
row1.Type.equals("Credits") && (row1.payment == BigDecimal.valueOf(10.23))
@TRF is correct so long as your payment column is a BigDecimal
Hello @TRF,
Thank you so much.
The below code works fine.
row1.Type.equalsIgnoreCase("Credits") && row1.payment.compareTo(BigDecimal.valueOf(10.23)) == 0
I need a clarification to restrict data for Integer,float and date syntax
Hi,
For Date values I'm using below code
row1.CREATION_DATE.after(TalendDate.parseDate("MM/dd/yyyy","05/17/2017"))
its working fine.
My question is how to specify some date, something like I should retrieve the record which is on 05/14/2017.
I don't want to mention "after and before " keyword I just want to specify exact date.
Is this possible?