示例#1
0
unsigned long rhom_make_object(IDBResult& res1, int nSrcID, bool isSchemaSrc)
{
    unsigned long item = 0;
    if ( res1.isEnd() )
        return item;

    item = rho_connectclient_hash_create();
    rho_connectclient_hash_put(item, "source_id", convertToStringA(nSrcID).c_str() );

    if (!isSchemaSrc)
    {
        for ( ; !res1.isEnd(); res1.next() )
        {
            if ( !res1.isNullByIdx(1) )
                rho_connectclient_hash_put(item, res1.getStringByIdx(0).c_str(), res1.getStringByIdx(1).c_str() );
        }
    }else
    {
        for (int i = 0; i < res1.getColCount(); i++ )
        {
            if ( !res1.isNullByIdx(i))
                rho_connectclient_hash_put(item, res1.getColName(i).c_str(), res1.getStringByIdx(i).c_str() );
        }
    }

    return item;
}