I'm not able to reproduce the issue on my system. Here is what I"m trying n a unit test:
Code: Select all
m_pDatabaseLayer->RunQuery(_("CREATE TABLE table1 (column1 VARCHAR(50), column2 VARCHAR(50));"));
m_pDatabaseLayer->RunQuery(_("INSERT INTO table1 (column1, column2) VALUES ('ONE', 'TWO');"));
DatabaseResultSet* pResultSet = m_pDatabaseLayer->RunQueryWithResults(_("SELECT table1.column1 AS aliasColumn FROM table1;"));
wxString strValue = pResultSet->GetResultString(_("aliasColumn"));
I've also tried this using a View
Code: Select all
m_pDatabaseLayer->RunQuery(_("CREATE TABLE table1 (column1 VARCHAR(50), column2 VARCHAR(50));"));
m_pDatabaseLayer->RunQuery(_("INSERT INTO table1 (column1, column2) VALUES ('ONE', 'TWO');"));
m_pDatabaseLayer->RunQuery(_("CREATE VIEW Table1View AS SELECT table1.column1 AS col1 FROM table1;"));
DatabaseResultSet* pResultSet = DatabaseResultSet* pResultSet = m_pDatabaseLayer->RunQueryWithResults(_("SELECT col1 FROM Table1View;"));
wxString strValue = pResultSet->GetResultString(_("aliasColumn"));
But in both cases the code seems to work with SQLite (3.3.3) against the latest databaselayer code in CVS.
I'm not sure that I understand what you mean by "Field Descriptor". I just checked in some code to retrieve something similar to the JDBC Interface "ResultSetMetaData" which should allow you to get the column count in a result set as well as the column names, types, and size (although size varies quite a bit and doesn't seem to be reliable).