/
auroraos
/
mirror_sqlite3pp
Обзор
Документация
Войти
/
auroraos
/
mirror_sqlite3pp
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
master
test/testinsertall.cpp
30 строк
641 B
Wongoo Lee
Uses 'copy' copy semantic when binder operator is used to bind string args.
09 фев 2016, 19:35
09 фев 2016, 19:35
b771065
Код
Авторство
О чём код?
#include <iostream> #include "sqlite3pp.h" using namespace std; int main() { try { sqlite3pp::database db("test.db"); { sqlite3pp::transaction xct(db); { sqlite3pp::command cmd(db, "INSERT INTO contacts (name, phone) VALUES (:name, '1234');" "INSERT INTO contacts (name, phone) VALUES (:name, '5678');" "INSERT INTO contacts (name, phone) VALUES (:name, '9012');" ); { cout << cmd.bind(":name", "user", sqlite3pp::copy) << endl; cout << cmd.execute_all() << endl; } } xct.commit(); } } catch (exception& ex) { cout << ex.what() << endl; } }