SQLite - insert or replace (upsert)
저장소/VC++데이터가 있으면 update 하고 없으면 insert 하는 방법을 찾다가 정리한다.
'insert or replace' 에 대한 내용은 아래 링크 참고.
REPLACE
When a UNIQUE constraint violation occurs, the REPLACE algorithm deletes pre-existing rows that are causing the constraint violation prior to inserting or updating the current row and the command continues executing normally. If a NOT NULL constraint violation occurs, the REPLACE conflict resolution replaces the NULL value with the default value for that column, or if the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs, the REPLACE conflict resolution algorithm always works like ABORT.
When the REPLACE conflict resolution strategy deletes rows in order to satisfy a constraint, delete triggers fire if and only if recursive triggers are enabled.
The update hook is not invoked for rows that are deleted by the REPLACE conflict resolution strategy. Nor does REPLACE increment the change counter. The exceptional behaviors defined in this paragraph might change in a future release.
'저장소 > VC++' 카테고리의 다른 글
SQLite - Syntax (0) | 2014.05.27 |
---|---|
SHFileOperation API (RemoveDirectory API 대체 사용) (0) | 2014.04.30 |
윈도우 재배치 깜빡임 줄이기 - DeferWindowPos (0) | 2013.11.19 |
How to use VC_EXTRALEAN and WIN32_LEAN_AND_MEAN to enhance the build process in Visual C++ (0) | 2013.11.19 |
PSAPI 사용 주의 (0) | 2013.11.19 |