Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members

# mysqlpp::SQLParseElement Struct Reference

Used within SQLQuery to hold elements for parameterized queries. More...

`#include <sql_query.h>`

Collaboration diagram for mysqlpp::SQLParseElement:

[legend]
List of all members.

## Public Methods

| SQLParseElement (std::string b, char o, char n)
| Create object.

## Public Attributes

std::string | before
| string inserted before the parameter
char | option
| the parameter option, or blank if none
char | num
| the parameter position to use

## Detailed Description

Used within SQLQuery to hold elements for parameterized queries.

Each element has three parts:

The concept behind the `before` variable needs a little explaining. When a template query is parsed, each parameter is parsed into one of these SQLParseElement objects, but the non-parameter parts of the template also have to be stored somewhere. MySQL++ chooses to attach the text leading up to a parameter to that parameter. So, the `before` string is simply the text copied literally into the finished query before we insert a value for the parameter.

The `option` character is currently one of 'q', 'Q', 'r', 'R' or ' '. See the "Template Queries" chapter in the user manual for details.

The position value (`num)` allows a template query to have its parameters in a different order than in the Query method call. An example of how this can be helpful is in the "Template Queries" chapter of the user manual.

## Constructor & Destructor Documentation

mysqlpp::SQLParseElement::SQLParseElement | ( | std::string | b,
|  | char | o,
|  | char | n
| ) | `[inline]`

Create object.

Parameters:

  b | the 'before' value
  o | the 'option' value
  n | the 'num' value

The documentation for this struct was generated from the following file:

- sql_query.h