diff options
Diffstat (limited to 'ext/oci8/tests/define_old.phpt')
-rw-r--r-- | ext/oci8/tests/define_old.phpt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt new file mode 100644 index 0000000000..e3c8278668 --- /dev/null +++ b/ext/oci8/tests/define_old.phpt @@ -0,0 +1,46 @@ +--TEST-- +ocidefinebyname() +--SKIPIF-- +<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; +--FILE-- +<?php + +require dirname(__FILE__)."/connect.inc"; +require dirname(__FILE__)."/create_table.inc"; + +$insert_sql = "INSERT INTO ".$schema.$table_name." (string) VALUES ('some')"; + +if (!($s = ociparse($c, $insert_sql))) { + die("oci_parse(insert) failed!\n"); +} + +if (!ociexecute($s)) { + die("oci_execute(insert) failed!\n"); +} + +$stmt = ociparse($c, "SELECT string FROM ".$table_name.""); + +/* the define MUST be done BEFORE ociexecute! */ + +$strong = ''; +ocidefinebyname($stmt, "STRING", $string, 20); + +ociexecute($stmt); + +while (ocifetch($stmt)) { + var_dump($string); +} + +require dirname(__FILE__)."/drop_table.inc"; + +echo "Done\n"; + +?> +--EXPECT-- +string(4) "some" +Done |