Hi, ALL,
I have a weird situation where executing a query in a shell gives me a row,
but executing the same query through the C-interface: sqlite3_prepare_v2(),
sqlite3_bind_text() and sqlite3_step() produces SQLITE_DONE.
So I wonder - is it possible to see a full query string inside sqlite3_step()?
I'm using MSVC++2010 ATM with Windows 8.1. Program is compiled as 32-bit
app.
From shell:
C:\Users\Igor\OneDrive\Documents>sqlite3 draft.db
SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
sqlite> SELECT * FROM "sys.abcattbl" WHERE "abt_tnam" = "leagues" AND "abt_ownr"
= "";
leagues||||||||||||||||||||||||Leagues table
sqlite>
From the code routine (it is C++):
sqlite3_stmt *stmt = NULL;
std::wstring errorMessage;
int result;
std::wstring query = L"SELECT * FROM \"sys.abcattbl\" WHERE
\"abt_tnam\" = ? AND \"abt_ownr\" = \"\";";
const unsigned char *dataFontName, *headingFontName, *labelFontName;
int res = sqlite3_prepare_v2( m_db,
sqlite_pimpl->m_myconv.to_bytes( query.c_str() ).c_str(), (int)
query.length(), &stmt, 0 );
if( res == SQLITE_OK )
{
res = sqlite3_bind_text( stmt, 1,
sqlite_pimpl->m_myconv.to_bytes( table->GetTableName().c_str()
).c_str(), -1, SQLITE_STATIC );
if( res == SQLITE_OK )
{
while( true )
{
res = sqlite3_step( stmt );
where sqlite_pimpl is:
struct SQLiteDatabase::SQLiteImpl
{
std::wstring m_catalog;
std::wstring_convert<std::codecvt_utf8<wchar_t> > m_myconv;
};
Thank you.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users