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]$')

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                                              
             <[EMAIL PROTECTED]>                                             
                                                                        To 
             11/02/2007 01:24          [email protected]         
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         HowTo add parameter to part of      
             [EMAIL PROTECTED]         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



Reply via email to