MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mconnection.class
Ir para a documentação deste ficheiro.
1<?php
7{
11 var $executemode = OCI_COMMIT_ON_SUCCESS;
12
22 function __construct($conf)
23 {
24 parent::__construct($conf);
25 }
26
40 function _connect($dbhost, $LoginDB, $LoginUID, $LoginPWD, $persistent = true)
41 {
42 if ($persistent)
43 {
44 $this->id = OCIPLogon($LoginUID, $LoginPWD, $LoginDB);
45 }
46 else
47 {
48 $this->id = OCILogon($LoginUID, $LoginPWD, $LoginDB);
49 }
50 }
51
59 function _close()
60 {
61 OCILogOff ($this->id);
62 }
63
73 function _error($resource = null)
74 {
75 $err = oci_error($resource ? $resource : $this->id);
76 return ($err ? $err['message'] : false);
77 }
78
88 function _parse($sql)
89 {
90 $statement = oci_parse($this->id, $sql);
91 return $statement;
92 }
93
105 function _bind($stmt, $ph, $pv)
106 {
107 ocibindbyname($stmt, $ph, $pv);
108 }
109
119 function _execute($sql)
120 {
121 if ($statement = oci_parse($this->id, $sql))
122 {
123 if ($success = oci_execute($statement, $this->executemode))
124 {
125 $this->affectedrows = oci_num_rows($statement);
126 oci_free_statement ($statement);
127 }
128 else
129 {
130 $this->traceback[] = $this->_error($statement);
131 }
132 }
133 else
134 {
135 $this->traceback[] = $this->_error();
136 }
137
138 return $success;
139 }
140
148 function _createquery()
149 {
150 return new Oracle8Query();
151 }
152
162 function _chartotimestamp($timestamp, $format='DD/MM/YYYY HH24:MI:SS')
163 {
164 return ":TO_DATE('" . $timestamp . "','$format') ";
165 }
166
176 function _chartodate($date, $format='DD/MM/YYYY')
177 {
178 return ":TO_DATE('" . $date . "','$format') ";
179 }
180
190 function _timestamptochar($timestamp, $format='DD/MM/YYYY HH24:MI:SS')
191 {
192 return "TO_CHAR($timestamp,'$format') ";
193 }
194
204 function _datetochar($date, $format='DD/MM/YYYY')
205 {
206 return "TO_CHAR($date,'$format') ";
207 }
208}
209?>
_bind($stmt, $ph, $pv)
_chartotimestamp($timestamp, $format='DD/MM/YYYY HH24:MI:SS')
_error($resource=null)
_connect($dbhost, $LoginDB, $LoginUID, $LoginPWD, $persistent=true)
_chartodate($date, $format='DD/MM/YYYY')
_timestamptochar($timestamp, $format='DD/MM/YYYY HH24:MI:SS')
_datetochar($date, $format='DD/MM/YYYY')