boost::shared_ptr< Base<EncodingT> >
ConnectionInterpreter<EncodingT>::selectForUpdate(boost::shared_ptr< Base<EncodingT> > const& columns,
                                                  boost::shared_ptr< Base<EncodingT> > const& tables,
                                                  boost::shared_ptr< Base<EncodingT> > const& filter,
                                                  boost::shared_ptr< Base<EncodingT> > const& nowait)
{
    boost::shared_ptr< Base<EncodingT> > res(new StatementInterpreter<EncodingT>());
    clearError();
    try
    {
        bool nativeNoWait;
        std::vector<typename EncodingT::string_t> nativeColumns, nativeTables;
        typename EncodingT::string_t nativeFilter;
        if (check_string<EncodingT>(filter, nativeFilter) &&
            check_string_array(columns, nativeColumns) &&
            check_string_array(tables, nativeTables) &&
            check_bool(nowait, nativeNoWait))
        {
            res.reset(new StatementInterpreter<EncodingT>(m_object->selectForUpdate(nativeColumns, nativeTables, nativeFilter, nativeNoWait)));
        }
    }
    catch (std::exception& e)
    {
        setError(e);
    }
    return res;
}
Example #2
0
void string_sample()
{
	std::string strings[] = {"this", "is", "a test", "string"};
	
	int size_strings = sizeof(strings);
	int size_strings_0 = sizeof(strings[0]);

	std::cout << "size of (strings,strings[0]): " << size_strings 
		<< " , " << size_strings_0 << std::endl
		<< "items in array: " << size_strings/size_strings_0 
		<< std::endl;

	check_string_array(strings);

}
boost::shared_ptr< Base<EncodingT> >
ConnectionInterpreter<EncodingT>::insert(boost::shared_ptr< Base<EncodingT> > const& table,
                                         boost::shared_ptr< Base<EncodingT> > const& columns)
{
    boost::shared_ptr< Base<EncodingT> > res(new StatementInterpreter<EncodingT>());
    clearError();
    try
    {
        std::vector<typename EncodingT::string_t> nativeColumns;
        typename EncodingT::string_t nativeTable;
        if (check_string_array(columns, nativeColumns) &&
            check_string<EncodingT>(table, nativeTable))
        {
            res.reset(new StatementInterpreter<EncodingT>(m_object->insert(nativeTable, nativeColumns)));
        }
    }
    catch (std::exception& e)
    {
        setError(e);
    }
    return res;
}