当前位置: 首页>>代码示例>>PHP>>正文


PHP oci_set_prefetch函数代码示例

本文整理汇总了PHP中oci_set_prefetch函数的典型用法代码示例。如果您正苦于以下问题:PHP oci_set_prefetch函数的具体用法?PHP oci_set_prefetch怎么用?PHP oci_set_prefetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了oci_set_prefetch函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _execute

 protected function _execute($sql)
 {
     $this->stmt_id = FALSE;
     $this->_set_stmt_id($sql);
     oci_set_prefetch($this->stmt_id, 1000);
     return @oci_execute($this->stmt_id, $this->_commit);
 }
开发者ID:pepegarcia,项目名称:publicidadoficialdemo-1,代码行数:7,代码来源:oci8_driver.php

示例2: _prefetch

 protected function _prefetch()
 {
     if (!$this->need_pager) {
         if ($total_row_count = $this->stmt->count()) {
             oci_set_prefetch($this->queryId, $total_row_count);
         }
     } else {
         oci_set_prefetch($this->queryId, $this->limit);
     }
 }
开发者ID:knevcher,项目名称:limb,代码行数:10,代码来源:lmbOciRecordSet.class.php

示例3: oci_set_prefetch

    public static function oci_set_prefetch($connection, $statement, $rows) {
        self::checkOCIExtension('oci_set_prefetch');

        $result = @oci_set_prefetch($statement, $rows);
        if ($result === FALSE) {
            $error = self::oci_error($statement);
            throw new IllegalStateException(t(
                'Could not set number of pre fetched records: %error',
                array('%error' => t($error['message']))));
        }
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:11,代码来源:OCIImplHelper.php

示例4: execute

 /**
  * @param $query
  * @param $params
  * @param $action
  */
 public function execute($query, $action, $params = array())
 {
     $this->stid = oci_parse($this->conn, $query);
     if ($this->prefetch >= 0) {
         oci_set_prefetch($this->stid, $this->prefetch);
     }
     foreach ($params as $bv) {
         oci_bind_by_name($this->stid, $bv[0], $bv[1], $bv[2]);
     }
     oci_set_action($this->conn, $action);
     oci_execute($this->stid);
 }
开发者ID:kwakucsc,项目名称:php_framework,代码行数:17,代码来源:Oracle.php

示例5: _execute

 /**
  * Execute the query
  *
  * @param	string	$sql	an SQL query
  * @return	resource
  */
 protected function _execute($sql)
 {
     /* Oracle must parse the query before it is run. All of the actions with
      * the query are based on the statement id returned by oci_parse().
      */
     $this->stmt_id = FALSE;
     $this->_set_stmt_id($sql);
     oci_set_prefetch($this->stmt_id, 1000);
     return oci_execute($this->stmt_id, $this->commit_mode);
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:16,代码来源:oci8_driver.php

示例6: FROM

function &paged_result(&$conn, $select, $binds, $start_row, $rows_per_page)
{
    $end_row = $start_row + $rows_per_page - 1;
    $sql = "SELECT * FROM ( SELECT r.*, ROWNUM AS row_number FROM ( {$select} ) r WHERE ROWNUM <= :end_row ) WHERE :start_row <= row_number";
    $stmt = oci_parse($conn, $sql);
    $binds[':start_row'] = $start_row;
    $binds[':end_row'] = $end_row;
    foreach ($binds as $handle => $var) {
        oci_bind_by_name($stmt, $handle, $binds[$handle]);
    }
    oci_execute($stmt);
    oci_set_prefetch($stmt, $rows_per_page);
    return $stmt;
}
开发者ID:nsahoo,项目名称:cmssw-1,代码行数:14,代码来源:pager_functions.php

示例7: _execute

 /**
  * Execute the query
  *
  * @access  protected  called by the base class
  * @param   string  an SQL query
  * @return  resource
  */
 protected function _execute($sql)
 {
     // oracle must parse the query before it is run. All of the actions with
     // the query are based on the statement id returned by ociparse
     $this->stmt_id = FALSE;
     $this->_set_stmt_id($sql);
     oci_set_prefetch($this->stmt_id, 1000);
     return @oci_execute($this->stmt_id, $this->_commit);
 }
开发者ID:wiliamdecosta,项目名称:ifalconi_oci_responsive,代码行数:16,代码来源:oci8_driver.php

示例8: pq

 function pq($query, $args = array())
 {
     if ($this->debug) {
         print '<h1 class="debug">Debug: Oracle</h1>';
         print SqlFormatter::format($query);
         print_r($args);
     }
     if ($this->stats) {
         $query = preg_replace('/SELECT /', 'SELECT /*+ gather_plan_statistics */ ', $query, 1);
     }
     $stid = oci_parse($this->conn, $query);
     if (!$stid) {
         $e = oci_error($this->conn);
         $this->error('There was an error with Oracle', htmlentities($e['message']));
     }
     oci_set_prefetch($stid, 100);
     // Get variables for prepared query
     $arg_count = preg_match_all('/:\\d+/', $query, $mat);
     for ($i = 0; $i < $arg_count; $i++) {
         oci_bind_by_name($stid, ':' . ($i + 1), $args[$i]);
     }
     // Add a bound variable incase we need it
     if (strpos($query, ':id') !== false) {
         oci_bind_by_name($stid, ":id", $this->id, 8);
     }
     // Add Explain Plan if requested
     if ($this->explain) {
         $exp = oci_parse($this->conn, 'EXPLAIN PLAN FOR ' . $query);
         $arg_count = preg_match_all('/:\\d+/', $query, $mat);
         $r = oci_execute($exp);
         oci_free_statement($exp);
         $plan = oci_parse($this->conn, 'SELECT * FROM TABLE(dbms_xplan.display)');
         $pl = oci_execute($plan);
         $this->plan .= "{$query}\n" . implode(', ', $args) . "\n";
         while ($row = oci_fetch_array($plan, OCI_ASSOC + OCI_RETURN_NULLS)) {
             $this->plan .= $row['PLAN_TABLE_OUTPUT'] . "\n";
         }
         oci_free_statement($plan);
     }
     // Perform the logic of the query
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         //trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
         $this->error('There was an error with Oracle', htmlentities($e['message']));
     }
     $data = array();
     if (strpos($query, 'SELECT') !== false) {
         while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
             #array_push($data, json_decode(json_encode($row), FALSE));
             array_push($data, $row);
         }
     }
     oci_free_statement($stid);
     if ($this->stats) {
         $stat = oci_parse($this->conn, "select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST'))");
         $pl = oci_execute($stat);
         $this->stat .= "{$query}\n" . implode(', ', $args) . "\n";
         while ($row = oci_fetch_array($stat, OCI_ASSOC + OCI_RETURN_NULLS)) {
             $this->stat .= $row['PLAN_TABLE_OUTPUT'] . "\n";
         }
         oci_free_statement($stat);
     }
     return sizeof($data) == 0 ? array() : $data;
 }
开发者ID:KarlLevik,项目名称:SynchWeb,代码行数:65,代码来源:class.oracle.php

示例9: _query

 /**
  * returns query ID if successful, otherwise false
  * this version supports:
  *
  * 1. $db->execute('select * from table');
  *
  * 2. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
  *    $db->execute($prepared_statement, array(1,2,3));
  *
  * 3. $db->execute('insert into table (a,b,c) values (:a,:b,:c)',array('a'=>1,'b'=>2,'c'=>3));
  *
  * 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
  *    $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
  *    $db->execute($stmt);
  */
 function _query($sql, $inputarr = false)
 {
     if (is_array($sql)) {
         // is prepared sql
         $stmt = $sql[1];
         // we try to bind to permanent array, so that oci_bind_by_name is persistent
         // and carried out once only - note that max array element size is 4000 chars
         if (is_array($inputarr)) {
             $bindpos = $sql[3];
             if (isset($this->_bind[$bindpos])) {
                 // all tied up already
                 $bindarr = $this->_bind[$bindpos];
             } else {
                 // one statement to bind them all
                 $bindarr = array();
                 foreach ($inputarr as $k => $v) {
                     $bindarr[$k] = $v;
                     oci_bind_by_name($stmt, ":{$k}", $bindarr[$k], is_string($v) && strlen($v) > 4000 ? -1 : 4000);
                 }
                 $this->_bind[$bindpos] = $bindarr;
             }
         }
     } else {
         $stmt = oci_parse($this->_connectionID, $sql);
     }
     $this->_stmt = $stmt;
     if (!$stmt) {
         return false;
     }
     if (defined('ADODB_PREFETCH_ROWS')) {
         @oci_set_prefetch($stmt, ADODB_PREFETCH_ROWS);
     }
     if (is_array($inputarr)) {
         foreach ($inputarr as $k => $v) {
             if (is_array($v)) {
                 // suggested by g.giunta@libero.
                 if (sizeof($v) == 2) {
                     oci_bind_by_name($stmt, ":{$k}", $inputarr[$k][0], $v[1]);
                 } else {
                     oci_bind_by_name($stmt, ":{$k}", $inputarr[$k][0], $v[1], $v[2]);
                 }
                 if ($this->debug == 99) {
                     if (is_object($v[0])) {
                         echo "name=:{$k}", ' len=' . $v[1], ' type=' . $v[2], '<br>';
                     } else {
                         echo "name=:{$k}", ' var=' . $inputarr[$k][0], ' len=' . $v[1], ' type=' . $v[2], '<br>';
                     }
                 }
             } else {
                 $len = -1;
                 if ($v === ' ') {
                     $len = 1;
                 }
                 if (isset($bindarr)) {
                     // is prepared sql, so no need to oci_bind_by_name again
                     $bindarr[$k] = $v;
                 } else {
                     // dynamic sql, so rebind every time
                     oci_bind_by_name($stmt, ":{$k}", $inputarr[$k], $len);
                 }
             }
         }
     }
     $this->_errorMsg = false;
     $this->_errorCode = false;
     if (oci_execute($stmt, $this->_commit)) {
         if (count($this->_refLOBs) > 0) {
             foreach ($this->_refLOBs as $key => $value) {
                 if ($this->_refLOBs[$key]['TYPE'] == true) {
                     $tmp = $this->_refLOBs[$key]['LOB']->load();
                     if ($this->debug) {
                         ADOConnection::outp("<b>OUT LOB</b>: LOB has been loaded. <br>");
                     }
                     //$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
                     $this->_refLOBs[$key]['VAR'] = $tmp;
                 } else {
                     $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
                     $this->_refLOBs[$key]['LOB']->free();
                     unset($this->_refLOBs[$key]);
                     if ($this->debug) {
                         ADOConnection::outp("<b>IN LOB</b>: LOB has been saved. <br>");
                     }
                 }
             }
         }
//.........这里部分代码省略.........
开发者ID:advancingdesign,项目名称:ADOdb,代码行数:101,代码来源:adodb-oci8.inc.php

示例10: _execute

 protected function _execute()
 {
     if (!@oci_execute($this->_result, $this->_driver->autocommit ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT)) {
         $this->_set_stmt_error(null, PDO::ERRMODE_SILENT, 'execute');
         return false;
     }
     foreach ($this->lobs as $k => &$v) {
         $lob =& $v[0];
         $data =& $v[1];
         if (is_resource($data)) {
             while (!feof($data)) {
                 $lob->write(fread($data, 8192));
             }
         } else {
             $lob->write($data);
         }
     }
     if (0 < ($rows = $this->getAttribute(PDO::ATTR_PREFETCH))) {
         oci_set_prefetch($this->_result, $rows);
     }
     return true;
 }
开发者ID:Deepab23,项目名称:clinic,代码行数:22,代码来源:oci_statement.php

示例11: SepPrefetch

 public function SepPrefetch(int $rows)
 {
     return oci_set_prefetch($this->conn_handle, $rows);
 }
开发者ID:Zniel,项目名称:fl_crtlpanel_self_dev,代码行数:4,代码来源:pm_oracle.class.php

示例12: _execute

 /**
  * Executes given SQL statement. This is an overloaded method.
  *
  * @param string $sql SQL statement
  * @return resource Result resource identifier or null
  * @access protected
  */
 function _execute($sql, $params = array(), $prepareOptions = array())
 {
     if (!$this->connection) {
         $this->_statementId = false;
         return false;
     }
     $this->_statementId = oci_parse($this->connection, $sql);
     if (!$this->_statementId) {
         $this->_setError($this->connection);
         return false;
     }
     if ($this->__transactionStarted) {
         $mode = OCI_DEFAULT;
     } else {
         $mode = OCI_COMMIT_ON_SUCCESS;
     }
     if (!oci_execute($this->_statementId, $mode)) {
         $this->_setError($this->_statementId);
         error_log($sql);
         return false;
     }
     $this->_setError(null, true);
     switch (oci_statement_type($this->_statementId)) {
         case 'DESCRIBE':
         case 'SELECT':
             $this->_scrapeSQL($sql);
             break;
         default:
             return $this->_statementId;
     }
     if ($this->_limit >= 1) {
         oci_set_prefetch($this->_statementId, $this->_limit);
     } else {
         oci_set_prefetch($this->_statementId, 3000);
     }
     $this->_numRows = oci_fetch_all($this->_statementId, $this->_results, $this->_offset, $this->_limit, OCI_NUM | OCI_FETCHSTATEMENT_BY_ROW);
     $this->_currentRow = 0;
     $this->limit();
     return $this->_statementId;
 }
开发者ID:alphp,项目名称:Oracle-cake2,代码行数:47,代码来源:Oracle.php

示例13: setPrefetch

 public function setPrefetch($rows)
 {
     set_error_handler(static::getErrorHandler());
     $isSuccess = oci_set_prefetch($this->resource, $rows);
     restore_error_handler();
     return $isSuccess;
 }
开发者ID:jpina,项目名称:oci8,代码行数:7,代码来源:Oci8Statement.php

示例14: query

 public function query($query, array $bindVariables = null)
 {
     $statment = null;
     if (!array_key_exists($query, $this->_statementCache) && is_array($bindVariables)) {
         // To keep memory constraints down, only cache those statements which can be used
         // with bind variables.
         $this->_statementCache[$query] = oci_parse($this->getConnection(), $query);
         $statement = $this->_statementCache[$query];
         if (count($bindVariables) > 0) {
             foreach ($bindVariables as $bindName => $variable) {
                 oci_bind_by_name($statment, $bindName, $variable);
             }
         }
     } else {
         $statement = oci_parse($this->getConnection(), $query);
     }
     oci_set_prefetch($statement, $this->getPrefetch());
     oci_execute($statement);
     if (!preg_match('/^\\s*select/i', $query)) {
         $this->commit();
     }
     return $statement;
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:23,代码来源:OracleDataStore.php


注:本文中的oci_set_prefetch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。