php-doc-en/reference/oci8/functions/ocicommit.xml
2003-05-09 01:31:30 +00:00

77 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 -->
<refentry id="function.ocicommit">
<refnamediv>
<refname>OCICommit</refname>
<refpurpose>Commits outstanding transactions</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>ocicommit</methodname>
<methodparam><type>int</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>ocicommit</function> commits all outstanding statements
for Oracle connection <parameter>connection</parameter>.
&return.success;
</para>
<para>
This example demonstrates how OCICommit is used.
<example>
<title>OCICommit</title>
<programlisting>
<![CDATA[
<?php
// Login to Oracle server
$conn = OCILogon('scott', 'tiger');
// Parse SQL
$stmt = OCIParse($conn, "INSERT INTO employees (name, surname) VALUES ('Maxim', 'Maletsky')");
// Execute statement
OCIExecute($stmt);
// Commit transaction
$committed = OCICommit($conn);
// Test whether commit was successful. If error occurred, return error message
if(!$committed) {
$error = OCIError($conn);
echo 'Commit failed. Oracle reports: ' . $error['message'];
}
// Close connection
OCILogoff($conn);
?>
]]>
</programlisting>
</example>
</para>
<simpara>
See also <function>ocirollback</function>.
</simpara>
</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
-->