SQLite Forum

Type of the column
Login
Hi, Ryan,
I understand that SQLite is more like Perl/Python whereas MS SQL Server/PostgreSQL/mySQL/Sybase/Oracle are more like C/C++/Pascal.

I was acrually hoping to write something like:

[code]
    if( ( res = sqlite3_prepare_v2( m_db, sqlite_pimpl->m_myconv.to_bytes( query.c_str() ).c_str(), -1, &m_stmt, NULL ) ) != 0 )
    {
        GetErrorMessage( res, errorMessage );
        errorMsg.push_back( errorMessage );
    }
    else
    {
        while( true )
        {
            res = sqlite3_step( m_stmt );
            if( res == SQLITE_ROW )
            {
                std::vector<DataEditFiield> row;
                int count = sqlite3_column_count( m_stmt );
                for( int i = 0; i < count; ++i )
                {
                    res = sqlite3_column_type( m_stmt, i );
                    switch( res )
                    {
                    case SQLITE_INTEGER:
                        row.push_back( DataEditFiield( sqlite3_column_int64( m_stmt, i ) ) );
                        break;
                    case SQLITE_FLOAT:
                        row.push_back( DataEditFiield( sqlite3_column_double( m_stmt, i ) ) );
                        break;
                    case SQLITE_TEXT:
                        row.push_back( DataEditFiield( sqlite_pimpl->m_myconv.from_bytes( reinterpret_cast<const char *>( sqlite3_column_text( m_stmt, i ) ) ) );
                        break;
                    }
                }
            }
        }
    }
[/code]

in order to kind of emulate all those "big DBMSes" and use it to further processing.

Am I wrong? Will it work like this?

Thank you.