On 10/15/2014 07:19 AM, Sam Carleton wrote:
When I use the SQLite Manager, I am able to run this query just fine:

     UPDATE EventNode
        SET IsActive = 1
      WHERE EventNodeId IN (SELECT w.EventNodeId
                              FROM EventNode as w, EventNode as m on
m.objectId = 'a09f0f8a-a37c-44c2-846f-16a59b1c34c1'
                              WHERE w.lft BETWEEN m.lft AND m.rgt )

But when I try to prepare the same statement to be used with my C++ code:

     const char * updateString =
         "UPDATE EventNode "
            "SET IsActive = @isActive "
          "WHERE EventNodeId IN (SELECT w.EventNodeId "
                                  "FROM EventNode AS w, EventNode AS m ON
m.objectId = @objectId "
                                 "WHERE w.lft BETWEEN m.lft AND m.rgt)";

I get an error where sqlite3_errmsg() returns: no such table: EventNode

Now the code that is opening the DB is in a base class which is used other
places to access the EventNode table, so I am a bit mystified as to what
exactly is going on.  Any thoughts?

Perhaps it's opening a different database file.

sqlite-users mailing list

Reply via email to