So I read all data from XML in an DynamicAny array, parsing the datatype, and gerenate the sql and bind the variables dinamically, without worrying about the data types.
As the table is dinamically gerenated, all fields can be null, and I use an empty DynamicAny to indicate this. But if bind doesn't handle this, I would have to check each field manually to see if it is a void DynamicAny.
This is what my code looks like:
- Code: Select all
typedef map<string, Poco::SharedPtr<Poco::Dynamic::Var> > fields_t;
fields_t _fields;
- Code: Select all
Poco::Data::Statement stmt(*session);
stmt << sql;
for (fields_t::const_iterator i=_fields.begin(); i!=_fields.end(); i++)
{
stmt , Poco::Data::Keywords::bind(*i->second);
}
stmt.execute();





