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

70 lines
2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- 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 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</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 number 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 inserted successfully or not.
</para>
<note>
<para>
This function used to be called <function>pg_getlastoid</function>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pg_query</function></member>
<member><function>pg_result_status</function></member>
</simplelist>
</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
-->