On Fri, 19 May 2006 14:47:10 +0200,
Julien ARNOUX <[EMAIL PROTECTED]> wrote:
> cur.execute("select foo from test where foo regex 'aa.[0-9])")
> and the error is:
> cur.execute('select foo from test where foo regex tata')
> apsw.SQLError: SQLError: near "regex": syntax error
I think you're missing a closing quote on that regex; or perhaps that's
an extra closing parenthesis at the end.
Also, it's probably best to let the database module do any escaping you
may need. For example:
fooregex = r'aa.[0-9]'
sql = 'select foo from test where foo regex %s'
cur.execute( sql, tuple( fooregex ) )
See the DP API spec for more information.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list