本文整理汇总了PHP中ociexecute函数的典型用法代码示例。如果您正苦于以下问题:PHP ociexecute函数的具体用法?PHP ociexecute怎么用?PHP ociexecute使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ociexecute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
function query($SQLCmd)
{
if (!$this->isConnect) {
return null;
}
$stmt = ociparse($this->connection, $SQLCmd);
ociexecute($stmt, OCI_DEFAULT);
$results = array();
oci_fetch_all($stmt, $results, 0, -1, OCI_FETCHSTATEMENT_BY_COLUMN);
$rs = new ResultSet();
$rs->setHolder($results);
oci_free_statement($stmt);
return $rs;
}
示例2: OracleSelectQueryResult
/**
* Creates a new OracleSelectQueryResult object.
* Creates a new OracleSelectQueryResult object.
* @access public
* @param integer $resourceId The resource id for this SELECT query.
* @param integer $linkId The link identifier for the database connection.
* @return object OracleSelectQueryResult A new OracleSelectQueryResult object.
*/
function OracleSelectQueryResult($resourceId, $linkId)
{
// ** parameter validation
$resourceRule = ResourceValidatorRule::getRule();
ArgumentValidator::validate($resourceId, $resourceRule, true);
ArgumentValidator::validate($linkId, $resourceRule, true);
// ** end of parameter validation
$this->_resourceId = $resourceId;
$this->_linkId = $linkId;
$this->_currentRowIndex = 0;
$this->_currentRow = array();
$this->_currentRow[BOTH] = array();
$this->_currentRow[NUMERIC] = array();
$this->_currentRow[ASSOC] = array();
$this->_numRows = ocifetchstatement($this->_resourceId);
ociexecute($this->_resourceId);
// if we have at least one row in the result, fetch its array
if ($this->hasMoreRows()) {
ocifetchinto($this->_resourceId, $this->_currentRow[BOTH], OCI_ASSOC + OCI_NUM + OCI_RETURN_LOBS);
foreach ($this->_currentRow[BOTH] as $key => $value) {
if (is_int($key)) {
$this->_currentRow[NUMERIC][$key] = $value;
} else {
$this->_currentRow[ASSOC][$key] = $value;
}
}
}
}
示例3: insert_id
function insert_id($table)
{
$sql = "SELECT max(id) ID FROM {$table}";
$query = ociparse($this->conn, $sql);
ociexecute($query);
ocifetchinto($query, $row, OCI_BOTH);
return $row[ID];
}
示例4: num_rows
/**
* Number of rows in the result set.
*
* Oracle doesn't have a graceful way to retun the number of rows
* so we have to use what amounts to a hack.
*
*
* @access public
* @return integer
*/
function num_rows()
{
$rowcount = count($this->result_array());
@ociexecute($this->stmt_id);
if ($this->curs_id) {
@ociexecute($this->curs_id);
}
return $rowcount;
}
示例5: realisateurParId
public static function realisateurParId($id)
{
$bd = new Mconnect();
$connect = $bd->getRessource();
$stmt = ociparse($connect, "select p.ID_PERS, p.NOM_PERS, p.PRENOM_PERS\r\t\t\t\t\t\t\t\t\tfrom PERSONNE p, REALISER r\r\t\t\t\t\t\t\t\t\tWHERE p.ID_PERS=r.ID_PERS\r\t\t\t\t\t\t\t\t\tAND r.ID_FILM='" . $id . "'");
ociexecute($stmt, OCI_DEFAULT);
$tab = Mutilitaire::tableau($stmt);
return $tab;
$bd->close();
}
示例6: exec
/**
* Execute an SQL query
* @param String sql
*/
public function exec($sql)
{
$this->debugInfo($sql);
$stmt = ociparse($this->conn, $sql);
$stmt_type = ocistatementtype($stmt);
if (!ociexecute($stmt)) {
trigger_error($this->lastError(), E_USER_ERROR);
return 0;
}
return 1;
}
示例7: num_rows
/**
* Number of rows in the result set.
*
* Oracle doesn't have a graceful way to retun the number of rows
* so we have to use what amounts to a hack.
*
*
* @access public
* @return integer
*/
function num_rows()
{
if ($this->num_rows === 0 && count($this->result_array()) > 0) {
$this->num_rows = count($this->result_array());
@ociexecute($this->stmt_id);
if ($this->curs_id) {
@ociexecute($this->curs_id);
}
}
return $this->num_rows;
}
示例8: ociparse
function &_doQuery($queryString)
{
$stmt = ociparse($this->_connection, $queryString);
if ($stmt && ociexecute($stmt)) {
$rs =& new CopixDbResultSetOci8($stmt);
$rs->_connector =& $this;
return $rs;
} else {
return false;
}
}
示例9: select_genres
public function select_genres()
{
//Connexion à la base
$bd = new Mconnect();
$connect = $bd->getRessource();
$stmt = ociparse($connect, "select NOM_GENRE, ID_GENRE from GENRE ORDER BY NOM_GENRE");
//On parse la requête à effectuer sans oublier de lui passer la chaine de connexion en paramêtre
ociexecute($stmt, OCI_DEFAULT);
//On execute la requête en lui passant l'option OCI_DEFAULT
$bd->close();
$tab = Mutilitaire::tableau($stmt);
return $tab;
}
示例10: db_query
/**
* db_query() - Query the database
*
* NOTE - the OCI version of this may be somewhat inefficient
* for large result sets (hundreds or thousands of rows selected)
* However - most queries are returning 25-50 rows
*
* @param string SQL statement
* @param int How many rows do you want returned
* @param int Of matching rows, return only rows starting here
*/
function db_query($qstring, $limit = '-1', $offset = 0)
{
global $QUERY_COUNT, $sys_db_results, $sys_db_row_pointer, $sys_db_oci_commit_mode;
$QUERY_COUNT++;
$stmt = @ociparse($gfconn, $qstring);
if (!$stmt) {
return 0;
} else {
if ($limit > 0) {
if (!$offset || $offset < 0) {
$offset = 0;
}
}
$res = @ociexecute($stmt, $sys_db_oci_commit_mode);
if (!$res) {
return 0;
} else {
//if offset, seek to starting point
//potentially expensive if large offset
//however there is no data_seek feature AFAICT
$more_data = true;
if ($offset > 0) {
for ($i = 0; $i < $offset; $i++) {
//burn them off
@ocifetchinto($res, $x);
if (!$x[1]) {
//if no data be returned
//get out of loop
$more_data = false;
break;
}
}
}
$i = 0;
while ($more_data) {
$i++;
@ocifetchinto($res, $x, 'OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS');
$sys_db_results[$res][$i - 1] = $x;
//see if data is being returned && we are
//still within the requested $limit
if (count($x) < 1 || $limit > 0 && $i >= $limit) {
$more_data = false;
}
}
$sys_db_row_pointer[$res] = 0;
return $res;
}
}
}
示例11: query_exec
function query_exec($query)
{
# IMPORT MYSQL PARAMETERS (NOTE: IT WORKS WITH ABSOLUTE PATH ONLY !!)
include '../config/registry_oracle_db.php';
# open connection to db
//putenv("ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0");
$conn = OCILogOn($user_db, $password_db, $db) or die("Could not connect to Oracle database!") or die(ocierror());
# execute the EXEC query
$statement = ociparse($conn, $query);
$risultato = ociexecute($statement);
# close connection
ocilogoff($conn);
$a = 1;
return $a;
}
示例12: db_exec
function db_exec($qstring,$conn)
{
global $strLastSQL,$dDebug;
if ($dDebug===true)
echo $qstring."<br>";
$strLastSQL=$qstring;
$stmt=ociparse($conn,$qstring);
$stmt_type=ocistatementtype($stmt);
if(!ociexecute($stmt))
{
trigger_error(db_error($conn), E_USER_ERROR);
return 0;
}
else
return 1;
}
示例13: batchProcess
public function batchProcess($batch_id, $username)
{
// $result = array();
$sql = " DECLARE " . " v_result VARCHAR2(90); " . " BEGIN " . " PKG_PROC_BATCH.proc_batch(:params1,:params2, :v_result); END;";
//$params = array($period, $username, $batch_type);
$params = array(array('name' => ':params1', 'value' => $batch_id, 'type' => SQLT_CHR, 'length' => 100), array('name' => ':params2', 'value' => $username, 'type' => SQLT_CHR, 'length' => 32));
// Bind the output parameter
$stmt = oci_parse($this->db->conn_id, $sql);
foreach ($params as $p) {
// Bind Input
oci_bind_by_name($stmt, $p['name'], $p['value'], $p['length']);
}
$message = '';
oci_bind_by_name($stmt, ':v_result', $message, 32);
ociexecute($stmt);
return $message;
}
示例14: query_oracle
function query_oracle($sql)
{
$db = get_oracle_db();
if (!$db) {
return false;
}
$r = oci_parse($db, $sql);
if ($r === false) {
return false;
}
$qresult = ociexecute($r);
if ($qresutl === false) {
return false;
}
//var_dump(oci_fetch_array($r));
//oci_fetch_all($r, $result);
return oci_fetch_array($r);
return $result;
}
示例15: db_query
function db_query($ASql, $AQueryType = 0)
{
global $conn;
$ASql = "/*" . $_SERVER['REMOTE_ADDR'] . ", " . $_SERVER['SCRIPT_FILENAME'] . ", " . date('d.m.Y H:i', time()) . "*/" . $ASql;
$result = oci_parse($conn, $ASql);
$return = array();
ociexecute($result, OCI_DEFAULT);
switch ($AQueryType) {
case 0:
$return = oci_fetch_array($result, OCI_ASSOC);
break;
case 1:
while ($row = oci_fetch_array($result, OCI_ASSOC)) {
$return[] = $row;
}
break;
}
return $return;
}