[Tutor] Finding out what causes the crash

Magnus Lycka magnus@thinkware.se
Tue Feb 4 12:04:02 2003


At 16:32 2003-02-04 +0100, Charlie Clark wrote:
>print count,"Arztkammer %s, PT-Kammer %s, KV %s, KV-Nr %s, PT-Nr %s"
>%(id_arztkammer, id_pt_kammer, id_kv, kv_nr, pt_nr)
>mycursor.execute('INSERT into therapist (id_person, id_arztkammer,
>id_pt_kammer, id_kv, pt_nr, kv_nr)\
>                           VALUES (%s, %s, %s, %s, %s, %s)', \
>                         (id_person, id_arztkammer, id_pt_kammer, id_kv,
>pt_nr, kv_nr) )
>
>I'm not the world's best DB-programmer but this looks okay to me and it
>doesn't cause syntax errors in Python or PostgreSQL.

Well, there are other errors besides Syntax Errors...

Does this line get executed successfully with other data,
or do they all fail?

>One of the offending lines is:
>Arztkammer None, PT-Kammer None, KV 20, KV-Nr 6121101, PT-Nr None

Are types correct for all values? is there a problem with
None/NULL? In what way are the bad different from the lines
you managed to insert?

Do I understand correctly that this just causes a windows applcation
crash? No Python traceback etc? This suggests that the crash happens
in code written in C or C++, in your database module.

Maybe you should ask on a mailing list for your database driver, or
on the db-sig mailing list?


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se