How to use MODIFY STATE ? help please
Moderators: chulett, rschirm, roy
How to use MODIFY STATE ? help please
I want to use the modify state to convert varchar 15 to char 14
and convert char 14 to timestampe
But I got warning when convert varchar 15 to 14.
Here is the warning
Conversion; from source type "string[max=15]" to result type "string": Taking substring of variable-length source string
code
source:string=substring[1,14](target)
help please
thanks
and convert char 14 to timestampe
But I got warning when convert varchar 15 to 14.
Here is the warning
Conversion; from source type "string[max=15]" to result type "string": Taking substring of variable-length source string
code
source:string=substring[1,14](target)
help please
thanks
Specify an explicit length of 14 for your new string and the warning will go away.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
targetfield:string[14]=substring[0,14](sourcefield)
Code: Select all
targetfield:nullable string[14]=substring[0,14](sourcefield)
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.
I tried the code but I still have same error msg.ray.wurlod wrote:orCode: Select all
targetfield:string[14]=substring[0,14](sourcefield)
...Code: Select all
targetfield:nullable string[14]=substring[0,14](sourcefield)
Conversion; from source type "string[max=15]" to result type "string[14]": Taking substring of variable-length source string.
Try That will give you a lenght of 14, not 15 as you are currently doing.
Code: Select all
targetfield:string[14]=substring[0,13](sourcefield)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I tried the code but I still have same error msg.ray.wurlod wrote:orCode: Select all
targetfield:string[14]=substring[0,14](sourcefield)
...Code: Select all
targetfield:nullable string[14]=substring[0,14](sourcefield)
Conversion; from source type "string[max=15]" to result type "string[14]": Taking substring of variable-length source string.
tini - did you use 13 instead of 14 as the string end position? How did you declare this new column in your metadata? Somewhere you have specified this as unbounded, which is where the warning is coming from.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
the input column is varchar 15ArndW wrote:tini - did you use 13 instead of 14 as the string end position? How did you declare this new column in your metadata? Somewhere you have specified this as unbounded, which is where the warning is comi ...
and I declared the new column as char 14.
I tried
targetfield:string[14]=substring[0,13](sourcefield)
and I have same warning error.
It looks like you cannot get rid of the message unless your source string is fixed length, I've experimented around a bit. You can always suppress the message from the log and it might be worth submitting the problem to your support provider.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
tini - I used a fixed length CHAR instead of VarChar and the message went away. Or just deprecate the warning message in the log.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
That is very unfortunate. I tested it and don't have the warning.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>