Class type Postgresql.result
Class type of query results.
Indices of tuples and fields start at 0!
method status : result_status
#status
- returns
status of a command/query result.
method error_field : Error_field.t -> string
#error_field
- returns
message of given error field in a result.
method error_code : Error_code.t
#error_code
- returns
the error code of the error condition as stored in the SQLSTATE field.
method nparams : int
#nparams
- returns
the number of parameters of a prepared statement. This function is only useful when inspecting the result of
#describe_prepared
. For other types of queries it will return zero.
method fname : int -> string
#fname n
- returns
the name of the
n
th field.
- raises Error
if field out of range.
method fnumber : string -> int
#fnumber field
- returns
the index of the field named
field
.
- raises Not_found
if no such named field.
method fformat : int -> FFormat.t
#fformat n
- returns
the format of the
n
th field.
- raises Error
if field out of range.
method ftype : int -> ftype
#ftype n
- returns
the type of the
n
th field.
- raises Oid
if there was no corresponding ftype for the internal
oid
.
- raises Error
if field out of range.
method ftype_oid : int -> oid
#ftype n
- returns
the oid of the
n
th field.
- raises Error
if field out of range.
method paramtype : int -> ftype
#paramtype n
- returns
the datatype of the indicated statement parameter. Parameter numbers start at 0. This function is only useful when inspecting the result of
#describe_prepared
. For other types of queries it will return zero.
- raises Oid
if there was no corresponding ftype for the internal
oid
.
- raises Error
if field out of range.
method paramtype_oid : int -> oid
#paramtype n
- returns
the oid of the indicated statement parameter. Parameter numbers start at 0. This function is only useful when inspecting the result of
#describe_prepared
. For other types of queries it will return zero.
- raises Error
if field out of range.
method fmod : int -> int
#fmod n
- returns
type-specific modification data of the
n
th field.
- raises Error
if field out of range.
method fsize : int -> int
#fsize n
- returns
size in bytes of the
n
th field.
- raises Error
if field out of range.
method getvalue : int -> int -> string
#getvalue tuple field
- returns
value of
field
intuple
.
- raises Error
if tuple out of range.
- raises Error
if field out of range.
method get_escaped_value : int -> int -> string
#get_escaped_value tuple field
- returns
escaped value of
field
intuple
.
- raises Error
if tuple out of range.
- raises Error
if field out of range.
method getisnull : int -> int -> bool
#getisnull tuple field
tests for a NULL-value offield
intuple
.- raises Error
if tuple out of range.
- raises Error
if field out of range.
method getlength : int -> int -> int
#getlength tuple field
- returns
length of value in
field
oftuple
in bytes.
- raises Error
if tuple out of range.
- raises Error
if field out of range.
method oid_value : oid
#cmd_tuples
- returns
the object ID of the inserted row if the SQL command was an INSERT that inserted exactly one row into a table that has OIDs. Otherwise, returns
invalid_oid
.
method get_tuple : int -> string array
#get_tuple n
- returns
all fields of the
n
th tuple.
- raises Error
if tuple out of range.