Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » ODBC Assertion failed
Re: ODBC Assertion failed [message #55815 is a reply to message #55812] Thu, 17 December 2020 15:06 Go to previous messageGo to previous message
JeyCi is currently offline  JeyCi
Messages: 69
Registered: July 2020
Member
Giorgio wrote on Thu, 17 December 2020 11:01
Violation of PRIMARY KEY

In any case it is the problem that should be solved at Server-side & SQL-statement better... before insertion check for Uniqueness in some Join or take Distinct Group_By - to assure that rows to be inserted are really unique - as PKs ought to be...
If I had a chance to meet some duplication of PKs - I would first make Query for them (with a help of Self-Join), to understand what rows are really problematic & how to correct input data, then make necessary corrections either manually or in code - to have correct data, filtered from duplications, and then try again to insert into DB...
SQL language has pretty enough stuff to deal with such situations - e.g. Triggers...
An attempt to insert 2 identical PKs into DB should be filtered somehow in the Query itself, not in application language... though of course the last is also possible - to check duplications in C++ before Insert Into DB - but it is not very convenient...


Best regards.

[Updated on: Thu, 17 December 2020 15:11]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: OleDBSession in Archive
Next Topic: sqlite3 Custom Function in SqlExp
Goto Forum:
  


Current Time: Wed Jun 25 07:28:01 CEST 2025

Total time taken to generate the page: 0.04540 seconds