Do a select statement on the values

> > i just use this code:
> > cursor = connection.cursor()
> > sql = "insert into popo_status( author_id , body , time, type ) VALUES
> > (%s, %s, now(), '2')"
> > cursor.execute( sql,(str(row[0]),msg) )
cursor.execute("select id from popo_status where author_id = '%s' and
body = '%s' and type='%s'")
print cursor.fetchone()[0]
> > connection.commit()

That should do it, if author_id,body and type are not enough to
distinguish the record you will have to muck with the datetime stuff.
Im not sure what module you are using, but some return the ids from an
insert statement upon execution. like when you do this
> > cursor.execute( sql,(str(row[0]),msg) )


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to