function _close() { if ($this->connection->_stmt === $this->_queryID) $this->connection->_stmt = false; if (!empty($this->_refcursor)) { OCIFreeCursor($this->_refcursor); $this->_refcursor = false; } @OCIFreeStatement($this->_queryID); $this->_queryID = false; }
/** * Free the internal resources associated with $result. * * @return boolean true on success, false if $result is invalid * @access public */ function free() { if (is_resource($this->result) && $this->db->connection) { $free = @OCIFreeCursor($this->result); if ($free === false) { return $this->db->raiseError(null, null, null, 'Could not free result', __FUNCTION__); } } $this->result = false; return MDB2_OK; }
/** * @name registro_db * @param string cadena_sql * @param int numero * @return boolean * @access public */ function registro_db($cadena_sql, $numero) { unset($this->registro); if (!is_resource($this->enlace)) { return FALSE; } //echo "Ejemplo: ".$cadena_sql."<br>"; $cadenaParser = OCIParse($this->enlace, $cadena_sql); $busqueda = OCIExecute($cadenaParser); if ($busqueda) { $j = 0; while (OCIFetchInto($cadenaParser, $row, OCI_RETURN_NULLS)) { $a = 0; $un_campo = 0; $campos = count($row); while ($a < $campos) { $this->registro[$j][$un_campo] = $row[$a++]; $un_campo++; } $j++; //$this->registro[$j][$un_campo] = $salida[$j][$un_campo]; //echo $this->registro[$j][$un_campo]; } $this->conteo = $j--; //echo $this->conteo; @OCIFreeCursor($cadenaParser); return $this->conteo; } else { unset($this->registro); $this->error = oci_error(); //echo $this->error(); return 0; } }
/** * Free the internal resources associated with $result. * * @param $result result identifier * @return bool TRUE on success, FALSE if $result is invalid * @access public */ function freeResult($result) { $result_value = intval($result); if (!isset($this->current_row[$result_value])) { return $this->raiseError(MDB_ERROR, NULL, NULL, 'Free result: attemped to free an unknown query result'); } if (isset($this->highest_fetched_row[$result_value])) { unset($this->highest_fetched_row[$result_value]); } if (isset($this->row_buffer[$result_value])) { unset($this->row_buffer[$result_value]); } if (isset($this->limits[$result_value])) { unset($this->limits[$result_value]); } if (isset($this->current_row[$result_value])) { unset($this->current_row[$result_value]); } if (isset($this->results[$result_value])) { unset($this->results[$result_value]); } if (isset($this->columns[$result_value])) { unset($this->columns[$result_value]); } if (isset($this->result_types[$result_value])) { unset($this->result_types[$result_value]); } return @OCIFreeCursor($result); }
/** * Free the internal resources associated with $result. * * @return boolean true on success, false if $result is invalid * @access public */ function free() { $free = @OCIFreeCursor($this->result); if (!$free) { if (is_null($this->result)) { return MDB2_OK; } return $this->mdb->raiseError(); } $this->result = null; return MDB2_OK; }
private function procesarResultado($cadenaParser, $numeroRegistros) { unset($this->registro); $busqueda = OCIExecute($cadenaParser); if ($busqueda !== TRUE) { $mensaje = "ERROR EN LA CADENA " . $cadena_sql; error_log($mensaje); } if ($busqueda) { // carga una a una las filas en $this->registro while ($row = oci_fetch_array($cadenaParser, OCI_BOTH)) { $this->registro[] = $row; } // si por lo menos una fila es cargada a $this->registro entonces cuenta if (isset($this->registro)) { $this->conteo = count($this->registro); } @OCIFreeCursor($cadenaParser); // en caso de que existan cero (0) registros retorna falso ($this->conteo=false) return $this->conteo; } else { $this->error = oci_error(); echo $this->error(); return 0; } }
function FreeResult($result) { $result_value = intval($result); if (!isset($this->current_row[$result_value])) { return $this->SetError("Free result", "attemped to free an unknown query result"); } unset($this->highest_fetched_row[$result_value]); unset($this->row_buffer[$result_value]); unset($this->limits[$result_value]); unset($this->current_row[$result_value]); unset($this->results[$result_value]); unset($this->columns[$result_value]); unset($this->rows[$result_value]); unset($this->result_types[$result]); return OCIFreeCursor($result); }
/** * @name registro_db * @param string cadena_sql * @param int numero * @return boolean * @access public */ function registro_db($cadena_sql, $numero) { unset($this->registro); if (!is_resource($this->enlace)) { return FALSE; } $cadenaParser = OCIParse($this->enlace, $cadena_sql); if (isset($this->variable_sql)) { OCIBindByName($cadenaParser, $this->variable_sql[0], $salidaSQL, $this->variable_sql[1]); } $busqueda = OCIExecute($cadenaParser); $this->afectadas = oci_num_rows($cadenaParser); if ($busqueda) { $j = 0; while (OCIFetchInto($cadenaParser, $row, OCI_RETURN_NULLS)) { $a = 0; $un_campo = 0; $campos = count($row); while ($a < $campos) { $this->registro[$j][$un_campo] = $row[$a++]; $un_campo++; } $j++; //$this->registro[$j][$un_campo] = $salida[$j][$un_campo]; } if (isset($salidaSQL)) { $this->registro[0][0] = $salidaSQL; $j = 1; unset($this->variable_sql); } $this->conteo = $j--; @OCIFreeCursor($cadenaParser); return $this->conteo; } else { unset($this->registro); $this->error = oci_error(); return 0; } }