List:MySQL++« Previous MessageNext Message »
From:Alex Luya Date:March 11 2009 10:43am
Subject:How to push NULL into template query?
View as plain text  
My code is like this:
-----------------------------------------------------------------------------
try
    {
       query = clientConn.query(*usql*);
       query.parse();

        SQLQueryParms sqp;

        for (size_t i = 1; i <20; i++)
        {
            sqp << *res[1][i]*;
        }
        //    put id into sqp for "where id=%q"
        sqp << res[1][0];
       
        query.execute(sqp);
        cout<<query.str()<endl;
     } catch (Exception& er)
    {
        cerr << "update: " << er.what() << endl;
    }
--------------------------------------------------------------------------
result:
table has not been updated,no exception,no error.no output,So what is 
the problem here?

*usql *is:
----------------
UPDATE calls SET date_entered=%0 and date_modified=%1 and 
assigned_user_id=%2q and modified_user_id=%3q and created_by=%4q and 
name=%5q and duration_hours=%6 and duration_minutes=%7 and date_start=%8 
and time_start=%9 and date_end=%10 and parent_type=%11q and status=%12q 
and direction=%13q and parent_id=%14q and description=%15 and 
deleted=%16 and reminder_time=%17 and outlook_id=%18q WHERE id=%19q
-----------------------

the* values *of res[1] is
----------------------------------------
fsfjl058230dfksdfk
2008-12-23 03:26:04
2008-12-23 03:26:04
1
1
1
Get More information on the proposed deal
0
30
2009-05-03
09:00:00
2009-05-03
Accounts
Planned
Outbound
6b4f8eed-df99-d5bf-bc25-49505a8ce81f
NULL
0
-1
NULL

Thread
How to push NULL into template query?Alex Luya11 Mar
  • Re: How to push NULL into template query?Warren Young11 Mar
  • Re: How to push NULL into template query?Alex Luya13 Mar
    • How to construct a SQLQueryParms?Alex Luya13 Mar
    • Re: How to push NULL into template query?Warren Young13 Mar
      • How to ?Alex Luya17 Mar
        • How to build from svn r2483?Alex Luya17 Mar
        • Re: How to ?Warren Young17 Mar
          • Re: How to ?Many files does not exist or is incomplete or subfixedwith .inAlex Luya18 Mar
            • Re: How to ?Many files does not exist or is incomplete or subfixedwith .inWarren Young18 Mar
              • got another errorAlex Luya18 Mar
                • Re: got another errorWarren Young19 Mar
                  • got another error after got another errorAlex Luya20 Mar
                    • Re: got another error after got another errorWarren Young20 Mar
                      • Re: got another error after got another errorWarren Young21 Mar
              • Got all files from running ./bootstracp,but compile errorAlex Luya19 Mar