php-doc-en/reference/pgsql/functions/pg-last-oid.xml

63 lines
2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
<refentry id="function.pg-last-oid">
<refnamediv>
<refname>pg_last_oid</refname>
<refpurpose>Returns the last object's oid</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>pg_last_oid</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_last_oid</function> is used to retrieve the
<varname>oid</varname> assigned to an inserted tuple (record) if
the result resource is used from the last command sent via
<function>pg_query</function> and was an SQL INSERT. Returns a
positive integer if there was a valid <varname>oid</varname>. It
returns &false; if an error occurs or the last command sent via
<function>pg_query</function> was not an INSERT or INSERT is
failed.
</para>
<para>
OID field became an optional field from PostgreSQL 7.2. When
OID field is not defined in a table, programmer must use
<function>pg_result_status</function> to check if record is
is inserted successfully or not.
</para>
<note>
<para>
This function used to be called <literal>pg_getlastoid()</literal>.
</para>
</note>
<para>
See also <function>pg_query</function> and
<function>pg_result_status</function>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->