~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/oci8/tests/statement_type_old.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
ocistatementtype()
 
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
if (!empty($dbase)) {
 
11
        var_dump($c = ocilogon($user, $password, $dbase));
 
12
}
 
13
else {
 
14
        var_dump($c = ocilogon($user, $password));
 
15
}
 
16
 
 
17
$sqls = Array(
 
18
    "SELECT * FROM table",
 
19
    "DELETE FROM table WHERE id = 1",
 
20
    "INSERT INTO table VALUES(1)",
 
21
    "UPDATE table SET id = 1",
 
22
        "DROP TABLE table",
 
23
        "CREATE OR REPLACE PROCEDURE myproc(v1 NUMBER) as BEGIN DBMS_OUTPUT.PUT_LINE(v1); END;",
 
24
    "CREATE TABLE table (id NUMBER)",
 
25
    "ALTER TABLE table ADD (col1 NUMBER)",
 
26
    "BEGIN NULL; END;",
 
27
    "DECLARE myn NUMBER BEGIN myn := 1; END;",
 
28
    "CALL myproc(1)",
 
29
    "WRONG SYNTAX",
 
30
    ""
 
31
);
 
32
 
 
33
foreach ($sqls as $sql) {
 
34
        $s = ociparse($c, $sql);
 
35
        var_dump(ocistatementtype($s));
 
36
}
 
37
 
 
38
echo "Done\n";
 
39
 
 
40
?>
 
41
--EXPECTF--
 
42
resource(%d) of type (oci8 connection)
 
43
string(6) "SELECT"
 
44
string(6) "DELETE"
 
45
string(6) "INSERT"
 
46
string(6) "UPDATE"
 
47
string(4) "DROP"
 
48
string(6) "CREATE"
 
49
string(6) "CREATE"
 
50
string(5) "ALTER"
 
51
string(5) "BEGIN"
 
52
string(7) "DECLARE"
 
53
string(4) "CALL"
 
54
string(7) "UNKNOWN"
 
55
string(7) "UNKNOWN"
 
56
Done