ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heinrich Götzger <goetz...@gmx.de>
Subject Re: HowTo add parameter to part of regex in select
Date Fri, 02 Nov 2007 19:20:50 GMT
Dave,

Dave.Derry@Equifax.com wrote:
> I'm far from being an expert, so I could be *way* off here. But I suspect
> that the quoted string is what's causing problems with the variable
> replacement. Maybe string concatenation would work; something like
> 
> SELECT * FROM table WHERE
>              REGEXP_LIKE (id, '^(' || #id# ||
> ')\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$')
interesting idea, but on a short and quick test, it didn't work out.
This may not be final.

Thanks anyway.

cheers

Heinrich
> 
> Dave
> 
> We must begin not just to act, but to think, for there is no better slave
> than the one who believes his slavery to be freedom, and we are in
> no greater peril than when we cannot see the chains on our minds
> because there are yet no chains on our feet.
> -- Michael Reid
> 
> 
> 
> 
>                                                                            
>              Heinrich Götzger                                              
>              <goetzger@gmx.de>                                             
>                                                                         To 
>              11/02/2007 01:24          user-java@ibatis.apache.org         
>              PM                                                         cc 
>                                                                            
>                                                                    Subject 
>              Please respond to         HowTo add parameter to part of      
>              user-java@ibatis.         regex in select                     
>                 apache.org                                                 
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> Hi,
> 
> is there a possibility to get following to run with iBATIS?
> 
> SELECT * FROM table WHERE
>              REGEXP_LIKE (id,
> '^(#id#)\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$')
> 
> (remark: this is not working)
> 
> or would I need to prepare the regexp in the java-part and use it like:
> 
> SELECT * FROM table WHERE
>              REGEXP_LIKE (id, #id#)
> 
> (remark: this is working)
> 
> Or in other words: can i get iBATIS to only get part of the regex passed
> and add it to the rest of an existing expression or would I need to
> build the complete expression in Java and pass it as a regular
> (string-)parameter to iBATIS-Layer?
> 
> Thanks, cheers
> 
> Heinrich
> 
> 
> 



Mime
View raw message