yajra / pdo-via-oci8

PHP PDO_OCI functions via OCI8 extension
Other
88 stars 61 forks source link

Undefined constant "Yajra\Pdo\Oci8\SQLT_BOL" #131

Open mmn6d6d6e opened 1 year ago

mmn6d6d6e commented 1 year ago

Summary of problem or feature request

Encountering error Undefined constant "Yajra\Pdo\Oci8\SQLT_BOL" when executing stored procedure. To be more specific, when binding OUT parameter.

This works on my local machine, but not on the the another machine. The only difference I noticed between both machine are the OS version and php-oci8. Can't confirm yet.

Recompiled oci8 on the other machine using instantclient 12.2 and it works fine now. So maybe this require oci8 with at least instantclient 12.2?

Code snippet of problem

...
$stmt = DB::getPdo()->prepare($sqlQuery);
...
$stmt->bindParam('kd_detil', $kd_detil, 20, SQLT_INT);
// ^ this trigger the error
...
  Undefined constant "Yajra\Pdo\Oci8\SQLT_BOL"

  at vendor/yajra/laravel-pdo-via-oci8/src/Pdo/Oci8/Statement.php:351
    347▕ 
    348▕                 $this->blobObjects[$parameter] = &$variable;
    349▕                 break;
    350▕ 
  ➜ 351▕             case SQLT_BOL:
    352▕                 $ociType = SQLT_BOL;
    353▕                 break;
    354▕ 
    355▕             default:

  1   app/Models/DetailKontrak.php:259
      Yajra\Pdo\Oci8\Statement::bindParam()

      +1 vendor frames 
  3   app/Console/Commands/SyncBkdCommand.php:227
      Illuminate\Database\Eloquent\Model::save()

System details (My PC, works)

System details (Other Machine, doesnt work)

System details (Other Machine, updated, works)