MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mquery.class
Ir para a documentação deste ficheiro.
1
<?php
6
class
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
,
39
OCI_NUM
+
OCI_FETCHSTATEMENT_BY_ROW
);
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
{
86
ocifreestatement
($this->
statement
);
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
122
function
_getmetatype
(
$type
)
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
?>
EDatabaseQueryException
Definição
mexception.class:62
MDataSet\$colCount
$colCount
Definição
mdataset.class:26
MDataSet\$type
$type
Definição
mdataset.class:46
MDataSet\$row
$row
Definição
mdataset.class:16
MQuery
Definição
mquery.class:3
Oracle8Query
Definição
mquery.class:7
Oracle8Query\__construct
__construct()
Definição
mquery.class:15
Oracle8Query\_querystmt
_querystmt($stmt)
Definição
mquery.class:29
Oracle8Query\_close
_close()
Definição
mquery.class:84
Oracle8Query\_setmetadata
_setmetadata()
Definição
mquery.class:96
Oracle8Query\_error
_error()
Definição
mquery.class:71
Oracle8Query\_query
_query()
Definição
mquery.class:54
Oracle8Query\_getmetatype
_getmetatype($type)
Definição
mquery.class:122
classes
database
oracle8
mquery.class
Gerado por
1.10.0