Hi Boyos!
i fixed the problem rewriting the Connection.php from the OCI8 Driver this way:
Code:
public function storedProcedure(string $package, string $procedure, array $params)
{
if ($package === '' || $procedure === '') {
throw new DatabaseException(lang('Database.invalidArgument', [$package . $procedure]));
}
// Build the query string
$sql = 'BEGIN ' . $package . '.' . $procedure . '(';
$haveCursor = false;
foreach ($params as $param) {
$sql .= $param['name'] . ',';
if (isset($param['type']) && $param['type'] === OCI_B_CURSOR) {
$haveCursor = true;
}
}
$sql = trim($sql, ',') . '); END;';
/** by gus */
try {
// Connect to the database and set the connection ID
$this->connID = $this->connect($this->pConnect);
} catch (Throwable $e) {
$connectionErrors[] = sprintf('Main connection [%s]: %s', $this->DBDriver, $e->getMessage());
log_message('error', 'Error connecting to the database: ' . $e->getMessage());
}
/** by gus */
$this->resetStmtId = false;
$this->stmtId = oci_parse($this->connID, $sql);
$this->bindParams($params);
/** by gus CHANGE FOR NULL */
$result = $this->query($sql, null, $haveCursor);
$this->resetStmtId = true;
/** by gus */
$this->close();
/** by gus */
return $result;
}
/**
* Bind parameters
*
* @param array $params
*
* @return void
*/
protected function bindParams($params)
{
if (! is_array($params) || ! is_resource($this->stmtId)) {
return;
}
foreach ($params as $param) {
foreach (['name', 'value', 'type', 'length'] as $val) {
if (! isset($param[$val])) {
/** by gus */
$param[$val] = null;
/** by gus */
}
}
/** by gus */
$param['length'] = ($param['length'] == null)? -1 : $param['length'];
$param['type'] = ($param['type'] == null)? SQLT_CHR : $param['type'];
/** by gus */
oci_bind_by_name($this->stmtId, $param['name'], $param['value'], $param['length'], $param['type']);
}
}
All yours for testing!
Salute!