I am using the Laravel-OCI8 package to communicate with Oracle Database from Laravel. I am calling a function of oracle which returns the result as CLOB. Here is the Laravel Code:
$stmt = $this->pdo_obj->prepare("begin :result := test_pkg.get_data(:param1,:param2,:param3); end;");
$stmt->bindParam(':result', $result, \PDO::PARAM_STR);
$stmt->bindParam(':param1', $param1, \PDO::PARAM_STR);
$stmt->bindParam(':param2', $param2, \PDO::PARAM_STR);
$stmt->bindParam(':param3', $param3, \PDO::PARAM_STR);
$stmt->execute();
return response($result);
But I am getting an error : ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I also tried following:
$response = $this->oracle_obj->select("select test_pkg.get_data('$param1','$param2','$param3') as refc from dual");
But it's not possible to use the above calling in my case as there are DML operations inside my function. Is there any other method to call the function of oracle in Laravel using OCI8?