String to timestamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 2
- Joined: Tue Jun 17, 2008 4:39 pm
String to timestamp
Hi,
Iam using the function
StringToTimestamp(DSLink2.XXXX,"yyyy-mm-dd hh:nn:ss")
DSLink2.XXXX='2005-01-01 12:01:01'(varchar(50))
When i tried to execute above, getting the following error.
Transformer_3,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "yyyy-mm-dd hh:nn:ss" for conversion "timestamp=timestamp_from_string[%yyyy-%mm-%dd %hh:%nn:%ss](string)": APT_Conversion_String_TimeStamp: Invalid Format [yyyy-mm-dd hh:nn:ss] used for string_from_time type conversion.
I looked into forums but could not get exact error posts.
we are having datastage v 7.5.1
Thanks
Iam using the function
StringToTimestamp(DSLink2.XXXX,"yyyy-mm-dd hh:nn:ss")
DSLink2.XXXX='2005-01-01 12:01:01'(varchar(50))
When i tried to execute above, getting the following error.
Transformer_3,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "yyyy-mm-dd hh:nn:ss" for conversion "timestamp=timestamp_from_string[%yyyy-%mm-%dd %hh:%nn:%ss](string)": APT_Conversion_String_TimeStamp: Invalid Format [yyyy-mm-dd hh:nn:ss] used for string_from_time type conversion.
I looked into forums but could not get exact error posts.
we are having datastage v 7.5.1
Thanks
You missed all of the '%' markers:
Code: Select all
StringToTimestamp(DSLink2.XXXX,"%yyyy-%mm-%dd %hh:%nn:%ss")
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 42
- Joined: Mon Apr 21, 2008 1:49 am
I have a question.. I just want to know how this function works internally..
say I have a string
20030707
StringtoTimestamp converts the given string into time. %yyyy%dd%mm says let the first four characters be year. Next two be date and next two be month isnt??
If i dont specify the format what happens..???
say I have a string
20030707
StringtoTimestamp converts the given string into time. %yyyy%dd%mm says let the first four characters be year. Next two be date and next two be month isnt??
If i dont specify the format what happens..???
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
DS manual
keshav0307 wrote:then what will be your command??If i dont specify the format what happens..???
it will fail to convert.
Hi,
does anybody know where I can find a DS manual with the list of available transformation functions, please?
Thanks!
On your pc, the PDF document is titled QualityStageParallel Job Developer Guide.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In the Administrator client you can set default date, time and timestamp formats for the project (and the default decimal placeholder character). It is these that are used if no format string is provided, for better or worse.
The Transformer stage is documented in the Parallel Job Developer's Guide with its functions documented in an Appendix of that manual.
The Transformer stage is documented in the Parallel Job Developer's Guide with its functions documented in an Appendix of that manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.