on 02-26-2007 5:29 PM
Dear All,
I have a message mapping that I need to add the current time with a integer field, moving to a time field into target message.
Does anybody have idea how to do this,
Regards,
Fernando
u have date transformation node in mapping. make use of it (here u can get the time alone) and pass this as an input to a udf which also has another input integer. inside udf perform a add function and return the string,...u might need a typecast inside udf else it might throw a dump
Message was edited by:
Prabhu S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
TransformDate
(yyyy-mm-ddHH:MM:SS --> HH:MM:SS) -----
|
|----UDF-----Target
Integer(source)------------------------
the above is the graphical part and insied the udf we can write more optimized code...since i dont have NWDS i'm unable to provide u the code...will keep u posted on this
Message was edited by:
Prabhu S
hi
chcek wif this work:
StringTokenizer sTok = new StringTokenizer(STRG, ":");
int hr = Integer.parseInt(sTok.nextToken());
int min = Integer.parseInt(sTok.nextToken());
int sec = Integer.parseInt(sTok.nextToken());
GregorianCalendar today = new GregorianCalendar();
GregorianCalendar gc =
new GregorianCalendar(
today.get(GregorianCalendar.YEAR),
today.get(GregorianCalendar.MONTH),
today.get(GregorianCalendar.DAY_OF_MONTH),
hr,
min,
sec);
gc.add(GregorianCalendar.SECOND, Integer.parseInt(INTE));
return gc.getTime();
Hi,
in graphical mapping, take the output of UDF and currentDate nodes to concat fnc and take is output to target. just double-click currentDate and give your date format.
UDF -
>
,,,,,,,,,,,,,,,,, concat-------> target
currntDate------>
Thanks,
Rajeev Gupta
Message was edited by:
RAJEEV GUPTA
Message was edited by:
RAJEEV GUPTA
Message was edited by:
RAJEEV GUPTA
Hi,
I did what you said, but did not work.
It returned "Tru Mar 01 02:24:21 UTC 20072007-03-01"
Tru Mar 01 02:24:21 UTC 2007 is the result of UDF and 2007-03-01 is the current date.
I need to convert the "Tru Mar 01 02:24:21 UTC 20072007-03-01" to "2007-03-01"
Thank's a lot for your help.
Fernando
Hi,
<i>I need to convert the "Tru Mar 01 02:24:21 UTC 20072007-03-01" to "2007-03-01"</i> - for this just use currentDate fnc and double click it ....give target format yyyy-MM-dd and you will get it.......
If you want to convert the "Tru Mar 01 02:24:21 UTC 20072007-03-01" to "Tru Mar 01 02:24:21 UTC 2007-03-01" then do below:
choose currentDate and double click it ....give target format -MM-dd and concat UDF with currentDate and then you will get it.....
Thanks,
Rajeev Gupta
Hi,
I used concatenate function with "Tru Mar 01 02:24:21 UTC 2007" and Current Date.
It returned "Tru Mar 01 02:24:21 UTC 20072007-03-01"
The string "Tru Mar 01 02:24:21 UTC 2007" is the result of UDF.
I need to convert the String "Tru Mar 01 02:24:21 UTC 2007" to "2007-03-01"
Is it possible to use only a graphical mapping to do this?
If it's impossible to use only a graphical mapping and I have to need to change UDF can you help me how to do this?
Best Regards.
Fernando
Hi,
I had already tried to do this way but I coundn't use TransformDate Funcion, because I can define the target format but I can't define the souuce format who is the string "Tru Mar 01 02:24:21 UTC 2007".
How can I use the TransformDate function with the source date with the format:
"Tru Mar 01 02:24:21 UTC 2007"?
Best Regards
Fernando
Consultor,
used concatenate function with "Tru Mar 01 02:24:21 UTC 2007" and Current Date.
It returned "Tru Mar 01 02:24:21 UTC 20072007-03-01"
when you use current date pass this input to date conversion and in date conversion use -mm-DD only and concat this with our UDF i.e.
Tru Mar 01 02:24:21 UTC 2007 which should give
Tru Mar 01 02:24:21 UTC 2007-03-01
Regards
Sreeram.G.Reddy
Hi,
<i> I need to add the current time with a integer field</i> - what is your req....can you explain in more detail with an example.... then i may be able to help you.
Thanks,
Rajeev Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just date Function standard function provided by XI and concat the date with the integer and send it to target. for conaction use concat function provded by XI
Regards
Sreeram.G.Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.