def fetch( id )
      r = nil
      begin
        r = lib.tcidbget( @db, id )
      rescue => e
        # if we have 'no record found' then return nil
        if lib.tcidbecode( @db ) == 22 then
          return nil
        else
          raise_error
        end
      end
      return r
    end
def fetch( id )
      r = nil
      begin
        r = lib.tcidbget( @db, id )
      rescue => e
        # if we have 'no record found' then return nil
        if lib.tcidbecode( @db ) == 22 then
          return nil
        else
          raise_error
        end
      end
      return r
    end
Return the document at the specified index