|
pg_last_oid() is used to retrieve the OID assigned to an inserted row.
OID field became an optional field from PostgreSQL 7.2 and will not be present by default in PostgreSQL 8.1. When the OID field is not present in a table, the programmer must use pg_result_status() to check for successful insertion.
To get the value of a SERIAL field in an inserted row, it is necessary to use the PostgreSQL CURRVAL function, naming the sequence whose last value is required. If the name of the sequence is unknown, the pg_get_serial_sequence PostgreSQL 8.0 function is necessary.
Nota: This function used to be called pg_getlastoid().
PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
A string containing the OID assigned to the most recently inserted row in the specified connection, or FALSE on error or no available OID.
Ejemplo 1. pg_last_error() example
|
Hosting by: hurra.com
Generated: 2007-01-26 18:00:48