List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 27 2008 4:16am
Subject:Re: sql_create_ macro
View as plain text  
Soul Boy wrote:
> I guess you mean this ?
> 
> sql_create_3(TableRow,
>          1, 3,
>              mysqlpp::String,   A,
>              mysqlpp::String,    B,
>              mysqlpp::String,   C);

Yes, that's what I wanted to see from the start.  But, it works fine for 
me.  Here's a diff of examples/ssqls1.cpp modified to do what you said 
doesn't work in an earlier post:

--- examples/ssqls1.cpp (revision 2285)
+++ examples/ssqls1.cpp (working copy)
@@ -33,11 +33,21 @@
  #include <iostream>
  #include <vector>

+sql_create_3(TableRow,
+       1, 3,
+       mysqlpp::String, A,
+       mysqlpp::String, B,
+       mysqlpp::String, C);
+
  using namespace std;

  int
  main(int argc, char *argv[])
  {
+       string a("foo"), b("bar"), c("qux");
+       TableRow tr1(mysqlpp::String(a), mysqlpp::String(b),
+                       mysqlpp::String(c));
+
         // Get database access parameters from command line
      const char* db = 0, *server = 0, *user = 0, *pass = "";
         if (!parse_command_line(argc, argv, &db, &server, &user, &pass))
{


As you can see, all I've done is drop your SSQLS declaration in at the 
top of this file, in global scope, and declare one of these TableRows, 
populating the members from std::string.  This compiles just fine.

I recommend you try replicating what I've done here, also using the 
MySQL++ examples as a base to work from.  Then continue to modify the 
example until it gives the error you're seeing, and send the modified 
example to the list, along with the error messages.
Thread
sql_create_ macroSoul Boy13 Jun
  • Re: sql_create_ macroWarren Young13 Jun
    • Re: sql_create_ macroGareth Pidgeon18 Jun
      • Re: sql_create_ macroWarren Young22 Jun
Re: sql_create_ macroSoul Boy23 Jun
  • Re: sql_create_ macroWarren Young27 Jun
Re: sql_create_ macroSoul Boy30 Jun
  • Re: sql_create_ macroWarren Young30 Jun
Re: sql_create_ macroSoul Boy30 Jun