4 <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
8 require(dirname(__FILE__)."/connect.inc");
12 $s = oci_parse($c, 'select address from rid_tab order by id');
14 oci_execute($s, OCI_DEFAULT);
15 while ($row = oci_fetch_array($s, OCI_ASSOC+OCI_RETURN_NULLS)) {
22 "create table rid_tab (id number, address varchar2(40))",
23 "insert into rid_tab (id, address) values (1, 'original text #1')",
24 "insert into rid_tab (id, address) values (2, 'original text #2')"
27 oci8_test_sql_execute($c, $stmtarray);
29 echo "Initial Data\n";
32 $s = oci_parse($c, 'select rowid, address from rid_tab where id = :l_bv for update');
34 oci_bind_by_name($s, ':l_bv', $id);
35 oci_execute($s, OCI_DEFAULT);
36 $row = oci_fetch_array($s, OCI_ASSOC+OCI_RETURN_NULLS);
39 $addr = $row['ADDRESS'];
41 $addr = 'Some new text';
44 $s = oci_parse($c,'update rid_tab set address = :a_bv where rowid = :r_bv');
45 oci_bind_by_name($s, ':r_bv', $rid, -1, OCI_B_ROWID);
46 oci_bind_by_name($s, ':a_bv', $addr);
49 echo "Verify Change\n";
58 oci8_test_sql_execute($c, $stmtarray);
67 string(16) "original text #1"
71 string(16) "original text #2"
76 string(13) "Some new text"
80 string(16) "original text #2"