Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Except MySQL error (http://www.velocityreviews.com/forums/t332384-except-mysql-error.html)

Florian Lindner 06-21-2004 07:47 PM

Except MySQL error
 
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

Daniel Yoo 06-21-2004 10:09 PM

Re: Except MySQL error
 
Florian Lindner <Florian.Lindner@xgm.de> 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!

Frithiof Andreas Jensen 06-22-2004 11:44 AM

Re: Except MySQL error
 

"Florian Lindner" <Florian.Lindner@xgm.de> wrote in message
news:cb7dum$lfj$06$1@news.t-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 ;-)




All times are GMT. The time now is 03:26 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.