Page 1 of 1
Right function with date
Posted: Thu Dec 30, 2010 12:34 am
by halpavan2
Hi All,
I have a small requirment in parallel jobs. I want output to be like this.
2010-12-30 05:50:30.000001 - - - - for first record
2010-12-30 05:50:30.000002 - - - - for second record
I have used the following function in transformer stage but didn't work.
CurrentTimestampMS() :"." :Right(Mod(@INROWNUM,1000), "6'0'R")...i am getting the output like this 2010-12-30 05:01:44.
Can any one help me with this.
You help will be much appreciated.
Regards
Pavan
Posted: Thu Dec 30, 2010 12:57 am
by Sreedhar
Hi,
Option 1: change data type from Date to Varchar
Option 2: At the project level change the Date format to include the Micro seconds
Posted: Thu Dec 30, 2010 6:42 am
by halpavan2
I am using datatype as timestamp(26,6).....but that didn't work...output is coming like this 2010-12-30 05:01:44
But i need the output like this.
2010-12-30 05:50:30.000001 and the last one should be incremented for each new record like below.
2010-12-30 05:50:30.000001
2010-12-30 05:50:30.000002
2010-12-30 05:50:30.000003
2010-12-30 05:50:30.000004
Can any one please help me out
Posted: Thu Dec 30, 2010 6:45 am
by halpavan2
The same function is working in server jobs
Oconv(Date(), "D-YMD[4,2,2]") :" ": Oconv(Time(), "MTS:") :"." :FMT(Mod(@INROWNUM,1000), "6'0'R")
i am using the below function in parallel jobs but no luck
CurrentTimestampMS() :"." :Right(Mod(@INROWNUM,1000), "6'0'R")
Posted: Thu Dec 30, 2010 8:12 am
by css.raghu
While using the @INROWNUM in Transformer this problem may occur because of the partitioning. Try to change the partition.
Posted: Thu Dec 30, 2010 3:59 pm
by ray.wurlod
The "6'0'R" formatting construct only works in BASIC expressions - only works in server jobs or BASIC Transformer stage.
In parallel jobs prefer
Code: Select all
Right("000000":InLink.TheString, 6)
Posted: Thu Dec 30, 2010 11:29 pm
by halpavan2
Hello ray,
As i didn't have a premium aaccount, could you please send me that command which works in parallel jobs. Sorry for troubling.
Thanks
Pavan
Posted: Fri Dec 31, 2010 4:34 am
by halpavan2
Hi,
I resolved the issue with the below function.
CurrentTimestampMS() :"." :Right("000000" : @INROWNUM,6)
Thanks for all who have replied to my query.