List:MySQL++« Previous MessageNext Message »
From:Soul Boy Date:June 30 2008 2:02am
Subject:Re: sql_create_ macro
View as plain text  
Please try this the error happens on insertion sorry I wasn't clearer:

This goes in a file called Test.h

#include "mysql++.h"
#include "ssqls.h"

sql_create_7(Test,
         1, 7,
             mysqlpp::String,
A,
             mysqlpp::String,
B,
             mysqlpp::String,
C,
             mysqlpp::String,
D,
             mysqlpp::String,
E,
             mysqlpp::String,
F,
             mysqlpp::String,
G
)


Then this is the main project file:


#include <stdlib.h>
#include "Test.h"

using namespace std;

/*
 * 
 */

void AddAcctTbRow (string A,
                  
string B,
                  
string C,
                  
string D,
                  
string E,
                  
string F,
                  
string G)
{
        Test newRow (mysqlpp::String  (A),//
mysqlBrchCode,
                      
mysqlpp::String  (B),
                      
mysqlpp::String  (C),
                      
mysqlpp::String  (D),
                      
mysqlpp::String  (E),
                      
mysqlpp::String  (F),
                      
mysqlpp::String  (G));
        
       mysqlpp::Connection connection =
connection.connect("", "TestHost", "TestName", "TestPassword");
        
       mysqlpp::Query query = connection.query();
        
       query.insert(newRow);  
   
}

int main(int argc, char** argv) {
    
    string a("foo"), b("bar"), c("qux"), d, e, f, g;
    
    AddAcctTbRow (a, b, c, d, e, f, g);
    
    return (EXIT_SUCCESS);
}




      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo!
http://uk.docs.yahoo.com/ymail/new.html
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