PHP_FE(oci_unregister_taf_callback, arginfo_oci_unregister_taf_callback)
PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement)
- PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
- PHP_FALIAS(ocibindbyname, oci_bind_by_name, arginfo_oci_bind_by_name)
- PHP_FALIAS(ocidefinebyname, oci_define_by_name, arginfo_oci_define_by_name)
- PHP_FALIAS(ocicolumnisnull, oci_field_is_null, arginfo_oci_field_is_null)
- PHP_FALIAS(ocicolumnname, oci_field_name, arginfo_oci_field_name)
- PHP_FALIAS(ocicolumnsize, oci_field_size, arginfo_oci_field_size)
- PHP_FALIAS(ocicolumnscale, oci_field_scale, arginfo_oci_field_scale)
- PHP_FALIAS(ocicolumnprecision, oci_field_precision, arginfo_oci_field_precision)
- PHP_FALIAS(ocicolumntype, oci_field_type, arginfo_oci_field_type)
- PHP_FALIAS(ocicolumntyperaw, oci_field_type_raw, arginfo_oci_field_type_raw)
- PHP_FALIAS(ociexecute, oci_execute, arginfo_oci_execute)
- PHP_FALIAS(ocicancel, oci_cancel, arginfo_oci_cancel)
- PHP_FALIAS(ocifetch, oci_fetch, arginfo_oci_fetch)
- PHP_FALIAS(ocifetchstatement, oci_fetch_all, arginfo_oci_fetch_all)
- PHP_FALIAS(ocifreestatement, oci_free_statement, arginfo_oci_free_statement)
- PHP_FALIAS(ociinternaldebug, oci_internal_debug, arginfo_oci_internal_debug)
- PHP_FALIAS(ocinumcols, oci_num_fields, arginfo_oci_num_fields)
- PHP_FALIAS(ociparse, oci_parse, arginfo_oci_parse)
- PHP_FALIAS(ocinewcursor, oci_new_cursor, arginfo_oci_new_cursor)
- PHP_FALIAS(ociresult, oci_result, arginfo_oci_result)
- PHP_FALIAS(ociserverversion, oci_server_version, arginfo_oci_server_version)
- PHP_FALIAS(ocistatementtype, oci_statement_type, arginfo_oci_statement_type)
- PHP_FALIAS(ocirowcount, oci_num_rows, arginfo_oci_num_rows)
- PHP_FALIAS(ocilogoff, oci_close, arginfo_oci_close)
- PHP_FALIAS(ocilogon, oci_connect, arginfo_oci_connect)
- PHP_FALIAS(ocinlogon, oci_new_connect, arginfo_oci_new_connect)
- PHP_FALIAS(ociplogon, oci_pconnect, arginfo_oci_pconnect)
- PHP_FALIAS(ocierror, oci_error, arginfo_oci_error)
- PHP_FALIAS(ocifreedesc, oci_free_descriptor, arginfo_oci_free_descriptor)
- PHP_FALIAS(ocisavelob, oci_lob_save, arginfo_oci_lob_save)
- PHP_FALIAS(ocisavelobfile, oci_lob_import, arginfo_oci_lob_import)
- PHP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_oci_lob_export)
- PHP_FALIAS(ociloadlob, oci_lob_load, arginfo_oci_lob_load)
- PHP_FALIAS(ocicommit, oci_commit, arginfo_oci_commit)
- PHP_FALIAS(ocirollback, oci_rollback, arginfo_oci_rollback)
- PHP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_oci_new_descriptor)
- PHP_FALIAS(ocisetprefetch, oci_set_prefetch, arginfo_oci_set_prefetch)
- PHP_FALIAS(ocipasswordchange, oci_password_change, arginfo_oci_password_change)
- PHP_FALIAS(ocifreecollection, oci_free_collection, arginfo_oci_free_collection)
- PHP_FALIAS(ocinewcollection, oci_new_collection, arginfo_oci_new_collection)
- PHP_FALIAS(ocicollappend, oci_collection_append, arginfo_oci_collection_append)
- PHP_FALIAS(ocicollgetelem, oci_collection_element_get, arginfo_oci_collection_element_get)
- PHP_FALIAS(ocicollassignelem, oci_collection_element_assign, arginfo_oci_collection_element_assign)
- PHP_FALIAS(ocicollsize, oci_collection_size, arginfo_oci_collection_size)
- PHP_FALIAS(ocicollmax, oci_collection_max, arginfo_oci_collection_max)
- PHP_FALIAS(ocicolltrim, oci_collection_trim, arginfo_oci_collection_trim)
+ PHP_DEP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
+ PHP_DEP_FALIAS(ocibindbyname, oci_bind_by_name, arginfo_oci_bind_by_name)
+ PHP_DEP_FALIAS(ocidefinebyname, oci_define_by_name, arginfo_oci_define_by_name)
+ PHP_DEP_FALIAS(ocicolumnisnull, oci_field_is_null, arginfo_oci_field_is_null)
+ PHP_DEP_FALIAS(ocicolumnname, oci_field_name, arginfo_oci_field_name)
+ PHP_DEP_FALIAS(ocicolumnsize, oci_field_size, arginfo_oci_field_size)
+ PHP_DEP_FALIAS(ocicolumnscale, oci_field_scale, arginfo_oci_field_scale)
+ PHP_DEP_FALIAS(ocicolumnprecision, oci_field_precision, arginfo_oci_field_precision)
+ PHP_DEP_FALIAS(ocicolumntype, oci_field_type, arginfo_oci_field_type)
+ PHP_DEP_FALIAS(ocicolumntyperaw, oci_field_type_raw, arginfo_oci_field_type_raw)
+ PHP_DEP_FALIAS(ociexecute, oci_execute, arginfo_oci_execute)
+ PHP_DEP_FALIAS(ocicancel, oci_cancel, arginfo_oci_cancel)
+ PHP_DEP_FALIAS(ocifetch, oci_fetch, arginfo_oci_fetch)
+ PHP_DEP_FALIAS(ocifetchstatement, oci_fetch_all, arginfo_oci_fetch_all)
+ PHP_DEP_FALIAS(ocifreestatement, oci_free_statement, arginfo_oci_free_statement)
+ PHP_DEP_FALIAS(ociinternaldebug, oci_internal_debug, arginfo_oci_internal_debug)
+ PHP_DEP_FALIAS(ocinumcols, oci_num_fields, arginfo_oci_num_fields)
+ PHP_DEP_FALIAS(ociparse, oci_parse, arginfo_oci_parse)
+ PHP_DEP_FALIAS(ocinewcursor, oci_new_cursor, arginfo_oci_new_cursor)
+ PHP_DEP_FALIAS(ociresult, oci_result, arginfo_oci_result)
+ PHP_DEP_FALIAS(ociserverversion, oci_server_version, arginfo_oci_server_version)
+ PHP_DEP_FALIAS(ocistatementtype, oci_statement_type, arginfo_oci_statement_type)
+ PHP_DEP_FALIAS(ocirowcount, oci_num_rows, arginfo_oci_num_rows)
+ PHP_DEP_FALIAS(ocilogoff, oci_close, arginfo_oci_close)
+ PHP_DEP_FALIAS(ocilogon, oci_connect, arginfo_oci_connect)
+ PHP_DEP_FALIAS(ocinlogon, oci_new_connect, arginfo_oci_new_connect)
+ PHP_DEP_FALIAS(ociplogon, oci_pconnect, arginfo_oci_pconnect)
+ PHP_DEP_FALIAS(ocierror, oci_error, arginfo_oci_error)
+ PHP_DEP_FALIAS(ocifreedesc, oci_free_descriptor, arginfo_oci_free_descriptor)
+ PHP_DEP_FALIAS(ocisavelob, oci_lob_save, arginfo_oci_lob_save)
+ PHP_DEP_FALIAS(ocisavelobfile, oci_lob_import, arginfo_oci_lob_import)
+ PHP_DEP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_oci_lob_export)
+ PHP_DEP_FALIAS(ociloadlob, oci_lob_load, arginfo_oci_lob_load)
+ PHP_DEP_FALIAS(ocicommit, oci_commit, arginfo_oci_commit)
+ PHP_DEP_FALIAS(ocirollback, oci_rollback, arginfo_oci_rollback)
+ PHP_DEP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_oci_new_descriptor)
+ PHP_DEP_FALIAS(ocisetprefetch, oci_set_prefetch, arginfo_oci_set_prefetch)
+ PHP_DEP_FALIAS(ocipasswordchange, oci_password_change, arginfo_oci_password_change)
+ PHP_DEP_FALIAS(ocifreecollection, oci_free_collection, arginfo_oci_free_collection)
+ PHP_DEP_FALIAS(ocinewcollection, oci_new_collection, arginfo_oci_new_collection)
+ PHP_DEP_FALIAS(ocicollappend, oci_collection_append, arginfo_oci_collection_append)
+ PHP_DEP_FALIAS(ocicollgetelem, oci_collection_element_get, arginfo_oci_collection_element_get)
+ PHP_DEP_FALIAS(ocicollassignelem, oci_collection_element_assign, arginfo_oci_collection_element_assign)
+ PHP_DEP_FALIAS(ocicollsize, oci_collection_size, arginfo_oci_collection_size)
+ PHP_DEP_FALIAS(ocicollmax, oci_collection_max, arginfo_oci_collection_max)
+ PHP_DEP_FALIAS(ocicolltrim, oci_collection_trim, arginfo_oci_collection_trim)
PHP_FE_END
};
$ora_sql = "INSERT INTO bug26133_tab (id, value) VALUES (1,'1') RETURNING ROWID INTO :v_rowid ";
-$statement = OCIParse($c,$ora_sql);
-$rowid = OCINewDescriptor($c,OCI_D_ROWID);
-OCIBindByName($statement,":v_rowid", $rowid,-1,OCI_B_ROWID);
-if (OCIExecute($statement)) {
- OCICommit($c);
+$statement = oci_parse($c,$ora_sql);
+$rowid = oci_new_descriptor($c,OCI_D_ROWID);
+oci_bind_by_name($statement,":v_rowid", $rowid,-1,OCI_B_ROWID);
+if (oci_execute($statement)) {
+ oci_commit($c);
}
-OCIFreeStatement($statement);
+oci_free_statement($statement);
$rowid->free();
// Cleanup
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
-$r = OCIBindByName($stid, ':MYBV', $mybv);
+$r = oci_bind_by_name($stid, ':MYBV', $mybv);
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$stmtarray = array(
"drop sequence myseq",
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
-$r = OCIBindByName($stid, ':MYBV', $mybv);
+$r = oci_bind_by_name($stid, ':MYBV', $mybv);
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$stmtarray = array(
"drop sequence myseq",
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
$mybv = INITMYBV;
-$r = OCIBindByName($stid, ':MYBV', $mybv);
+$r = oci_bind_by_name($stid, ':MYBV', $mybv);
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$stmtarray = array(
"drop sequence myseq",
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
$mybv = INITMYBV;
-$r = OCIBindByName($stid, ':MYBV', $mybv);
+$r = oci_bind_by_name($stid, ':MYBV', $mybv);
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$stmtarray = array(
"drop sequence myseq",
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
$mybv = INITMYBV;
-$r = OCIBindByName($stid, ':MYBV', $mybv, 5, SQLT_INT);
+$r = oci_bind_by_name($stid, ':MYBV', $mybv, 5, SQLT_INT);
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$drop_st = array();
$drop_st[] = "drop sequence myseq";
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
-$r = OCIBindByName($stid, ':MYBV', $mybv, 0 );
+$r = oci_bind_by_name($stid, ':MYBV', $mybv, 0 );
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$drop_st = array();
$drop_st[] = "drop sequence myseq";
$stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv";
-$stid = OCIParse($c, $stmt);
+$stid = oci_parse($c, $stmt);
if (!$stid) { echo "Parse error"; die; }
-$r = OCIBindByName($stid, ':MYBV', $mybv, 0 );
+$r = oci_bind_by_name($stid, ':MYBV', $mybv, 0 );
if (!$r) { echo "Bind error"; die; }
for ($i = 1; $i < MYLIMIT; $i++) {
- $r = OCIExecute($stid, OCI_DEFAULT);
+ $r = oci_execute($stid, OCI_DEFAULT);
if (!$r) { echo "Execute error"; die; }
var_dump($mybv);
}
-OCICommit($c);
+oci_commit($c);
$drop_st = array();
$drop_st[] = "drop sequence myseq";
$ret = array();
- while (ocifetchinto($cur, $row, OCI_ASSOC)) {
+ while ($row = oci_fetch_assoc($cur)) {
$ret[] = $row;
}
function fetch($c, $i) {
global $s; // (*) Allow parent statement to be available when child is used
- $s = ociparse($c, 'select cursor(select * from bug43492_tab) c from bug43492_tab');
- ociexecute($s, OCI_DEFAULT);
- ocifetchinto($s, $result, OCI_ASSOC);
- ociexecute($result['C'], OCI_DEFAULT);
+ $s = oci_parse($c, 'select cursor(select * from bug43492_tab) c from bug43492_tab');
+ oci_execute($s, OCI_DEFAULT);
+ $result = oci_fetch_assoc($s);
+ oci_execute($result['C'], OCI_DEFAULT);
return $result['C'];
}
for($i = 0; $i < 300; $i++) {
$cur = fetch($c, $i);
for($j = 0; $j < 10; $j++) {
- ocifetchinto($cur, $row, OCI_NUM);
+ $row = oci_fetch_row($cur);
echo "$row[0] ";
}
echo "\n";
- ocifreestatement($cur);
- ocifreestatement($s); // (*) Free the parent statement cleanly
+ oci_free_statement($cur);
+ oci_free_statement($s); // (*) Free the parent statement cleanly
}
echo "Done\n";
oci8_test_sql_execute($c, $stmtarray);
function fetch($c, $i) {
- $s = ociparse($c, 'select cursor(select * from bug43492_tab) c from bug43492_tab');
- ociexecute($s, OCI_DEFAULT);
- ocifetchinto($s, $result, OCI_ASSOC);
- ociexecute($result['C'], OCI_DEFAULT);
+ $s = oci_parse($c, 'select cursor(select * from bug43492_tab) c from bug43492_tab');
+ oci_execute($s, OCI_DEFAULT);
+ $result = oci_fetch_assoc($s);
+ oci_execute($result['C'], OCI_DEFAULT);
return $result['C'];
}
for($i = 0; $i < 300; $i++) {
$cur = fetch($c, $i);
for($j = 0; $j < 10; $j++) {
- ocifetchinto($cur, $row, OCI_NUM);
+ $row = oci_fetch_row($cur);
echo "$row[0] ";
}
echo "\n";
- ocifreestatement($cur);
+ oci_free_statement($cur);
}
echo "Done\n";
require __DIR__."/create_type.inc";
var_dump($coll1 = oci_new_collection($c, $type_name));
-
var_dump($coll1->free());
-var_dump($coll1->size());
+
+try {
+ var_dump($coll1->size());
+} catch (TypeError $error) {
+ var_dump($error->getMessage());
+}
+
+var_dump(oci_new_collection($c, "NONEXISTENT"));
echo "Done\n";
resource(%d) of type (oci8 collection)
}
bool(true)
+string(%d) "OCI-Collection::size(): supplied resource is not a valid oci8 collection resource"
-Warning: OCI-Collection::size(): supplied resource is not a valid oci8 collection resource in %s on line %d
+Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d
bool(false)
Done
+++ /dev/null
---TEST--
-ocinewcollection()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__."/create_type.inc";
-
-var_dump(ocinewcollection($c, $type_name));
-var_dump(ocinewcollection($c, "NONEXISTENT"));
-
-echo "Done\n";
-
-require __DIR__."/drop_type.inc";
-
-?>
---EXPECTF--
-object(OCI-Collection)#%d (1) {
- ["collection"]=>
- resource(%d) of type (oci8 collection)
-}
-
-Warning: ocinewcollection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d
-bool(false)
-Done
+++ /dev/null
---TEST--
-ocinewcollection() + free()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__."/create_type.inc";
-
-var_dump($coll1 = ocinewcollection($c, $type_name));
-
-var_dump($coll1->free());
-var_dump($coll1->size());
-
-echo "Done\n";
-
-require __DIR__."/drop_type.inc";
-
-?>
---EXPECTF--
-object(OCI-Collection)#%d (1) {
- ["collection"]=>
- resource(%d) of type (oci8 collection)
-}
-bool(true)
-
-Warning: OCI-Collection::size(): supplied resource is not a valid oci8 collection resource in %s on line %d
-bool(false)
-Done
+++ /dev/null
---TEST--
-ocinewcollection() + free()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__."/create_type.inc";
-
-var_dump($coll1 = ocinewcollection($c, $type_name));
-
-var_dump(oci_free_collection($coll1));
-var_dump(oci_collection_size($coll1));
-
-echo "Done\n";
-
-require __DIR__."/drop_type.inc";
-
-?>
---EXPECTF--
-object(OCI-Collection)#%d (1) {
- ["collection"]=>
- resource(%d) of type (oci8 collection)
-}
-bool(true)
-
-Warning: oci_collection_size(): supplied resource is not a valid oci8 collection resource in %s on line %d
-bool(false)
-Done
+++ /dev/null
---TEST--
-collection methods
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__."/create_type.inc";
-
-$coll1 = ocinewcollection($c, $type_name);
-
-var_dump($coll1->size());
-var_dump($coll1->max());
-var_dump($coll1->trim(3));
-var_dump($coll1->append(1));
-var_dump($coll1->getElem(0));
-var_dump($coll1->assignElem(0,2));
-
-echo "Done\n";
-
-require __DIR__."/drop_type.inc";
-
-?>
---EXPECTF--
-int(0)
-int(0)
-
-Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d
-bool(false)
-bool(true)
-float(1)
-bool(true)
-Done
+++ /dev/null
---TEST--
-ocicollassign()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__."/create_type.inc";
-
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
-
-var_dump($coll1->append(1));
-
-var_dump($coll2->assign($coll1));
-
-var_dump($coll2->getElem(0));
-
-echo "Done\n";
-
-require __DIR__."/drop_type.inc";
-
-?>
---EXPECT--
-bool(true)
-bool(true)
-float(1)
-Done
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump($coll1->append("2005-07-28"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "2005-07-28"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump($coll1->append(null));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, null));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump($coll1->append("string"));
var_dump($coll1->append("string"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "string"));
var_dump(oci_collection_append($coll1, "string"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump($coll1->append("28-JUL-05"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
-$coll2 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
+$coll2 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "28-JUL-05"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump($coll1->append("28-JUL-05"));
var_dump($coll1->assignElem(0,"01-JAN-05"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "28-JUL-05"));
var_dump(oci_collection_element_assign($coll1, 0, "01-JAN-05"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump($coll1->append("striing"));
var_dump($coll1->assignElem(0,"blah"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "striing"));
var_dump(oci_collection_element_assign($coll1, 0,"blah"));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump($coll1->append(1));
var_dump($coll1->assignElem(0,2345));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, 1));
var_dump(oci_collection_element_assign($coll1,0,2345));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump($coll1->append(1));
var_dump($coll1->assignElem(-1,2345));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, 1));
var_dump(oci_collection_element_assign($coll1,-1,2345));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump($coll1->append("string"));
var_dump($coll1->assignElem(0, null));
".$type_name."
";
-$statement = OCIParse($c,$ora_sql);
-@OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+@oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
-$statement = OCIParse($c,$ora_sql);
-OCIExecute($statement);
+$statement = oci_parse($c,$ora_sql);
+oci_execute($statement);
-$coll1 = ocinewcollection($c, $type_name);
+$coll1 = oci_new_collection($c, $type_name);
var_dump(oci_collection_append($coll1, "string"));
var_dump(oci_collection_element_assign($coll1, 0, null));
+++ /dev/null
---TEST--
-ocicommit()/ocirollback()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__.'/create_table.inc';
-
-$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
-
-if (!($s = ociparse($c, $insert_sql))) {
- die("ociparse(insert) failed!\n");
-}
-
-for ($i = 0; $i<3; $i++) {
- if (!ociexecute($s, OCI_DEFAULT)) {
- die("ociexecute(insert) failed!\n");
- }
-}
-
-var_dump(ocirollback($c));
-
-$select_sql = "SELECT * FROM ".$schema.$table_name."";
-
-if (!($select = ociparse($c, $select_sql))) {
- die("ociparse(select) failed!\n");
-}
-
-if (!oci_execute($select)) {
- die("ociexecute(select) failed!\n");
-}
-var_dump(ocifetchstatement($select, $all));
-var_dump($all);
-
-/* ocifetchstatement */
-if (!ociexecute($s)) {
- die("ociexecute(select) failed!\n");
-}
-
-$insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
-
-if (!($s = ociparse($c, $insert_sql))) {
- die("ociparse(insert) failed!\n");
-}
-
-for ($i = 0; $i<3; $i++) {
- if (!ociexecute($s, OCI_DEFAULT)) {
- die("ociexecute(insert) failed!\n");
- }
-}
-
-var_dump(ocicommit($c));
-
-if (!ociexecute($select)) {
- die("ociexecute(select) failed!\n");
-}
-var_dump(ocifetchstatement($select, $all));
-var_dump($all);
-
-
-require __DIR__.'/drop_table.inc';
-
-echo "Done\n";
-?>
---EXPECT--
-bool(true)
-int(0)
-array(5) {
- ["ID"]=>
- array(0) {
- }
- ["VALUE"]=>
- array(0) {
- }
- ["BLOB"]=>
- array(0) {
- }
- ["CLOB"]=>
- array(0) {
- }
- ["STRING"]=>
- array(0) {
- }
-}
-bool(true)
-int(4)
-array(5) {
- ["ID"]=>
- array(4) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- string(1) "1"
- [3]=>
- string(1) "1"
- }
- ["VALUE"]=>
- array(4) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- string(1) "1"
- [3]=>
- string(1) "1"
- }
- ["BLOB"]=>
- array(4) {
- [0]=>
- NULL
- [1]=>
- NULL
- [2]=>
- NULL
- [3]=>
- NULL
- }
- ["CLOB"]=>
- array(4) {
- [0]=>
- NULL
- [1]=>
- NULL
- [2]=>
- NULL
- [3]=>
- NULL
- }
- ["STRING"]=>
- array(4) {
- [0]=>
- NULL
- [1]=>
- NULL
- [2]=>
- NULL
- [3]=>
- NULL
- }
-}
-Done
}
var_dump(oci_close($c1));
-var_dump(ocilogoff($c2));
+var_dump(oci_close($c2));
echo "Done\n";
+++ /dev/null
---TEST--
-ociplogon() & ocinlogon()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-
-if (!empty($dbase)) {
- var_dump($c1 = ociplogon($user, $password, $dbase));
-}
-else {
- var_dump($c1 = ociplogon($user, $password));
-}
-
-if (!empty($dbase)) {
- var_dump($c2 = ocinlogon($user, $password, $dbase));
-}
-else {
- var_dump($c2 = ocinlogon($user, $password));
-}
-
-var_dump(ocilogoff($c1));
-var_dump(ocilogoff($c2));
-
-echo "Done\n";
-
-?>
---EXPECTF--
-resource(%d) of type (oci8 persistent connection)
-resource(%d) of type (oci8 connection)
-bool(true)
-bool(true)
-Done
+++ /dev/null
---TEST--
-ocilogon()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-
-if (!empty($dbase)) {
- var_dump(ocilogon($user, $password, $dbase));
-}
-else {
- var_dump(ocilogon($user, $password));
-}
-
-echo "Done\n";
-
-?>
---EXPECTF--
-resource(%d) of type (oci8 connection)
-Done
+++ /dev/null
---TEST--
-ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults)
---SKIPIF--
-<?php
-if (!extension_loaded('oci8')) die("skip no oci8 extension");
-ob_start();
-phpinfo(INFO_MODULES);
-$phpinfo = ob_get_clean();
-$ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo);
-if ($ov !== 1) {
- die ("skip Test only valid when OCI8 is built with an ORACLE_HOME");
-}
-?>
---ENV--
-ORACLE_HOME=""
---FILE--
-<?php
-
-require __DIR__."/details.inc";
-
-if (!empty($dbase)) {
- var_dump(ocilogon($user, $password, $dbase));
-}
-else {
- var_dump(ocilogon($user, $password));
-}
-
-?>
---EXPECTF--
-Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d
-
-Warning: ocilogon(): %s ORA-01804
- in %s on line %d
-bool(false)
+++ /dev/null
---TEST--
-ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults)
---SKIPIF--
-<?php
-if (!extension_loaded('oci8')) die("skip no oci8 extension");
-ob_start();
-phpinfo(INFO_MODULES);
-$phpinfo = ob_get_clean();
-$ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo);
-if ($ov !== 1) {
- die ("skip Test only valid when OCI8 is built with an ORACLE_HOME");
-}
-preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches);
-if (!(isset($matches[0]) &&
- (($matches[1] == 11 && $matches[2] >= 2) ||
- ($matches[1] >= 12)
- ))) {
- die("skip test expected to work only with Oracle 11gR2 or greater version of client");
-}
-?>
---ENV--
-ORACLE_HOME=""
---FILE--
-<?php
-
-require __DIR__."/details.inc";
-
-if (!empty($dbase)) {
- var_dump(ocilogon($user, $password, $dbase));
-}
-else {
- var_dump(ocilogon($user, $password));
-}
-
-?>
---EXPECTF--
-Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and %s are set and point to the right directories in %s on line %d
-
-Warning: ocilogon(): Error while trying to retrieve text for error ORA-01804
- in %sconnect_without_oracle_home_old_11.php on line %d
-bool(false)
".$type_name."
";
- $statement = OCIParse($c,$ora_sql);
- @OCIExecute($statement);
+ $statement = oci_parse($c,$ora_sql);
+ @oci_execute($statement);
$ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER(11)";
- $statement = OCIParse($c,$ora_sql);
- OCIExecute($statement);
+ $statement = oci_parse($c,$ora_sql);
+ oci_execute($statement);
}
?>
+++ /dev/null
---TEST--
-fetching cursor from a statement
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require(__DIR__."/connect.inc");
-
-// Initialize
-
-$stmtarray = array(
- "drop table cursors_old_tab",
- "create table cursors_old_tab (id number, value number)",
- "insert into cursors_old_tab (id, value) values (1,1)",
- "insert into cursors_old_tab (id, value) values (1,1)",
- "insert into cursors_old_tab (id, value) values (1,1)",
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-// Run Test
-
-$sql = "select cursor(select * from cursors_old_tab) as curs from dual";
-$stmt = ociparse($c, $sql);
-
-ociexecute($stmt);
-
-while ($result = ocifetchinto($stmt, $data, OCI_ASSOC)) {
- ociexecute($data["CURS"]);
- ocifetchinto($data["CURS"], $subdata, OCI_ASSOC);
- var_dump($subdata);
- var_dump(ocicancel($data["CURS"]));
- ocifetchinto($data["CURS"], $subdata, OCI_ASSOC);
- var_dump($subdata);
- var_dump(ocicancel($data["CURS"]));
-}
-
-// Cleanup
-
-$stmtarray = array(
- "drop table cursors_old_tab"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-echo "Done\n";
-
-?>
---EXPECTF--
-array(2) {
- ["ID"]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
-}
-bool(true)
-
-Warning: ocifetchinto():%sORA-01002: %s in %scursors_old.php on line %d
-array(2) {
- ["ID"]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
-}
-bool(true)
-Done
+++ /dev/null
---TEST--
-ocidefinebyname()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require(__DIR__."/connect.inc");
-
-// Initialize
-
-$stmtarray = array(
- "drop table define_old_tab",
- "create table define_old_tab (string varchar(10))",
- "insert into define_old_tab (string) values ('some')",
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-// Run test
-
-$stmt = ociparse($c, "select string from define_old_tab");
-
-/* the define MUST be done BEFORE ociexecute! */
-
-$string = '';
-ocidefinebyname($stmt, "STRING", $string, 20);
-
-ociexecute($stmt);
-
-while (ocifetch($stmt)) {
- var_dump($string);
-}
-
-// Cleanup
-
-$stmtarray = array(
- "drop table define_old_tab"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-echo "Done\n";
-
-?>
---EXPECT--
-string(4) "some"
-Done
}
-?>
+?>
\ No newline at end of file
+++ /dev/null
---TEST--
-ocierror()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs: different error messages from TimesTen
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-
-if (!empty($dbase)) {
- var_dump(ocilogon($user, $password, $dbase));
-}
-else {
- var_dump(ocilogon($user, $password));
-}
-
-var_dump($s = ociparse($c, "WRONG SYNTAX"));
-var_dump(ociexecute($s));
-var_dump(ocierror($s));
-
-echo "Done\n";
-
-?>
---EXPECTF--
-resource(%s) of type (oci8 connection)
-resource(%s) of type (oci8 statement)
-
-Warning: ociexecute(): ORA-00900: %s in %s on line %d
-bool(false)
-array(4) {
- ["code"]=>
- int(900)
- ["message"]=>
- string(%d) "ORA-00900: %s"
- ["offset"]=>
- int(0)
- ["sqltext"]=>
- string(12) "WRONG SYNTAX"
-}
-Done
--- /dev/null
+--TEST--
+Test if function aliases still exist.
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--FILE--
+<?php
+var_dump(function_exists('ocifreecursor'));
+var_dump(function_exists('ocibindbyname'));
+var_dump(function_exists('ocidefinebyname'));
+var_dump(function_exists('ocicolumnisnull'));
+var_dump(function_exists('ocicolumnname'));
+var_dump(function_exists('ocicolumnsize'));
+var_dump(function_exists('ocicolumnscale'));
+var_dump(function_exists('ocicolumnprecision'));
+var_dump(function_exists('ocicolumntype'));
+var_dump(function_exists('ocicolumntyperaw'));
+var_dump(function_exists('ociexecute'));
+var_dump(function_exists('ocicancel'));
+var_dump(function_exists('ocifetch'));
+var_dump(function_exists('ocifetchstatement'));
+var_dump(function_exists('ocifreestatement'));
+var_dump(function_exists('ociinternaldebug'));
+var_dump(function_exists('ocinumcols'));
+var_dump(function_exists('ociparse'));
+var_dump(function_exists('ocinewcursor'));
+var_dump(function_exists('ociresult'));
+var_dump(function_exists('ociserverversion'));
+var_dump(function_exists('ocistatementtype'));
+var_dump(function_exists('ocirowcount'));
+var_dump(function_exists('ocilogoff'));
+var_dump(function_exists('ocilogon'));
+var_dump(function_exists('ocinlogon'));
+var_dump(function_exists('ociplogon'));
+var_dump(function_exists('ocierror'));
+var_dump(function_exists('ocifreedesc'));
+var_dump(function_exists('ocisavelob'));
+var_dump(function_exists('ocisavelobfile'));
+var_dump(function_exists('ociwritelobtofile'));
+var_dump(function_exists('ociloadlob'));
+var_dump(function_exists('ocicommit'));
+var_dump(function_exists('ocirollback'));
+var_dump(function_exists('ocinewdescriptor'));
+var_dump(function_exists('ocisetprefetch'));
+var_dump(function_exists('ocipasswordchange'));
+var_dump(function_exists('ocifreecollection'));
+var_dump(function_exists('ocinewcollection'));
+var_dump(function_exists('ocicollappend'));
+var_dump(function_exists('ocicollgetelem'));
+var_dump(function_exists('ocicollassignelem'));
+var_dump(function_exists('ocicollsize'));
+var_dump(function_exists('ocicollmax'));
+var_dump(function_exists('ocicolltrim'));
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file
die("oci_execute(select) failed!\n");
}
-while(ocifetch($s)) {
- $row = ociresult($s, 1);
- $row1 = ociresult($s, 2);
+while(oci_fetch($s)) {
+ $row = oci_result($s, 1);
+ $row1 = oci_result($s, 2);
var_dump($row);
var_dump($row1);
}
var_dump(oci_fetch_all($s, $all));
var_dump($all);
-/* ocifetchstatement */
-if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
-}
-
-var_dump(ocifetchstatement($s, $all));
-var_dump($all);
-
// Cleanup
$stmtarray = array(
string(1) "1"
}
}
-int(3)
-array(2) {
- ["ID"]=>
- array(3) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- string(1) "1"
- }
- ["VALUE"]=>
- array(3) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- string(1) "1"
- }
-}
Done
+++ /dev/null
---TEST--
-ocifetchinto()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require(__DIR__."/connect.inc");
-
-// Initialize
-
-$stmtarray = array(
- "drop table fetch_into_tab",
- "create table fetch_into_tab (id number, value number)",
- "insert into fetch_into_tab (id, value) values (1,1)",
- "insert into fetch_into_tab (id, value) values (1,1)",
- "insert into fetch_into_tab (id, value) values (1,1)",
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-// Run Test
-
-if (!($s = oci_parse($c, "select * from fetch_into_tab"))) {
- die("oci_parse(select) failed!\n");
-}
-
-/* ocifetchinto */
-if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
-}
-var_dump(ocifetchinto($s, $all));
-var_dump($all);
-
-/* ocifetchinto */
-if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
-}
-var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS));
-var_dump($all);
-
-// Cleanup
-
-$stmtarray = array(
- "drop table fetch_into_tab"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-echo "Done\n";
-?>
---EXPECT--
-int(2)
-array(2) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
-}
-int(2)
-array(4) {
- [0]=>
- string(1) "1"
- ["ID"]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
-}
-Done
+++ /dev/null
---TEST--
-various ocifetchinto() tests
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__.'/create_table.inc';
-
-$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)";
-
-if (!($s = oci_parse($c, $insert_sql))) {
- die("oci_parse(insert) failed!\n");
-}
-
-for ($i = 0; $i<20; $i++) {
- if (!oci_execute($s)) {
- die("oci_execute(insert) failed!\n");
- }
-}
-
-if (!oci_commit($c)) {
- die("oci_commit() failed!\n");
-}
-
-$select_sql = "SELECT * FROM ".$schema."".$table_name."";
-
-if (!($s = oci_parse($c, $select_sql))) {
- die("oci_parse(select) failed!\n");
-}
-
-if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
-}
-var_dump(ocifetchinto($s, $all, OCI_NUM));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_ASSOC));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_RETURN_LOBS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS+OCI_RETURN_LOBS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS));
-var_dump($all);
-
-require __DIR__.'/drop_table.inc';
-
-echo "Done\n";
-?>
---EXPECT--
-int(5)
-array(2) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
-}
-int(5)
-array(2) {
- ["ID"]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
-}
-int(5)
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- NULL
- [3]=>
- NULL
- [4]=>
- NULL
-}
-int(5)
-array(2) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
-}
-int(5)
-array(4) {
- [0]=>
- string(1) "1"
- ["ID"]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
-}
-int(5)
-array(10) {
- [0]=>
- string(1) "1"
- ["ID"]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
- [2]=>
- NULL
- ["BLOB"]=>
- NULL
- [3]=>
- NULL
- ["CLOB"]=>
- NULL
- [4]=>
- NULL
- ["STRING"]=>
- NULL
-}
-int(5)
-array(10) {
- [0]=>
- string(1) "1"
- ["ID"]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
- [2]=>
- NULL
- ["BLOB"]=>
- NULL
- [3]=>
- NULL
- ["CLOB"]=>
- NULL
- [4]=>
- NULL
- ["STRING"]=>
- NULL
-}
-int(5)
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- NULL
- [3]=>
- NULL
- [4]=>
- NULL
-}
-int(5)
-array(5) {
- ["ID"]=>
- string(1) "1"
- ["VALUE"]=>
- string(1) "1"
- ["BLOB"]=>
- NULL
- ["CLOB"]=>
- NULL
- ["STRING"]=>
- NULL
-}
-int(5)
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- NULL
- [3]=>
- NULL
- [4]=>
- NULL
-}
-Done
+++ /dev/null
---TEST--
-ocifetchinto() & wrong number of params
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__.'/create_table.inc';
-
-$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)";
-
-if (!($s = oci_parse($c, $insert_sql))) {
- die("oci_parse(insert) failed!\n");
-}
-
-for ($i = 0; $i<20; $i++) {
- if (!oci_execute($s)) {
- die("oci_execute(insert) failed!\n");
- }
-}
-
-if (!oci_commit($c)) {
- die("oci_commit() failed!\n");
-}
-
-$select_sql = "SELECT * FROM ".$schema."".$table_name."";
-
-if (!($s = oci_parse($c, $select_sql))) {
- die("oci_parse(select) failed!\n");
-}
-
-if (!oci_execute($s)) {
- die("oci_execute(select) failed!\n");
-}
-var_dump(ocifetchinto($s));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, OCI_ASSOC, 5));
-var_dump($all);
-var_dump(ocifetchinto($c, $all, OCI_RETURN_LOBS));
-var_dump($all);
-var_dump(ocifetchinto($s, $all, 1000000));
-var_dump($all);
-
-require __DIR__.'/drop_table.inc';
-
-echo "Done\n";
-?>
---EXPECTF--
-Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d
-NULL
-
-Notice: Undefined variable $all in %s on line %d
-NULL
-
-Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d
-NULL
-NULL
-
-Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d
-bool(false)
-NULL
-int(5)
-array(2) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
-}
-Done
Test 3
123
-Notice: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object.php on line %d
+Warning: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object.php on line %d
Test 3
123
-Notice: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object_1.php on line %d
+Warning: Undefined property: stdClass::$CASESENSITIVE in %sfetch_object_1.php on line %d
+++ /dev/null
---TEST--
-ocicolumn*() family
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-require __DIR__.'/create_table.inc';
-
-$insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)";
-
-if (!($s = ociparse($c, $insert_sql))) {
- die("ociparse(insert) failed!\n");
-}
-
-for ($i = 0; $i<3; $i++) {
- if (!ociexecute($s)) {
- die("ociexecute(insert) failed!\n");
- }
-}
-
-if (!ocicommit($c)) {
- die("ocicommit() failed!\n");
-}
-
-$select_sql = "SELECT * FROM ".$schema."".$table_name."";
-
-if (!($s = ociparse($c, $select_sql))) {
- die("ociparse(select) failed!\n");
-}
-
-if (!ociexecute($s)) {
- die("ociexecute(select) failed!\n");
-}
-
-ocifetchinto($s, $row, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
-var_dump($row);
-
-foreach ($row as $num => $field) {
- $num++;
- var_dump(ocicolumnisnull($s, $num));
- var_dump(ocicolumnname($s, $num));
- var_dump(ocicolumntype($s, $num));
- var_dump(ocicolumntyperaw($s, $num));
- var_dump(ocicolumnscale($s, $num));
- var_dump(ocicolumnprecision($s, $num));
- var_dump(ocicolumnsize($s, $num));
-}
-
-
-require __DIR__.'/drop_table.inc';
-
-echo "Done\n";
-
-?>
---EXPECT--
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "1"
- [2]=>
- NULL
- [3]=>
- NULL
- [4]=>
- NULL
-}
-bool(false)
-string(2) "ID"
-string(6) "NUMBER"
-int(2)
-int(-127)
-int(0)
-int(22)
-bool(false)
-string(5) "VALUE"
-string(6) "NUMBER"
-int(2)
-int(-127)
-int(0)
-int(22)
-bool(true)
-string(4) "BLOB"
-string(4) "BLOB"
-int(113)
-int(0)
-int(0)
-int(4000)
-bool(true)
-string(4) "CLOB"
-string(4) "CLOB"
-int(112)
-int(0)
-int(0)
-int(4000)
-bool(true)
-string(6) "STRING"
-string(8) "VARCHAR2"
-int(1)
-int(0)
-int(0)
-int(10)
-Done
+++ /dev/null
---TEST--
-Existence of old function aliases
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-var_dump(oci_free_cursor());
-var_dump(ocifreecursor());
-var_dump(ocibindbyname());
-var_dump(ocidefinebyname());
-var_dump(ocicolumnisnull());
-var_dump(ocicolumnname());
-var_dump(ocicolumnsize());
-var_dump(ocicolumnscale());
-var_dump(ocicolumnprecision());
-var_dump(ocicolumntype());
-var_dump(ocicolumntyperaw());
-var_dump(ociexecute());
-var_dump(ocicancel());
-var_dump(ocifetch());
-var_dump(ocifetchstatement());
-var_dump(ocifreestatement());
-var_dump(ociinternaldebug());
-var_dump(ocinumcols());
-var_dump(ociparse());
-var_dump(ocinewcursor());
-var_dump(ociresult());
-var_dump(ociserverversion());
-var_dump(ocistatementtype());
-var_dump(ocirowcount());
-var_dump(ocilogoff());
-var_dump(ocilogon());
-var_dump(ocinlogon());
-var_dump(ociplogon());
-var_dump(ocierror());
-var_dump(ocifreedesc());
-var_dump(ocisavelob());
-var_dump(ocisavelobfile());
-var_dump(ociwritelobtofile());
-var_dump(ociloadlob());
-var_dump(ocicommit());
-var_dump(ocirollback());
-var_dump(ocinewdescriptor());
-var_dump(ocisetprefetch());
-var_dump(ocipasswordchange());
-var_dump(ocifreecollection());
-var_dump(ocinewcollection());
-var_dump(ocicollappend());
-var_dump(ocicollgetelem());
-var_dump(ocicollassignelem());
-var_dump(ocicollsize());
-var_dump(ocicollmax());
-var_dump(ocicolltrim());
-
-echo "Done\n";
-
-?>
---EXPECTF--
-Warning: oci_free_cursor() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocifreecursor() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocibindbyname() expects at least 3 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocidefinebyname() expects at least 3 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocicolumnisnull() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumnname() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumnsize() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumnscale() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumnprecision() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumntype() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ocicolumntyperaw() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ociexecute() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocicancel() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocifetch() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocifetchstatement() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocifreestatement() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-NULL
-
-Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ociparse() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocinewcursor() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ociresult() expects exactly 2 parameters, 0 given in %s on line %d
-bool(false)
-
-Warning: ociserverversion() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocistatementtype() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocilogoff() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocilogon() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocinlogon() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ociplogon() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-bool(false)
-
-Warning: ocifreedesc() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocisavelob() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocisavelobfile() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ociwritelobtofile() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ociloadlob() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocicommit() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocirollback() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocinewdescriptor() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocisetprefetch() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: Wrong parameter count for ocipasswordchange() in %s on line %d
-NULL
-
-Warning: ocifreecollection() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocinewcollection() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocicollappend() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocicollgetelem() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocicollassignelem() expects exactly 3 parameters, 0 given in %s on line %d
-NULL
-
-Warning: ocicollsize() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocicollmax() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocicolltrim() expects exactly 2 parameters, 0 given in %s on line %d
-NULL
-Done
oci8_test_sql_execute($c, $stmtarray);
// Run Test
-
echo "Test 1\n";
-var_dump(ocirowcount());
-var_dump(oci_num_rows());
-var_dump(ocinumcols());
-var_dump(oci_num_fields());
-
-echo "Test 2\n";
$insert_sql = "insert into num_tab (id, value) values (1,1)";
if (!($s = oci_parse($c, $insert_sql))) {
die("oci_parse(insert) failed!\n");
}
-var_dump(ocirowcount($s));
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
for ($i = 0; $i<3; $i++) {
}
}
-echo "Test 3\n";
-var_dump(ocirowcount($s));
+echo "Test 2\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
if (!oci_commit($c)) {
die("oci_commit() failed!\n");
}
-echo "Test 4\n";
-var_dump(ocirowcount($s));
+echo "Test 3\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
// All rows
die("oci_parse(select) failed!\n");
}
-echo "Test 5a\n";
-var_dump(ocirowcount($s));
+echo "Test 4a\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
if (!oci_execute($s)) {
die("oci_execute(select) failed!\n");
}
-echo "Test 5b\n";
-var_dump(ocirowcount($s));
+echo "Test 4b\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
die("oci_fetch_all(select) failed!\n");
}
-echo "Test 5c\n";
-var_dump(ocirowcount($s));
+echo "Test 4c\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
// One row
die("oci_fetch_all(select) failed!\n");
}
-echo "Test 6\n";
-var_dump(ocirowcount($s));
+echo "Test 5\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
// No rows
die("oci_fetch_all(select) failed!\n");
}
-echo "Test 7\n";
-var_dump(ocirowcount($s));
+echo "Test 6\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
$delete_sql = "delete from num_tab";
die("oci_execute(delete) failed!\n");
}
-echo "Test 8a\n";
-var_dump(ocirowcount($s));
+echo "Test 7a\n";
var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
var_dump(oci_num_fields($s));
-
oci_commit($c);
-echo "Test 8b\n";
-var_dump(ocirowcount($s));
-var_dump(oci_num_rows($s));
-var_dump(ocinumcols($s));
-var_dump(oci_num_fields($s));
-
-
// Cleanup
$stmtarray = array(
?>
--EXPECTF--
Test 1
-
-Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
-Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-Test 2
int(0)
int(0)
-int(0)
-int(0)
-Test 3
-int(1)
+Test 2
int(1)
int(0)
-int(0)
-Test 4
-int(1)
+Test 3
int(1)
int(0)
-int(0)
-Test 5a
-int(0)
-int(0)
+Test 4a
int(0)
int(0)
-Test 5b
+Test 4b
int(0)
-int(0)
-int(2)
int(2)
-Test 5c
-int(3)
+Test 4c
int(3)
int(2)
-int(2)
-Test 6
+Test 5
int(1)
-int(1)
-int(2)
int(2)
-Test 7
-int(0)
+Test 6
int(0)
int(1)
-int(1)
-Test 8a
-int(3)
+Test 7a
int(3)
int(0)
-int(0)
-Test 8b
-int(3)
-int(3)
-int(0)
-int(0)
-Done
+Done
\ No newline at end of file
$new_password = "test";
var_dump(oci_password_change($dbase, $user, $password, $new_password));
-var_dump($new_c = ocilogon($user,$new_password,$dbase));
+var_dump($new_c = oci_connect($user,$new_password,$dbase));
var_dump(oci_password_change($dbase, $user, $new_password, $password));
+++ /dev/null
---TEST--
-ocipasswordchange()
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
-require(__DIR__.'/skipif.inc');
-require(__DIR__.'/connect.inc');
-if (empty($dbase)) die ("skip requires database connection string be set");
-if ($test_drcp) die("skip password change not supported in DRCP Mode");
-
-preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv);
-preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches);
-if (!(isset($matches_sv[0]) && isset($matches[0])
- && $matches_sv[1] == $matches[1]
- && $matches_sv[2] == $matches[2]
- && $matches_sv[3] == $matches[3]
- && $matches_sv[4] == $matches[4])) {
- // Avoid diffs due to cross version protocol changes (e.g. like 11.2.0.2-11.2.0.3) and bugs like Oracle bug: 6277160
- die ("skip test only runs when database client libraries and database server are the same version");
-}
-
-// This test in Oracle 12c needs a non-CDB or the root container
-if (isset($matches_sv[0]) && $matches_sv[1] >= 12) {
- $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual");
- $r = @oci_execute($s);
- if (!$r)
- die('skip could not identify container type');
- $r = oci_fetch_array($s);
- if ($r['DBTYPE'] !== 'CDB$ROOT')
- die('skip cannot run test using a PDB');
-}
-?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-
-$new_password = "test";
-var_dump(ocipasswordchange($dbase, $user, $password, $new_password));
-var_dump($new_c = ocilogon($user,$new_password,$dbase));
-var_dump(ocipasswordchange($dbase, $user, $new_password, $password));
-
-echo "Done\n";
-
-?>
---EXPECTF--
-resource(%d) of type (oci8 connection)
-resource(%d) of type (oci8 connection)
-resource(%d) of type (oci8 connection)
-Done
+++ /dev/null
---TEST--
-ocisetprefetch()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require(__DIR__."/connect.inc");
-
-$stmtarray = array(
- "drop table prefetch_old_tab",
- "create table prefetch_old_tab (id number, value number)",
- "insert into prefetch_old_tab (id, value) values (1,1)",
- "insert into prefetch_old_tab (id, value) values (1,1)",
- "insert into prefetch_old_tab (id, value) values (1,1)",
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-// Run Test
-
-if (!ocicommit($c)) {
- die("ocicommit() failed!\n");
-}
-
-$select_sql = "select * from prefetch_old_tab";
-
-if (!($s = ociparse($c, $select_sql))) {
- die("ociparse(select) failed!\n");
-}
-
-var_dump(ocisetprefetch($s, 10));
-
-if (!ociexecute($s)) {
- die("ociexecute(select) failed!\n");
-}
-
-var_dump(ocifetch($s));
-var_dump(ocirowcount($s));
-
-
-// Cleanup
-
-$stmtarray = array(
- "drop table prefetch_old_tab"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-echo "Done\n";
-?>
---EXPECT--
-bool(true)
-bool(true)
-int(1)
-Done
reflection::export(new reflectionfunction('oci_fetch_row'));
reflection::export(new reflectionfunction('oci_fetch_assoc'));
reflection::export(new reflectionfunction('oci_fetch_array'));
-reflection::export(new reflectionfunction('ocifetchinto'));
reflection::export(new reflectionfunction('oci_fetch_all'));
reflection::export(new reflectionfunction('oci_free_statement'));
reflection::export(new reflectionfunction('oci_internal_debug'));
reflection::export(new reflectionfunction('oci_collection_trim'));
reflection::export(new reflectionfunction('oci_new_collection'));
reflection::export(new reflectionfunction('oci_free_cursor'));
-reflection::export(new reflectionfunction('ocifreecursor'));
-reflection::export(new reflectionfunction('ocibindbyname'));
-reflection::export(new reflectionfunction('ocidefinebyname'));
-reflection::export(new reflectionfunction('ocicolumnisnull'));
-reflection::export(new reflectionfunction('ocicolumnname'));
-reflection::export(new reflectionfunction('ocicolumnsize'));
-reflection::export(new reflectionfunction('ocicolumnscale'));
-reflection::export(new reflectionfunction('ocicolumnprecision'));
-reflection::export(new reflectionfunction('ocicolumntype'));
-reflection::export(new reflectionfunction('ocicolumntyperaw'));
-reflection::export(new reflectionfunction('ociexecute'));
-reflection::export(new reflectionfunction('ocicancel'));
-reflection::export(new reflectionfunction('ocifetch'));
-reflection::export(new reflectionfunction('ocifetchstatement'));
-reflection::export(new reflectionfunction('ocifreestatement'));
-reflection::export(new reflectionfunction('ociinternaldebug'));
-reflection::export(new reflectionfunction('ocinumcols'));
-reflection::export(new reflectionfunction('ociparse'));
-reflection::export(new reflectionfunction('ocinewcursor'));
-reflection::export(new reflectionfunction('ociresult'));
-reflection::export(new reflectionfunction('ociserverversion'));
-reflection::export(new reflectionfunction('ocistatementtype'));
-reflection::export(new reflectionfunction('ocirowcount'));
-reflection::export(new reflectionfunction('ocilogoff'));
-reflection::export(new reflectionfunction('ocilogon'));
-reflection::export(new reflectionfunction('ocinlogon'));
-reflection::export(new reflectionfunction('ociplogon'));
-reflection::export(new reflectionfunction('ocierror'));
-reflection::export(new reflectionfunction('ocifreedesc'));
-reflection::export(new reflectionfunction('ocisavelob'));
-reflection::export(new reflectionfunction('ocisavelobfile'));
-reflection::export(new reflectionfunction('ociwritelobtofile'));
-reflection::export(new reflectionfunction('ociloadlob'));
-reflection::export(new reflectionfunction('ocicommit'));
-reflection::export(new reflectionfunction('ocirollback'));
-reflection::export(new reflectionfunction('ocinewdescriptor'));
-reflection::export(new reflectionfunction('ocisetprefetch'));
-reflection::export(new reflectionfunction('ocipasswordchange'));
-reflection::export(new reflectionfunction('ocifreecollection'));
-reflection::export(new reflectionfunction('ocinewcollection'));
-reflection::export(new reflectionfunction('ocicollappend'));
-reflection::export(new reflectionfunction('ocicollgetelem'));
-reflection::export(new reflectionfunction('ocicollassignelem'));
-reflection::export(new reflectionfunction('ocicollsize'));
-reflection::export(new reflectionfunction('ocicollmax'));
-reflection::export(new reflectionfunction('ocicolltrim'));
reflection::export(new reflectionfunction('oci_set_edition'));
reflection::export(new reflectionfunction('oci_set_module_name'));
reflection::export(new reflectionfunction('oci_set_action'));
}
}
-Function [ <internal%s> function ocifetchinto ] {
-
- - Parameters [3] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> &$result ]
- Parameter #2 [ <optional> $mode ]
- }
-}
-
Function [ <internal%s> function oci_fetch_all ] {
- Parameters [5] {
}
}
-Function [ <internal%s> function ocifreecursor ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocibindbyname ] {
-
- - Parameters [5] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_name ]
- Parameter #2 [ <required> &$variable ]
- Parameter #3 [ <optional> $maximum_length ]
- Parameter #4 [ <optional> $type ]
- }
-}
-
-Function [ <internal%s> function ocidefinebyname ] {
-
- - Parameters [4] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_name ]
- Parameter #2 [ <required> &$variable ]
- Parameter #3 [ <optional> $type ]
- }
-}
-
-Function [ <internal%s> function ocicolumnisnull ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumnname ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumnsize ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumnscale ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumnprecision ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumntype ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ocicolumntyperaw ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ociexecute ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <optional> $mode ]
- }
-}
-
-Function [ <internal%s> function ocicancel ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocifetch ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocifetchstatement ] {
-
- - Parameters [5] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> &$output ]
- Parameter #2 [ <optional> $skip ]
- Parameter #3 [ <optional> $maximum_rows ]
- Parameter #4 [ <optional> $flags ]
- }
-}
-
-Function [ <internal%s> function ocifreestatement ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ociinternaldebug ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $mode ]
- }
-}
-
-Function [ <internal%s> function ocinumcols ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ociparse ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $connection_resource ]
- Parameter #1 [ <required> $sql_text ]
- }
-}
-
-Function [ <internal%s> function ocinewcursor ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $connection_resource ]
- }
-}
-
-Function [ <internal%s> function ociresult ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number_or_name ]
- }
-}
-
-Function [ <internal%s> function ociserverversion ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $connection_resource ]
- }
-}
-
-Function [ <internal%s> function ocistatementtype ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocirowcount ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocilogoff ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $connection_resource ]
- }
-}
-
-Function [ <internal%s> function ocilogon ] {
-
- - Parameters [5] {
- Parameter #0 [ <required> $username ]
- Parameter #1 [ <required> $password ]
- Parameter #2 [ <optional> $connection_string ]
- Parameter #3 [ <optional> $character_set ]
- Parameter #4 [ <optional> $session_mode ]
- }
-}
-
-Function [ <internal%s> function ocinlogon ] {
-
- - Parameters [5] {
- Parameter #0 [ <required> $username ]
- Parameter #1 [ <required> $password ]
- Parameter #2 [ <optional> $connection_string ]
- Parameter #3 [ <optional> $character_set ]
- Parameter #4 [ <optional> $session_mode ]
- }
-}
-
-Function [ <internal%s> function ociplogon ] {
-
- - Parameters [5] {
- Parameter #0 [ <required> $username ]
- Parameter #1 [ <required> $password ]
- Parameter #2 [ <optional> $connection_string ]
- Parameter #3 [ <optional> $character_set ]
- Parameter #4 [ <optional> $session_mode ]
- }
-}
-
-Function [ <internal%s> function ocierror ] {
-
- - Parameters [1] {
- Parameter #0 [ <optional> $connection_or_statement_resource ]
- }
-}
-
-Function [ <internal%s> function ocifreedesc ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $lob_descriptor ]
- }
-}
-
-Function [ <internal%s> function ocisavelob ] {
-
- - Parameters [3] {
- Parameter #0 [ <required> $lob_descriptor ]
- Parameter #1 [ <required> $data ]
- Parameter #2 [ <optional> $offset ]
- }
-}
-
-Function [ <internal%s> function ocisavelobfile ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $lob_descriptor ]
- Parameter #1 [ <required> $filename ]
- }
-}
-
-Function [ <internal%s> function ociwritelobtofile ] {
-
- - Parameters [4] {
- Parameter #0 [ <required> $lob_descriptor ]
- Parameter #1 [ <required> $filename ]
- Parameter #2 [ <optional> $start ]
- Parameter #3 [ <optional> $length ]
- }
-}
-
-Function [ <internal%s> function ociloadlob ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $lob_descriptor ]
- }
-}
-
-Function [ <internal%s> function ocicommit ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $connection_resource ]
- }
-}
-
-Function [ <internal%s> function ocirollback ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $connection_resource ]
- }
-}
-
-Function [ <internal%s> function ocinewdescriptor ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $connection_resource ]
- Parameter #1 [ <optional> $type ]
- }
-}
-
-Function [ <internal%s> function ocisetprefetch ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $number_of_rows ]
- }
-}
-
-Function [ <internal%s> function ocipasswordchange ] {
-
- - Parameters [4] {
- Parameter #0 [ <required> $connection_resource_or_connection_string ]
- Parameter #1 [ <required> $username ]
- Parameter #2 [ <required> $old_password ]
- Parameter #3 [ <required> $new_password ]
- }
-}
-
-Function [ <internal%s> function ocifreecollection ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $collection ]
- }
-}
-
-Function [ <internal%s> function ocinewcollection ] {
-
- - Parameters [3] {
- Parameter #0 [ <required> $connection_resource ]
- Parameter #1 [ <required> $type_name ]
- Parameter #2 [ <optional> $schema_name ]
- }
-}
-
-Function [ <internal%s> function ocicollappend ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $collection ]
- Parameter #1 [ <required> $value ]
- }
-}
-
-Function [ <internal%s> function ocicollgetelem ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $collection ]
- Parameter #1 [ <required> $index ]
- }
-}
-
-Function [ <internal%s> function ocicollassignelem ] {
-
- - Parameters [3] {
- Parameter #0 [ <required> $collection ]
- Parameter #1 [ <required> $index ]
- Parameter #2 [ <required> $value ]
- }
-}
-
-Function [ <internal%s> function ocicollsize ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $collection ]
- }
-}
-
-Function [ <internal%s> function ocicollmax ] {
-
- - Parameters [1] {
- Parameter #0 [ <required> $collection ]
- }
-}
-
-Function [ <internal%s> function ocicolltrim ] {
-
- - Parameters [2] {
- Parameter #0 [ <required> $collection ]
- Parameter #1 [ <required> $number ]
- }
-}
-
Function [ <internal%s> function oci_set_edition ] {
- Parameters [1] {
- Parameters [1] {
Parameter #0 [ <required> $statement_resource ]
}
-}
-
+}
\ No newline at end of file
$v = oci_server_version($c);
var_dump(str_replace("\n", "", $v));
-$v = ociserverversion($c);
-var_dump(str_replace("\n", "", $v));
-
echo "Done\n";
?>
--EXPECTF--
resource(%d) of type (oci8 connection)
string(%d) "Oracle %s"
-string(%d) "Oracle %s"
Done
+++ /dev/null
---TEST--
-ocistatementtype()
---SKIPIF--
-<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
---FILE--
-<?php
-
-require __DIR__."/connect.inc";
-
-if (!empty($dbase)) {
- var_dump($c = ocilogon($user, $password, $dbase));
-}
-else {
- var_dump($c = ocilogon($user, $password));
-}
-
-$sqls = Array(
- "SELECT * FROM table",
- "DELETE FROM table WHERE id = 1",
- "INSERT INTO table VALUES(1)",
- "UPDATE table SET id = 1",
- "DROP TABLE table",
- "CREATE OR REPLACE PROCEDURE myproc(v1 NUMBER) as BEGIN DBMS_OUTPUT.PUT_LINE(v1); END;",
- "CREATE TABLE table (id NUMBER)",
- "ALTER TABLE table ADD (col1 NUMBER)",
- "BEGIN NULL; END;",
- "DECLARE myn NUMBER BEGIN myn := 1; END;",
- "CALL myproc(1)",
- "WRONG SYNTAX",
- ""
-);
-
-foreach ($sqls as $sql) {
- $s = ociparse($c, $sql);
- var_dump(ocistatementtype($s));
-}
-
-echo "Done\n";
-
-?>
---EXPECTF--
-resource(%d) of type (oci8 connection)
-string(6) "SELECT"
-string(6) "DELETE"
-string(6) "INSERT"
-string(6) "UPDATE"
-string(4) "DROP"
-string(6) "CREATE"
-string(6) "CREATE"
-string(5) "ALTER"
-string(5) "BEGIN"
-string(7) "DECLARE"
-string(4) "CALL"
-string(7) "UNKNOWN"
-string(7) "UNKNOWN"
-Done