xref: /PHP-8.1/ext/oci8/tests/bind_sqltchr_2.phpt (revision 74859783)
1--TEST--
2PL/SQL bind with SQLT_CHR
3--EXTENSIONS--
4oci8
5--FILE--
6<?php
7
8require(__DIR__.'/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--EXPECT--
45Test 1 - PL/SQL IN and OUT variables
46string(22) "Cat got your keyboard?"
47string(22) "CAT GOT YOUR KEYBOARD?"
48