15 Jan
2002
15 Jan
'02
8:32 a.m.
Joe Block wrote:
I'm probably missing something in postgresql where I can do an insert and have it return whatever jobid it automatically generates. On the Zope side, I'm using ZPsycoPg as my postgres connection.
I'm almost sure you can have this unique ID generated by postgresql. In mysql you can, so... When you have an index field defined as unique in your sql db (eventually auto increment), the db will take care of id uniqueness for you. Imho it's safer than handling this on your own. The second step is to find a way to get the latest inserted row in your table, and get the unique Id from there. I have no idea how you do this in zope (maybe the zsql method returns the unique id on exec?) Good luck ! Philippe