[Qgis-developer] Re: Load SQLite table into QGIS
mmekuria
sailmcm at yahoo.com
Wed Oct 19 19:14:18 EDT 2011
Forget my request. I went ahead with a native SQLite query (after including
the sqlite3 header) here is what I used to get to the data,
sqlite3 *db;
int rc = sqlite3_open( spliteDBName.toStdString().c_str(), &db);
if( rc ){
txtStream<< "Can't open database: \n"<< sqlite3_errmsg(db) <<endl;
sqlite3_close(db);
return;
}
strQry = "select i, sum(v) as sumi, count(i) as counti from tbltps group by
i;";
rc = sqlite3_exec(db, strQry.toUtf8().constData(),NULL , NULL, &zErrMsg);
if( rc!=SQLITE_OK ){
txtStream<< "\tSQL error: "<<strQry.toStdString()<< zErrMsg<<endl;
sqlite3_free(zErrMsg);
return;
}
and one can use other functions such as
// SQLite get table statement
rc = sqlite3_get_table( db, strQry.toUtf8().constData(), &results, &rows,
&columns, &errMsg );
Thank you again for your help,
Maaza
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Load-SQLite-table-into-QGIS-tp6876536p6910904.html
Sent from the qgis-developer mailing list archive at Nabble.com.
More information about the Qgis-developer
mailing list