List:MySQL++« Previous MessageNext Message »
From:Alex Luya Date:March 6 2009 8:57am
Subject:How to pass SQLTypeAdapters to create a SQLQueryParms?
View as plain text  
Hello,I try to run following code,but get an exception:Not enough 
parameters to fill the template.So can any guys point out the issues for 
me?Thank you.
------------------------
try {
                Query query = serverConn.query("INSERT INTO sync_status 
VALUES(%0q,%1,%2q)");
                query.parse();

                SQLQueryParms sqp;
                SQLTypeAdapter sta0("Alex Luya");
                sqp<<sta0;
                SQLTypeAdapter sta1(DateTime("2009-03-04 14:33:31"));
                sqp<<sta1;
                SQLTypeAdapter sta2("synchronizing");
                sqp<<sta2;
                SimpleResult res1 = query.execute(sqp);
            }
            catch (const mysqlpp::Exception& er) {
                 cerr << "synchronize-Exception: " << er.what() << endl;
            }
------------------------
-- --------------------------------------------------------
-- Structure de la table `sync_status`

CREATE TABLE IF NOT EXISTS `sync_status` (
`sync_user` varchar(20) NOT NULL,
`start_time` datetime NOT NULL,
`status` varchar(13) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



Thread
How to pass SQLTypeAdapters to create a SQLQueryParms?Alex Luya6 Mar
  • RE: How to pass SQLTypeAdapters to create a SQLQueryParms?Jim Wallace6 Mar
    • Re: How to pass SQLTypeAdapters to create a SQLQueryParms?Warren Young6 Mar
      • Re: How to pass SQLTypeAdapters to create a SQLQueryParms?Warren Young6 Mar
        • Re: How to pass SQLTypeAdapters to create a SQLQueryParms?Rick Gutleber6 Mar
          • Re: How to pass SQLTypeAdapters to create a SQLQueryParms?Warren Young6 Mar