Except MySQL error

F

Florian Lindner

Hello,
I want to except the error which is raised in MySQLdb module when one is
trying to insert a value in a primary key column which already exists. But
I don't know which error to except...
Thx,
Florian
 
D

Daniel Yoo

: I want to except the error which is raised in MySQLdb module when one is
: trying to insert a value in a primary key column which already exists. But
: I don't know which error to except...


Hi Florian,


According to the Python Database API:

http://www.python.org/peps/pep-0249.html

you can expect a subclass of IntegrityError.


Hope this helps!
 
F

Frithiof Andreas Jensen

Florian Lindner said:
I don't know which error to except...

....Apart from reading the docs, you can try it in idle and read what the
'puter says ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top