本文整理汇总了PHP中ADODB_oci8类的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_oci8类的具体用法?PHP ADODB_oci8怎么用?PHP ADODB_oci8使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ADODB_oci8类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _query
function _query($sql, $inputarr = false)
{
if (is_array($inputarr)) {
$i = 0;
if (is_array($sql)) {
foreach ($inputarr as $v) {
$arr['bind' . $i++] = $v;
}
} else {
// Need to identify if the ? is inside a quoted string, and if
// so not use it as a bind variable
preg_match_all('/".*\\??"|\'.*\\?.*?\'/', $sql, $matches);
foreach ($matches[0] as $qmMatch) {
$qmReplace = str_replace('?', '-QUESTIONMARK-', $qmMatch);
$sql = str_replace($qmMatch, $qmReplace, $sql);
}
$sqlarr = explode('?', $sql);
$sql = $sqlarr[0];
foreach ($inputarr as $k => $v) {
$sql .= ":{$k}" . $sqlarr[++$i];
}
$sql = str_replace('-QUESTIONMARK-', '?', $sql);
}
}
return ADODB_oci8::_query($sql, $inputarr);
}
示例2: _query
function _query($sql, $inputarr = false)
{
if (is_array($inputarr)) {
$i = 0;
if (is_array($sql)) {
foreach ($inputarr as $v) {
$arr['bind' . $i++] = $v;
}
} else {
$sqlarr = explode('?', $sql);
$sql = $sqlarr[0];
foreach ($inputarr as $k => $v) {
$sql .= ":{$k}" . $sqlarr[++$i];
}
}
}
return ADODB_oci8::_query($sql, $inputarr);
}
示例3: _query
function _query($sql, $inputarr)
{
if (is_array($inputarr)) {
$i = 0;
$sqlarr = explode('?', $sql);
$sql = $sqlarr[0];
foreach ($inputarr as $v) {
$name = 'bind' . $i++;
$arr[$name] = $v;
$sql .= ":{$name}" . $sqlarr[$i];
}
//print $sql;
//print_r($arr);
} else {
$arr = false;
}
return ADODB_oci8::_query($sql, $arr);
}
示例4: _query
function _query($sql, $inputarr)
{
if (is_array($inputarr)) {
$i = 0;
if (is_array($sql)) {
foreach ($inputarr as $v) {
$arr['bind' . $i++] = $v;
}
} else {
/* PSU mod. DO NOT use ? syntax for bind variables...this breaks our world
and binding on question marks assumes ALL question marks are bind variables...
$sqlarr = explode('?',$sql);
$sql = $sqlarr[0];
foreach($inputarr as $k => $v) {
$sql .= ":$k" . $sqlarr[++$i];
}
*/
}
}
return ADODB_oci8::_query($sql, $inputarr);
}
示例5: ExecuteCursor
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;
}
示例6: foreach
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);
}
示例7: reset
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);
}
示例8: foreach
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;
}
示例9:
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);
}
示例10: UpdateBlobFile
/**
* Usage: store file pointed to by $var in a blob
*/
function UpdateBlobFile($table, $column, $val, $where, $blobtype = 'BLOB')
{
switch (strtoupper($blobtype)) {
default:
print "<b>UpdateBlob</b>: Unknown blobtype={$blobtype}<br>";
return false;
case 'BLOB':
$type = OCI_B_BLOB;
break;
case 'CLOB':
$type = OCI_B_CLOB;
break;
}
if ($this->databaseType == 'oci8po') {
$sql = "UPDATE {$table} set {$column}=EMPTY_{$blobtype}() WHERE {$where} RETURNING {$column} INTO ?";
} else {
$sql = "UPDATE {$table} set {$column}=EMPTY_{$blobtype}() WHERE {$where} RETURNING {$column} INTO :blob";
}
$desc = OCINewDescriptor($this->_connectionID, OCI_D_LOB);
$arr['blob'] = array($desc, -1, $type);
$this->BeginTrans();
$rs = ADODB_oci8::Execute($sql, $arr);
$rez = !empty($rs);
$desc->savefile($val);
$desc->free();
$this->CommitTrans();
if ($rez) {
$rs->Close();
}
return $rez;
}
示例11:
function __construct()
{
parent::__construct();
}