Hi,
Can we filter a record where the length of a particular field id >5.
I have used Len(EMP_ID)>5 in the where condition but I am getting error.
Regards
Arnie
Filter a records
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not permissible in a Filter stage. SQL functions are not supported. You need to use a Transformer stage either to do the filtering or to generate an actual length number that you can use in a downstream Filter stage. Or use string_length() or ustring_length() - as appropriate - in an upstream Modify stage.
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.
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
Re: Filter a records
Yes. You can do this in a transformer by putting the appropriate constraint.arnie_nits wrote:Hi,
Can we filter a record where the length of a particular field id >5.
Len(EMP_ID) in the where condition?arnie_nits wrote: I have used Len(EMP_ID)>5 in the where condition but I am getting error.
Len() is a datastage function and not an SQL function, so, if you are trying to run a query with this it won't work. The function to find length in SQL is Length().
If you are not using it in SQL then where are you using this function and what error are you getting?
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
Oh, so lousy of me
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>