Except MySQL error

Discussion in 'Python' started by Florian Lindner, Jun 21, 2004.

  1. 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
    Florian Lindner, Jun 21, 2004
    #1
    1. Advertising

  2. Florian Lindner

    Daniel Yoo Guest

    Florian Lindner <> 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!
    Daniel Yoo, Jun 21, 2004
    #2
    1. Advertising

  3. "Florian Lindner" <> wrote in message
    news:cb7dum$lfj$06$-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 ;-)
    Frithiof Andreas Jensen, Jun 22, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Salerno
    Replies:
    20
    Views:
    843
    John Salerno
    Aug 11, 2006
  2. Fabio Z Tessitore

    who is simpler? try/except/else or try/except

    Fabio Z Tessitore, Aug 12, 2007, in forum: Python
    Replies:
    5
    Views:
    367
  3. David House

    try -> except -> else -> except?

    David House, Jul 6, 2009, in forum: Python
    Replies:
    2
    Views:
    332
    Bruno Desthuilliers
    Jul 6, 2009
  4. Peng Yu
    Replies:
    1
    Views:
    512
    Steven D'Aprano
    Nov 18, 2009
  5. MRAB
    Replies:
    0
    Views:
    819
Loading...

Share This Page