- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/db/oracleconnection.php
- Класс: BitrixMainDBOracleConnection
- Вызов: OracleConnection::queryInternal
protected function queryInternal($sql, array $binds = null, BitrixMainDiagSqlTrackerQuery $trackerQuery = null)
{
$this->connectInternal();
$trackerQuery?->startQuery($sql, $binds);
$result = oci_parse($this->resource, $sql);
if (!$result)
{
$trackerQuery?->finishQuery();
throw new SqlQueryException("", $this->getErrorMessage($this->resource), $sql);
}
$executionMode = $this->transaction;
/** @var OCI_Lob[] $clob */
$clob = array();
if (!empty($binds))
{
$executionMode = OCI_DEFAULT;
foreach ($binds as $key => $val)
{
$clob[$key] = oci_new_descriptor($this->resource);
oci_bind_by_name($result, ":".$key, $clob[$key], -1, OCI_B_CLOB);
}
}
if (!oci_execute($result, $executionMode))
{
$trackerQuery?->finishQuery();
throw new SqlQueryException("", $this->getErrorMessage($result), $sql);
}
if (!empty($binds))
{
if (oci_num_rows($result) > 0)
{
foreach ($binds as $key => $val)
{
if($clob[$key])
{
$clob[$key]->save($val);
}
}
}
if ($this->transaction == OCI_COMMIT_ON_SUCCESS)
{
oci_commit($this->resource);
}
foreach ($binds as $key => $val)
{
if($clob[$key])
{
$clob[$key]->free();
}
}
}
$trackerQuery?->finishQuery();
$this->lastQueryResult = $result;
return $result;
}