Expanded documentation with return values, useful example and "see also"

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@103100 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Maxim Maletsky 2002-11-10 00:26:04 +00:00
parent e58bd8908b
commit b3b1c8de67

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 -->
<refentry id="function.ocicommit">
<refnamediv>
@ -14,8 +14,44 @@
</methodsynopsis>
<para>
<function>OCICommit</function> commits all outstanding statements
for Oracle connection <parameter>connection</parameter>.
for Oracle connection <parameter>connection</parameter>. <function>OCICommit</function>
returns &true; on success and &false; otherwise.
</para>
<para>
This example demonstrates how OCICommit is used.
<example>
<title>OCINLogon</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>