Annotation of embedaddon/php/ext/oci8/tests/bind_raw.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: bind RAW field
                      3: --SKIPIF--
                      4: <?php
                      5: $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
                      6: require(dirname(__FILE__).'/skipif.inc');
                      7: ?> 
                      8: --FILE--
                      9: <?php
                     10: 
                     11: require dirname(__FILE__)."/connect.inc";
                     12: 
                     13: $stmt = oci_parse($c, "create table phptestrawtable( id number(10), fileimage raw(1000))");
                     14: oci_execute($stmt);
                     15: 
                     16: $stmt = oci_parse ($c, "insert into phptestrawtable (id, fileimage) values (:id, :fileimage)");
                     17: $i=1;
                     18: $fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
                     19: $fileimage = substr($fileimage, 0, 300);
                     20: 
                     21: oci_bind_by_name( $stmt, ":id", $i, -1);
                     22: oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, SQLT_BIN);
                     23: oci_execute($stmt, OCI_DEFAULT);
                     24: oci_commit($c);
                     25: 
                     26: $stmt = oci_parse($c, "SELECT fileimage FROM phptestrawtable");
                     27: oci_execute($stmt);
                     28: 
                     29: $row = oci_fetch_row($stmt);
                     30: var_dump(md5($row[0]));
                     31: var_dump(strlen($row[0]));
                     32: 
                     33: $stmt = oci_parse($c, "drop table phptestrawtable");
                     34: oci_execute($stmt);
                     35: 
                     36: echo "Done\n";
                     37: 
                     38: ?>
                     39: --EXPECT--
                     40: string(32) "88b274d7a257ac6f70435b83abd4e26e"
                     41: int(300)
                     42: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>