![]() |
![]() |
|
| Index | Recent Threads | Unanswered Threads | Who's Online | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 3
|
|
| Author |
|
|
Novice USA Joined: Feb 24, 2005 Post Count: 40 Status: Offline |
if i do: matches("c*")the SQL i see is: ... LIKE ? ESCAPE '\' OR THIS.DESCRIPTION LIKE ? ESCAPE '\' :End prepared statement with 2 parameters begin parameter #1: c* :end parameter begin parameter #2: c*shouldn't the parameters have been: c%? note that if i do: matches("c.*")the SQL is (correctly): ... LIKE ? ESCAPE '\' OR THIS.DESCRIPTION LIKE ? ESCAPE '\' :End prepared statement with 2 parameters begin parameter #1: c% :end parameter begin parameter #2: c% :end parameter? thanks. ---------------------------------------- -- jtb |
||
|
|
Expert Belgium Joined: Mar 12, 2004 Post Count: 2991 Status: Offline |
I dont think it's possible to translate c* into SQL LIKE pattern. System.out.println("aaaaaac".matches("a*c")); //true System.out.println("aaaaaac".matches("a.*c")); //true System.out.println("adddddc".matches("a*c")); //false System.out.println("adddddc".matches("a.*c")); //true You can raise a bug ---------------------------------------- Erik Bengtson ![]() |
||
|
|
Novice USA Joined: Feb 24, 2005 Post Count: 40 Status: Offline |
hi eric, thanks. the spec says: applies to String type; only the following regular expression patterns are required to be supported and are portable: global “(?i)” for case-insensitive matches; and “.” and “.*” for wild card matches. The pattern passed to matches must be a literal or parameter. so it sounds like this is not a bug ... that it is user error :) ---------------------------------------- -- jtb |
||
|
|
|
|
|
Current timezone is GMT May 17, 2012 11:26:40 AM |