bind_sqltchr_2.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. require(dirname(__FILE__).'/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. ===DONE===
  33. <?php exit(0); ?>
  34. --EXPECTF--
  35. Test 1 - PL/SQL IN and OUT variables
  36. string(22) "Cat got your keyboard?"
  37. string(22) "CAT GOT YOUR KEYBOARD?"
  38. ===DONE===