Annotation of embedaddon/php/ext/oci8/tests/bind_sqltchr_2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PL/SQL bind with SQLT_CHR
3: --SKIPIF--
4: <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
5: --FILE--
6: <?php
7:
8: require(dirname(__FILE__).'/connect.inc');
9:
10: // Initialization
11:
12: $stmtarray = array(
13: "create or replace procedure bind_sqltchr_proc (msg_in in varchar2, msg_out out varchar2)
14: as
15: begin
16: msg_out := upper(msg_in);
17: end;"
18:
19: );
20:
21: oci8_test_sql_execute($c, $stmtarray);
22:
23: // Run Test
24:
25: echo "Test 1 - PL/SQL IN and OUT variables\n";
26:
27: $stmt = oci_parse($c, "BEGIN bind_sqltchr_proc(:a, :b); END;");
28: $msg_in = "Cat got your keyboard?";
29: oci_bind_by_name($stmt, ":a", $msg_in, -1, SQLT_CHR);
30: oci_bind_by_name($stmt, ":b", $msg_out, 800, SQLT_CHR);
31: oci_execute($stmt);
32: var_dump($msg_in);
33: var_dump($msg_out);
34:
35: // Clean up
36:
37: $stmtarray = array(
38: "drop procedure bind_sqltchr_proc"
39: );
40:
41: oci8_test_sql_execute($c, $stmtarray);
42:
43: ?>
44: ===DONE===
45: <?php exit(0); ?>
46: --EXPECTF--
47: Test 1 - PL/SQL IN and OUT variables
48: string(22) "Cat got your keyboard?"
49: string(22) "CAT GOT YOUR KEYBOARD?"
50: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>