On 02/11/2010 17:43, Adrian Cornish wrote:
> #include<mysql++.h>
> #include<ssqls.h>
>
> sql_create_6( event_log,
> 1, 6, // COMPCOUNT, SETCOUNT
> mysqlpp::sql_datetime, time,
> mysqlpp::sql_int_unsigned, id,
> mysqlpp::sql_int_unsigned, type,
> mysqlpp::sql_int, sidx,
> mysqlpp::sql_int, sidz,
> mysqlpp::sql_character_varying, detail )
> int main()
> {
> mysqlpp::Connection conn;
> conn.connect("test", "localhost", "adrianc");
> mysqlpp::Query query=conn.query();
>
> event_log row(mysqlpp::DateTime::now(), 1, 2, 3, 4, "a test string");
> query.insert(row);
> query.exec();
>
> return 0;
> }
Hi Adrian/Warren,
Here's the output:
mysql> select * from event_log;
+---------------------+----+------+------+------+---------------+
| time | id | type | sidx | sidz | detail |
+---------------------+----+------+------+------+---------------+
| 0000-00-00 00:00:00 | 1 | 2 | 3 | 4 | a test string |
+---------------------+----+------+------+------+---------------+
1 row in set (0.01 sec)
Platform:
Ubuntu Jaunty 9.04
MySQL 5.0.75-0ubuntu10.5 (Ubuntu)
mysqlpp 3.0.9
I will build 3.1.0 and try again
Thanks
Simon