mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-11-15 00:07:08 +01:00
Update POCO library.
This commit is contained in:
1 parent
8d15f4b6e9
commit
233fc103f9
2521 files changed
+257092
-72789
No files matched your search
+10
-10
@@ -38,32 +38,32 @@ int main(int argc, char** argv)
|
||||
|
||||
// drop sample table, if it exists
|
||||
session << "DROP TABLE IF EXISTS Person", now;
|
||||
|
||||
|
||||
// (re)create table
|
||||
session << "CREATE TABLE Person (Name VARCHAR(30), Address VARCHAR, Age INTEGER(3))", now;
|
||||
|
||||
|
||||
// insert some rows
|
||||
Person person =
|
||||
Person person =
|
||||
{
|
||||
"Bart Simpson",
|
||||
"Springfield",
|
||||
12
|
||||
};
|
||||
|
||||
|
||||
Statement insert(session);
|
||||
insert << "INSERT INTO Person VALUES(?, ?, ?)",
|
||||
use(person.name),
|
||||
use(person.address),
|
||||
use(person.age);
|
||||
|
||||
|
||||
insert.execute();
|
||||
|
||||
|
||||
person.name = "Lisa Simpson";
|
||||
person.address = "Springfield";
|
||||
person.age = 10;
|
||||
|
||||
|
||||
insert.execute();
|
||||
|
||||
|
||||
// a simple query
|
||||
Statement select(session);
|
||||
select << "SELECT Name, Address, Age FROM Person",
|
||||
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
|
||||
into(person.address),
|
||||
into(person.age),
|
||||
range(0, 1); // iterate over result set one row at a time
|
||||
|
||||
|
||||
while (!select.done())
|
||||
{
|
||||
select.execute();
|
||||
@@ -83,7 +83,7 @@ int main(int argc, char** argv)
|
||||
session << "SELECT Name FROM Person",
|
||||
into(names),
|
||||
now;
|
||||
|
||||
|
||||
for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); ++it)
|
||||
{
|
||||
std::cout << *it << std::endl;
|
||||
|
||||
Reference in new issue
Block a user