diff options
Diffstat (limited to 'ext/oci8/tests/define_old.phpt')
| -rw-r--r-- | ext/oci8/tests/define_old.phpt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt new file mode 100644 index 0000000..f65e6b8 --- /dev/null +++ b/ext/oci8/tests/define_old.phpt @@ -0,0 +1,48 @@ +--TEST-- +ocidefinebyname() +--SKIPIF-- +<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> +--FILE-- +<?php + +require(dirname(__FILE__)."/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"; + +?> +--EXPECTF-- +%unicode|string%(4) "some" +Done |
