[Zope-DB] Duplicate Insert

Andy Yates andy at nnu.com
Fri May 20 11:54:13 EDT 2005


What is the proper way to trap a duplicate insert.

I'm using Z MySQL.

 

try:

  context.duptest_qry()

except Exception, v:

  if v[0]==1062 :

    print "Duplicate Insert"

 

I've tried this but Zope will not let me access v[0] which is set to
1062 on dups.

 

Thanks!

 

Andy

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20050520/8a90907c/attachment.htm


More information about the Zope-DB mailing list