xref: /PHP-7.0/ext/oci8/tests/bind_sqltchr_2.phpt (revision c7a8bd6a)
1--TEST--
2PL/SQL bind with SQLT_CHR
3--SKIPIF--
4<?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
5--FILE--
6<?php
7
8require(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
21oci8_test_sql_execute($c, $stmtarray);
22
23// Run Test
24
25echo "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?";
29oci_bind_by_name($stmt, ":a", $msg_in, -1, SQLT_CHR);
30oci_bind_by_name($stmt, ":b", $msg_out, 800, SQLT_CHR);
31oci_execute($stmt);
32var_dump($msg_in);
33var_dump($msg_out);
34
35// Clean up
36
37$stmtarray = array(
38    "drop procedure bind_sqltchr_proc"
39);
40
41oci8_test_sql_execute($c, $stmtarray);
42
43?>
44===DONE===
45<?php exit(0); ?>
46--EXPECTF--
47Test 1 - PL/SQL IN and OUT variables
48string(22) "Cat got your keyboard?"
49string(22) "CAT GOT YOUR KEYBOARD?"
50===DONE===
51