ocicommit

(PHP 3>= 3.0.7, PHP 4 , PHP 5)

ocicommit -- 提交未执行的事务处理

描述

bool ocicommit ( resource connection)

ocicommit() 提交 Oracle 连接 connection 正在运行的事务处理上所有未执行的语句。

下面的例子说明了 ocicommit() 的用法。

例子 1. ocicommit()

<?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);
?>

参见 ocirollback()