Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Except MySQL error

Reply
Thread Tools

Except MySQL error

 
 
Florian Lindner
Guest
Posts: n/a
 
      06-21-2004
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
 
Reply With Quote
 
 
 
 
Daniel Yoo
Guest
Posts: n/a
 
      06-21-2004
Florian Lindner <(E-Mail Removed)> wrote:

: 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!
 
Reply With Quote
 
 
 
 
Frithiof Andreas Jensen
Guest
Posts: n/a
 
      06-22-2004

"Florian Lindner" <(E-Mail Removed)> wrote in message
news:cb7dum$lfj$06$(E-Mail Removed)-online.com...
>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: What is the difference between 'except IOError as e:' and 'except MRAB Python 0 11-18-2009 02:52 AM
What is the difference between 'except IOError as e:' and 'except Peng Yu Python 1 11-18-2009 02:38 AM
try -> except -> else -> except? David House Python 2 07-06-2009 05:48 PM
who is simpler? try/except/else or try/except Fabio Z Tessitore Python 5 08-13-2007 12:52 AM
converting a nested try/except statement into try/except/else John Salerno Python 20 08-11-2006 02:48 PM



Advertisments