On Aug 19, 2007, at 1:41 PM, Raphael Lullis wrote:

>
> Hi, all.
>
> I'm trying to build a query using the LIKE operator. I'm using
> PostgreSQL 8.1, web.py, python2.4, all in windows.
>
> If I do something like this:
>
> web.query("SELECT * FROM foo WHERE bar LIKE 'test%'")
>
> I get an exception in line 338 from db.py
>
> out = cur.execute(sql_query.s, sql_query.v)
> IndexError: tuple index out of range

I don't know this for certain, but possibly the problem
is the stray '%'.  If you use '%%' instead and it clears
up, then that was the problem.  ('%%' is the string
substitution for a literal '%', where otherwise '%' begins
a substitution point).

--
Randall Randall <[EMAIL PROTECTED]>
"Hey, Mr. Record Man, your system can't compete;
  It's the new artist model: File Transfer Complete..."
  - MC Lars, "Download This Song"



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to