cvs: phpdoc /en/reference/oci8/functions ocicommit.xml
| From: | Maxim Maletsky | Date: | Sun, 10 Nov 2002 00:26:04 +0000 |
| Subject: | cvs: phpdoc /en/reference/oci8/functions ocicommit.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969349516@lists.php.net to get a copy of this message | ||
maxim Sat Nov 9 19:26:04 2002 EDT
Modified files:
/phpdoc/en/reference/oci8/functions ocicommit.xml
Log:
Expanded documentation with return values, useful example and "see also"
Index: phpdoc/en/reference/oci8/functions/ocicommit.xml
diff -u phpdoc/en/reference/oci8/functions/ocicommit.xml:1.2
phpdoc/en/reference/oci8/functions/ocicommit.xml:1.3
--- phpdoc/en/reference/oci8/functions/ocicommit.xml:1.2 Wed Apr 17 02:42:18 2002
+++ phpdoc/en/reference/oci8/functions/ocicommit.xml Sat Nov 9 19:26:04 2002
@@ -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>