Exemplo n.º 1
0
 function Prepare($sql, $cursor = false)
 {
     $sqlarr = explode('?', $sql);
     $sql = $sqlarr[0];
     for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) {
         $sql .= ':' . ($i - 1) . $sqlarr[$i];
     }
     return ADODB_oci8::Prepare($sql, $cursor);
 }
	function ExecuteCursor($sql,$cursorName='rs',$params=false)
	{
		if (is_array($sql)) $stmt = $sql;
		else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor

		if (is_array($stmt) && sizeof($stmt) >= 5) {
			$hasref = true;
			$ignoreCur = false;
			$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
			if ($params) {
				foreach($params as $k => $v) {
					$this->Parameter($stmt,$params[$k], $k);
				}
			}
		} else
			$hasref = false;

		$rs = $this->Execute($stmt);
		if ($rs) {
			if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
			elseif ($hasref) $rs->_refcursor = $stmt[4];
		}
		return $rs;
	}
 function &ExecuteCursor($sql, $cursorName = 'rs', $params = false)
 {
     $stmt = ADODB_oci8::Prepare($sql, true);
     # true to allocate OCINewCursor
     if (is_array($stmt) && sizeof($stmt) >= 5) {
         $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
         if ($params) {
             foreach ($params as $k => $v) {
                 $this->Parameter($stmt, $params[$k], $k);
             }
         }
     }
     return $this->Execute($stmt);
 }
Exemplo n.º 4
0
 function &ExecuteCursor($sql, $cursorName = 'rs', $params = false)
 {
     $stmt = ADODB_oci8::Prepare($sql);
     if (is_array($stmt) && sizeof($stmt) >= 5) {
         $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
         if ($params) {
             reset($params);
             while (list($k, $v) = each($params)) {
                 $this->Parameter($stmt, $params[$k], $k);
             }
         }
     }
     return $this->Execute($stmt);
 }
Exemplo n.º 5
0
 function &ExecuteServicior($sql, $serviciorName = 'rs', $params = false)
 {
     if (is_array($sql)) {
         $stmt = $sql;
     } else {
         $stmt = ADODB_oci8::Prepare($sql, true);
     }
     # true to allocate OCINewServicior
     if (is_array($stmt) && sizeof($stmt) >= 5) {
         $hasref = true;
         $this->Parameter($stmt, $ignoreCur, $serviciorName, false, -1, OCI_B_SERVICIOR);
         if ($params) {
             foreach ($params as $k => $v) {
                 $this->Parameter($stmt, $params[$k], $k);
             }
         }
     } else {
         $hasref = false;
     }
     $rs =& $this->Execute($stmt);
     if ($rs) {
         if ($rs->databaseType == 'array') {
             OCIFreeServicior($stmt[4]);
         } else {
             if ($hasref) {
                 $rs->_refservicior = $stmt[4];
             }
         }
     }
     return $rs;
 }
 function &ExecuteCursor($sql, $cursorName = 'rs')
 {
     $stmt = ADODB_oci8::Prepare($sql);
     if (is_array($stmt) && sizeof($stmt) >= 5) {
         $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
     }
     return $this->Execute($stmt);
 }