Re: [sqlite] Unable to prepare a statement

2014-10-16 Thread Sam Carleton
Yes, that was the case.  The app has two databases, a system wide DB and
the active data DB.  The system points to the active data DB but wasn't
configured to point to the active data.  Live and learn:)

Pax vobiscum,
Sam Carleton

On Wed, Oct 15, 2014 at 6:01 AM, Dan Kennedy  wrote:

> 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
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unable to prepare a statement

2014-10-15 Thread Dan Kennedy

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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unable to prepare a statement

2014-10-14 Thread Sam Carleton
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?


-- 
Pax vobiscum,
Sam Carleton
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users