Re: Primary Key Violation Checking

Adrian Klaver <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Monday 29 October 2007 6:32 am, Rich Shepard wrote:
> On Mon, 29 Oct 2007, Rich Shepard wrote:
> >   I'm adding new rows so I'm using INSERT. When data are edited I use
> > INSERT OR UPDATE. Should I use the latter in all cases?
>
>    Sorry. Hadn't reached full caffine titer then. Meant INSERT OR REPLACE.
>
> Rich
No that is not necessary. I was just trying to figure out what was happening.  
As to your original question, I think you are going to have to write your own 
wrap code for the statements. You already have the data you are trying to 
INSERT/UPDATE. In the case of an IntegrityError you would need to run a query 
to collect the info from the database for the affected record.
-- 
Adrian Klaver
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.