Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
RSS cloud
Jump to:

Error printing column values from table query

1 of 419 articles shown, currently no other people reading this forum.
From: Timothy F.
Date: Mon 25th May 2020, 5:02pm



> When I try to print values from a column "s" in a table "statement" by iterating over a Session.Query object returned by Session.query(statement), I get the following 
> "(sqlite3.IntegrityError) UNIQUE constraint failed: statement.s
>  [SQL: INSERT INTO statement (s) VALUES (?)]
>  [parameters: ('Test statement.',)]
>  (Background on this error at: http://sqlalche.me/e/gkpj)"
> Does anyone know what's causing this error?

Normally this hapens when you insert something into the database when it's primary key already exists.

Happens a lot when your tests crash and teardown doesn't happen.

Related articles

Error printing column values from table query (all 3) RSS
├─ original   Mon 25th May 2020, 2:06pm, ANONYMOUS
├─ reply 1   Mon 25th May 2020, 3:49pm, Haolin W.
└─ THIS   Mon 25th May 2020, 5:02pm, Timothy F.
This Page

Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020