on 05-09-2007 9:49 PM
Hi @ll
I have an source and target data type in which there is a field which is of xsd:date type. I mapped both of them using date transformation... In the transformation, the source has MM/dd/yyyy format which is transformed into yyyy-mm-dd format...
Every things well when the input are correct.... but when i give the wrong input date like 123/34/2007 or some others...it does not throwing any errors...just converts source into target format with some garbage values...
I changed the source and target field to string type with the same transformation..but even then same thing happens...
Can any one explain what's going on here..where i am making the mistake...
thanks
Hi there,
See this post:
User defined function to validate the input.
Something like (from the above post, by jithesh balakrishnan):
Date dtobj = new Date(strgDate); //convert the string into date object.
Format formatter = new SimpleDateFormat("yyyy/MM/dd"); //specify the required format.
formatter.format(dtobj); //format ur date
return dtobj;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
had exp this earlier and here the date transformation will not throw any error. u may use a udf to check for valid date and inside the udf u an raise an exception
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.