> I'm using web.query() for the following, but I want to use web.insert().
> Can one tell me how to do this.
>
> data = {'name':'Erwin','age':38}
> web.query("INSERT INTO my_table (name, age) VALUES ($name, $age)",
> vars=data)
>
> I found no way to use web.insert() using vars=data. I need the Key
> returned by web.insert().

If you need the key returned by web.insert() then why not using
web.insert()?
as for your example:
using web.insert('my_table', name='Erwin', age=38) will return the
last_insert_id()


--~--~---------~--~----~------------~-------~--~----~
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