![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I'm trying to use a template query and it's not working. Here's the query and relevant statements: -- SNIP -- string sqlQuerySrc = "SELECT ip_src,SUM(bytes) AS src_bytes " "FROM acct_v2 WHERE ip_src!='0.0.0.0' " "AND stamp_inserted=%q0:stamp " "GROUP BY ip_src"; mysqlpp::Query queryGetSrc = con.query(); queryGetSrc.reset(); queryGetSrc << sqlQuerySrc; queryGetSrc.parse(); // the stamp_inserted below is from another query that is working string stampInserted = rowGetStamps.lookup_by_name("stamp_inserted").c_st r; mysqlpp::Result resGetSrc = queryGetSrc.store(stampInserted); -- SNIP -- This compiles fine, but I get this error back from MySQL: Error: You have an error in your SQL syntax near '%q0:stamp GROUP BY ip_src' at line 1 As far as I can tell, this is the correct way to use template queries according to the docs that came with the distribution. However, the docs are ~4 years old. Can anyone tell me what I'm doing wrong? Thanks in advance, Dave -- |
![]() |
| Thread Tools | |
| Display Modes | |
| |