bind_sqltchr_2.phpt 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. PL/SQL bind with SQLT_CHR
  3. --EXTENSIONS--
  4. oci8
  5. --FILE--
  6. <?php
  7. require(__DIR__.'/connect.inc');
  8. // Initialization
  9. $stmtarray = array(
  10. "create or replace procedure bind_sqltchr_proc (msg_in in varchar2, msg_out out varchar2)
  11. as
  12. begin
  13. msg_out := upper(msg_in);
  14. end;"
  15. );
  16. oci8_test_sql_execute($c, $stmtarray);
  17. // Run Test
  18. echo "Test 1 - PL/SQL IN and OUT variables\n";
  19. $stmt = oci_parse($c, "BEGIN bind_sqltchr_proc(:a, :b); END;");
  20. $msg_in = "Cat got your keyboard?";
  21. oci_bind_by_name($stmt, ":a", $msg_in, -1, SQLT_CHR);
  22. oci_bind_by_name($stmt, ":b", $msg_out, 800, SQLT_CHR);
  23. oci_execute($stmt);
  24. var_dump($msg_in);
  25. var_dump($msg_out);
  26. // Clean up
  27. $stmtarray = array(
  28. "drop procedure bind_sqltchr_proc"
  29. );
  30. oci8_test_sql_execute($c, $stmtarray);
  31. ?>
  32. --EXPECT--
  33. Test 1 - PL/SQL IN and OUT variables
  34. string(22) "Cat got your keyboard?"
  35. string(22) "CAT GOT YOUR KEYBOARD?"