mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-02 03:27:56 +00:00
[Docs Only] Fix a few syntax errors in docs (#2434)
* SQL: Fix a few syntax errors in docs Signed-off-by: Squareys <squareys@googlemail.com> * JSON: Fix code example in Parser.h Signed-off-by: Squareys <squareys@googlemail.com>
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
381b868e77
commit
7c2512eb3b
@@ -193,12 +193,12 @@ It is also possible to combine into and use expressions:
|
||||
Typically, tables will not be so trivial, i.e. they will have more than
|
||||
one column which allows for more than one into/use.
|
||||
|
||||
Lets assume we have a Person table that contains an age, a first and a last name:
|
||||
Let's assume we have a Person table that contains an age, a first and a last name:
|
||||
|
||||
std::string firstName("Peter";
|
||||
std::string firstName("Peter");
|
||||
std::string lastName("Junior");
|
||||
int age = 0;
|
||||
ses << INSERT INTO PERSON VALUES (?, ?, ?)", use(firstName), use(lastName), use(age), now;
|
||||
ses << "INSERT INTO PERSON VALUES (?, ?, ?)", use(firstName), use(lastName), use(age), now;
|
||||
ses << "SELECT (firstname, lastname, age) FROM Person", into(firstName), into(lastName), into(age), now;
|
||||
----
|
||||
|
||||
@@ -215,10 +215,10 @@ first into clause.
|
||||
A common case with databases are optional data fields that can contain NULL.
|
||||
To accommodate for NULL, use the Poco::Nullable template:
|
||||
|
||||
std::string firstName("Peter";
|
||||
std::string firstName("Peter");
|
||||
Poco::Nullable<std::string> lastName("Junior");
|
||||
Poco::Nullable<int> age = 0;
|
||||
ses << INSERT INTO PERSON VALUES (?, ?, ?)", use(firstName), use(lastName), use(age), now;
|
||||
ses << "INSERT INTO PERSON VALUES (?, ?, ?)", use(firstName), use(lastName), use(age), now;
|
||||
ses << "SELECT (firstname, lastname, age) FROM Person", into(firstName), into(lastName), into(age), now;
|
||||
// now you can check if age was null:
|
||||
if (!lastName.isNull()) { ... }
|
||||
|
||||
Reference in New Issue
Block a user