Hi again,
I just tested it. It works for me. And this is what I did:
I executed these statements with "sqlite3 sq.db":
CREATE TABLE metadata(`@id` TEXT PRIMARY KEY,`@parentID` TEXT NOT
NULL,`dc:title` TEXT NOT NULL,`upnp:class` TEXT NOT
NULL,`@restricted` INTEGER NOT NULL,`dc:creator` TEXT,`dc:description`
TEXT,`upnp:longDescription` TEXT,`dc:date` TEXT,`dc:language`
TEXT,`upnp:channelNr` INTEGER,`upnp:channelName`
TEXT,`upnp:scheduledStartTime` TEXT,`upnp:scheduledEndTime` TEXT);
insert into metadata(`@id`, `@parentID`, `dc:title`, `upnp:class`,
`@restricted`,
`dc:creator`, `dc:description`, `upnp:longDescription`, `dc:date`,
`dc:language`,
`upnp:channelNr`, `upnp:channelName`, `upnp:scheduledStartTime`,
`upnp:scheduledEndTime`)
values ('the id', '0', 'a title', 'some class', 42,
'some creator', 'a description', 'a long description', 'a date', 'some
language',
45, 'the channel name', 'start time', 'end time');
insert into metadata(`@id`, `@parentID`, `dc:title`, `upnp:class`,
`@restricted`,
`dc:creator`, `dc:description`, `upnp:longDescription`, `dc:date`,
`dc:language`,
`upnp:channelNr`, `upnp:channelName`, `upnp:scheduledStartTime`,
`upnp:scheduledEndTime`)
values ('a second id', '0', 'a title', 'some class', 43,
'some creator', 'a description', 'a long description', 'a date', 'some
language',
46, 'the channel name', 'start time', 'end time');
I created a test program:
#include <iostream>
#include <tntdb/connect.h>
#include <tntdb/statement.h>
int main(int argc, char* argv[])
{
try
{
tntdb::Connection mConnection = tntdb::connect("sqlite:sq.db");
tntdb::Statement select1 = mConnection.prepare("SELECT * FROM
metadata WHERE `@parentID`='0'");
for(tntdb::Statement::const_iterator it = select1.begin(); it !=
select1.end(); ++it)
{
tntdb::Row row = (*it);
std::string id;
row[0].get(id);
std::cout << "id=" << id << '\n';
}
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
}
}
And a Makefile:
LDFLAGS=-ltntdb
CC=g++
sq: sq.o
After running make I run the new program using "./sq" and got that output:
id=the id
id=a second id
This is exactly what I expected. Are you sure, your @parentID has really
'0' and not '0 ' or something it it? What happens, if you execute the
select statement from the command line tool sqlite3?
Tommi
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general