Where can I find documentation on using the Matches Pattern
I'm using developer's Studio and I used the Expression Builder to do a selection criteria and choose the Matches Pattern option.
I'm trying to find a data in the column that is in this format
999-999999-99
I've tried putting it in as 9's and as #'s. I can't seem to get it to find anything.
I also tried the like statement with the same results.
I can't find anywhere that documents what syntax it needs for the pattern.
January 05, 2007, 11:44 AM
hammo1j
LIKE '___-_____-__' should work _ is wildcard single char in SQL.
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
January 05, 2007, 11:56 AM
Ginny
quote:
LIKE '___-_____-__'
That would give me all of the ones with numerics and alphas. I'm only wanting the one's with alphas
99-999999-99 is what I want, not anything like aa-999aaa-99 etc.
January 05, 2007, 12:14 PM
hammo1j
Doh! yes...
You could use CHKFMT function but this would require testing on wf server rather than DBMS.
WHERE EDIT(FIELD,'9') GE '0' AND EDIT(FIELD,'9') LE '9' AND EDIT(FIELD,'$9') GE '0' AND EDIT(FIELD,'$9') LE '9' AND ... Will translate to server substrs but is extremely cumbersome
Best would be the incorrect where clause to speed up things on the server + CHKFMT.
Can anyone think of anything neater than this?This message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
January 05, 2007, 12:57 PM
Francis Mariani
quote:
That would give me all of the ones with numerics and alphas. I'm only wanting the one's with alphas
99-999999-99 is what I want, not anything like aa-999aaa-99 etc.
From your examples it appears you want the numeric and NOT the alphas.
This may do the trick:
WHERE FLD1 LIKE '%%-%%%%%%-%%' AND FLD1 FROM '00-000000-00' TO '99-999999-99'
This might be enough:
WHERE FLD1 FROM '00-000000-00' TO '99-999999-99'
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 05, 2007, 02:10 PM
hammo1j
Fran
Unfortunately 0A will pass the FROM test.
Think its a good idea tho to use this test with the earlier mask to limit returned from dbms.
WHERE FLD1 FROM '0' TO '9'
Then for strictness sake you will need CHKFMT to weed out the ones that get through.
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo