I need to add a custom command to my sqlite3 system Im accessing via
QSqlDatabase..
Per reading found at sourceforge and qtcentre, I have compiled in the
code locally from the Qt source area..
However, on the call to sqlite3_create_function, sqlite is crashing...
extern "C"
void getMsgID( sqlite3_context * context, int argc, sqlite3_value **
argv )
{
assert( argc == 2 );
sqlite3_result_int( context, 0 );
}
bool loadCustomCommands( QSqlDatabase & db )
{
QVariant v = db.driver()->handle();
if ( !v.isValid() || qstrcmp( v.typeName(), "sqlite3*" ) != 0 )
{
return false;
}
sqlite3 * handler = *static_cast<sqlite3**>( v.data() );
if ( !handler )
return false;
sqlite3_create_function( handler, "msgid", 2, SQLITE_ANY, NULL,
&getMsgID, NULL, NULL );
return true;
}
Any thoughts, ideas??
Scott
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest