MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mquery.class
Ir para a documentação deste ficheiro.
1<?php
6class Oracle8Query extends MQuery
7{
15 function __construct()
16 {
17 parent::__construct();
18 }
19
29 function _querystmt($stmt)
30 {
31 $this->statement = $stmt;
32 $this->fetched = true;
33 $exec = oci_execute($this->statement);
34
35 if (!$exec)
36 throw new EDatabaseQueryException($this->_error());
37
38 $this->rowCount = oci_fetch_all($this->statement, $this->result, $this->offset, $this->maxrows,
40
41 if ($this->rowCount === false)
42 throw new EDatabaseQueryException($this->_error());
43
44 $this->colCount = ocinumcols($this->statement);
45 }
46
54 function _query()
55 {
56 $stmt = oci_parse($this->conn->id, $this->sql);
57
58 if (!$stmt)
59 throw new EDatabaseQueryException();
60
61 $this->_querystmt($stmt);
62 }
63
71 function _error()
72 {
73 $err = oci_error($this->statement);
74 return ($err ? $err['message'] : false);
75 }
76
84 function _close()
85 {
87 }
88
96 function _setmetadata()
97 {
98 $numCols = $this->colCount;
99 $this->metadata = array
100 (
101 );
102
103 for ($i = 0; $i < $numCols; $i++)
104 {
105 $name = strtoupper(OCIColumnName($this->statement, $i + 1));
106 $this->metadata['fieldname'][$i] = $name;
107 $this->metadata['fieldtype'][$name] = $this->_getmetatype(OCIColumnType($this->statement, $i + 1));
108 $this->metadata['fieldlength'][$name] = OCIColumnSize($this->statement, $i + 1);
109 $this->metadata['fieldpos'][$name] = $i;
110 }
111 }
112
123 {
124 $rType = 'N';
125
126 if ($type == "VARCHAR")
127 {
128 $rType = 'C';
129 }
130 elseif ($type == "CHAR")
131 {
132 $rType = 'C';
133 }
134 elseif ($type == "NUMBER")
135 {
136 $rType = 'N';
137 }
138 elseif ($type == "DATE")
139 {
140 $rType = 'T';
141 }
142
143 return $rType;
144 }
145}
146?>
_querystmt($stmt)
Definição mquery.class:29
_getmetatype($type)
Definição mquery.class:122