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


PHP OCINewCursor函数代码示例

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


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

示例1: Prepare

 function Prepare($sql, $cursor = false)
 {
     static $BINDNUM = 0;
     $stmt = OCIParse($this->_connectionID, $sql);
     if (!$stmt) {
         return false;
     }
     $BINDNUM += 1;
     $sttype = @OCIStatementType($stmt);
     if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
         return array($sql, $stmt, 0, $BINDNUM, $cursor ? OCINewCursor($this->_connectionID) : false);
     }
     return array($sql, $stmt, 0, $BINDNUM);
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:14,代码来源:adodb-oci8.inc.php

示例2: Prepare

	function Prepare($sql,$cursor=false)
	{
	static $BINDNUM = 0;

		$stmt = OCIParse($this->_connectionID,$sql);

		if (!$stmt) {
			$this->_errorMsg = false;
			$this->_errorCode = false;
			$arr = @OCIError($this->_connectionID);
			if ($arr === false) return false;

			$this->_errorMsg = $arr['message'];
			$this->_errorCode = $arr['code'];
			return false;
		}

		$BINDNUM += 1;

		$sttype = @OCIStatementType($stmt);
		if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
			return array($sql,$stmt,0,$BINDNUM, ($cursor) ? OCINewCursor($this->_connectionID) : false);
		}
		return array($sql,$stmt,0,$BINDNUM);
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:25,代码来源:adodb-oci8.old.inc.php

示例3: Prepare

	function Prepare($sql,$cursor=false)
	{
	static $BINDNUM = 0;
	
		$stmt = OCIParse($this->_connectionID,$sql);

		if (!$stmt) return false;

		$BINDNUM += 1;
		
		if (@OCIStatementType($stmt) == 'BEGIN') {
			return array($sql,$stmt,0,$BINDNUM, ($cursor) ? OCINewCursor($this->_connectionID) : false);
		} 
		
		return array($sql,$stmt,0,$BINDNUM);
	}
开发者ID:songchin,项目名称:Cacti,代码行数:16,代码来源:adodb-oci8.inc.php

示例4: query

 function query($Query_String)
 {
     /* No empty queries, please, since PHP4 chokes on them. */
     if ($Query_String == "") {
         /* The empty query string is passed on from the constructor,
          * when calling the class without a query, e.g. in situations
          * like these: '$db = new DB_Sql_Subclass;'
          */
         return 0;
     }
     $this->connect();
     $this->Query_ID = OCIParse($this->Link_ID, $Query_String);
     if (!$this->Query_ID) {
         $this->Error = OCIError($this->Query_ID);
         $this->Halt($this->Error);
     } else {
         $old_error_reporting = error_reporting();
         error_reporting($old_error_reporting & ~E_WARNING);
         if (sizeof($this->Binds) > 0) {
             foreach ($this->Binds as $parameter_name => $parameter_values) {
                 if ($parameter_values[2] == OCI_B_CURSOR) {
                     $this->Binds[$parameter_name][0] = OCINewCursor($this->Link_ID);
                 }
                 if ($parameter_values[2] == 0) {
                     OCIBindByName($this->Query_ID, ":" . $parameter_name, $this->Binds[$parameter_name][0], $parameter_values[1]);
                 } else {
                     OCIBindByName($this->Query_ID, ":" . $parameter_name, $this->Binds[$parameter_name][0], $parameter_values[1], $parameter_values[2]);
                 }
             }
         }
         OCIExecute($this->Query_ID);
         error_reporting($old_error_reporting);
         $this->Error = OCIError($this->Query_ID);
     }
     $this->Row = 0;
     if ($this->Debug) {
         printf("Debug: query = %s<br>\n", $Query_String);
     }
     if ($this->Error["code"] != 0 && $this->sqoe) {
         $this->Halt($this->Error);
     }
     #echo "<BR><FONT color=red><B>".$this->Error["message"]."<BR>Query :\"$Query_String\"</B></FONT>";
     if (sizeof($this->Binds) > 0) {
         $bi = 0;
         foreach ($this->Binds as $parameter_name => $parameter_values) {
             if ($parameter_values[2] == OCI_B_CURSOR) {
                 OCIExecute($this->Binds[$parameter_name][0]);
                 $this->Error = OCIError($this->Binds[$parameter_name][0]);
                 $this->Query_ID = $this->Binds[$parameter_name][0];
             }
             $this->Record[$parameter_name] = $parameter_values[0];
             $this->Record[$bi++] = $parameter_values[0];
         }
         $this->Binds = array();
     }
     return $this->Query_ID;
 }
开发者ID:santo-s,项目名称:do_sql.js,代码行数:57,代码来源:db_oci8.php

示例5: Prepare

 function Prepare($sql)
 {
     static $BINDNUM = 0;
     $stmt = OCIParse($this->_connectionID, $sql);
     if (!$stmt) {
         return $sql;
     }
     // error in statement, let Execute() handle the error
     $BINDNUM += 1;
     if (@OCIStatementType($stmt) == 'BEGIN') {
         return array($sql, $stmt, 0, $BINDNUM, OCINewCursor($this->_connectionID));
     }
     return array($sql, $stmt, 0, $BINDNUM);
 }
开发者ID:cbsistem,项目名称:bansos-dev,代码行数:14,代码来源:adodb-oci8.inc.php

示例6: _execute


//.........这里部分代码省略.........
                 // Test to see if descriptor has already been created for this
                 // variable (i.e. if it has been bound more than once):
                 if (!is_a($this->values[$parameter], "OCI-Lob")) {
                     $this->values[$parameter] = @OCINewDescriptor($connection, OCI_D_FILE);
                     if (false === $this->values[$parameter]) {
                         $result = $this->db->raiseError(null, null, null, 'Unable to create descriptor for BFILE in parameter: ' . $parameter, __FUNCTION__);
                         break;
                     }
                 }
                 if (!@OCIBindByName($this->statement, ':' . $parameter, $this->values[$parameter], -1, $type)) {
                     $result = $this->db->raiseError($this->statement, null, null, 'Could not bind BFILE parameter', __FUNCTION__);
                     break;
                 }
             } else {
                 if ($type == OCI_B_ROWID) {
                     // Test to see if descriptor has already been created for this
                     // variable (i.e. if it has been bound more than once):
                     if (!is_a($this->values[$parameter], "OCI-Lob")) {
                         $this->values[$parameter] = @OCINewDescriptor($connection, OCI_D_ROWID);
                         if (false === $this->values[$parameter]) {
                             $result = $this->db->raiseError(null, null, null, 'Unable to create descriptor for ROWID in parameter: ' . $parameter, __FUNCTION__);
                             break;
                         }
                     }
                     if (!@OCIBindByName($this->statement, ':' . $parameter, $this->values[$parameter], -1, $type)) {
                         $result = $this->db->raiseError($this->statement, null, null, 'Could not bind ROWID parameter', __FUNCTION__);
                         break;
                     }
                 } else {
                     if ($type == OCI_B_CURSOR) {
                         // Test to see if cursor has already been allocated for this
                         // variable (i.e. if it has been bound more than once):
                         if (!is_resource($this->values[$parameter]) || !get_resource_type($this->values[$parameter]) == "oci8 statement") {
                             $this->values[$parameter] = @OCINewCursor($connection);
                             if (false === $this->values[$parameter]) {
                                 $result = $this->db->raiseError(null, null, null, 'Unable to allocate cursor for parameter: ' . $parameter, __FUNCTION__);
                                 break;
                             }
                         }
                         if (!@OCIBindByName($this->statement, ':' . $parameter, $this->values[$parameter], -1, $type)) {
                             $result = $this->db->raiseError($this->statement, null, null, 'Could not bind CURSOR parameter', __FUNCTION__);
                             break;
                         }
                     } else {
                         $maxlength = array_key_exists($parameter, $this->type_maxlengths) ? $this->type_maxlengths[$parameter] : -1;
                         $this->values[$parameter] = $this->db->quote($this->values[$parameter], $type, false);
                         $quoted_values[$i] =& $this->values[$parameter];
                         if (PEAR::isError($quoted_values[$i])) {
                             return $quoted_values[$i];
                         }
                         if (!@OCIBindByName($this->statement, ':' . $parameter, $quoted_values[$i], $maxlength)) {
                             $result = $this->db->raiseError($this->statement, null, null, 'could not bind non-abstract parameter', __FUNCTION__);
                             break;
                         }
                     }
                 }
             }
         }
         ++$i;
     }
     $lob_keys = array_keys($lobs);
     if (!PEAR::isError($result)) {
         $mode = !empty($lobs) || $this->db->in_transaction ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS;
         if (!@OCIExecute($this->statement, $mode)) {
             $err = $this->db->raiseError($this->statement, null, null, 'could not execute statement', __FUNCTION__);
             return $err;
开发者ID:MusicalAPP,项目名称:gfk-api-spotify-itunes,代码行数:67,代码来源:oci8.php

示例7: sqlCompile

function sqlCompile($Query_String)
{
    $db = new clsDBdatabase();
    $db->Provider->sqoe = 0;
    $esto = array(chr(10), chr(9), chr(13));
    $porEsto = array("\n", "\t", " ");
    $parse = '
	declare
		c integer := dbms_sql.open_cursor();
	begin
		dbms_sql.parse(c, :STMT, dbms_sql.native);
		dbms_sql.close_cursor(c);
	end;
	';
    $plsql = trim(str_replace($esto, $porEsto, $Query_String));
    #echo $plsql ;
    #$Query_String = 'select a from dual';
    $db->bind('STMT', $plsql, 4000, SQLT_CHR);
    #$db->query('BEGIN '.trim(str_replace($esto, $porEsto, $parse)).' END;');
    $db->Query_ID = OCIParse($db->Link_ID, 'BEGIN ' . trim(str_replace($esto, $porEsto, $parse)) . ' END;');
    if (!$db->Query_ID) {
        $db->Error = OCIError($db->Link_ID);
        echo 'ERROR ' . OCIError($db->Link_ID);
    }
    if (sizeof($db->Provider->Binds) > 0) {
        foreach ($db->Provider->Binds as $parameter_name => $parameter_values) {
            if ($parameter_values[2] == OCI_B_CURSOR) {
                $this->db[$parameter_name][0] = OCINewCursor($db->Link_ID);
            }
            if ($parameter_values[2] == 0) {
                OCIBindByName($db->Query_ID, ":" . $parameter_name, $db->Provider->Binds[$parameter_name][0], $parameter_values[1]);
            } else {
                OCIBindByName($db->Query_ID, ":" . $parameter_name, $db->Provider->Binds[$parameter_name][0], $parameter_values[1], $parameter_values[2]);
            }
        }
    }
    @OCIExecute($db->Query_ID);
    $db->Error = OCIError($db->Query_ID);
    #var_dump($db->Error);
    $SQLCODE = $db->Error['code'];
    $SQLERRMSG = explode('ORA-06512', $db->Error['message']);
    $SQLERRMSG = $SQLERRMSG[0];
    $error = new stdClass();
    $error->SQLCODE = !$SQLCODE ? 0 : $SQLCODE;
    $error->SQLERRMSG = $SQLERRMSG;
    return $error;
}
开发者ID:santo-s,项目名称:do_sql.js,代码行数:47,代码来源:do_sql_from_string.php


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