/* * call-seq: * res.num_fields() * * Returns the number of fields (columns) in the query result. * * Similar to <tt>res.result[0].length</tt> (but faster). */ static VALUE pgresult_num_fields(obj) VALUE obj; { int n; n = PQnfields(get_pgresult(obj)); return INT2NUM(n); }