PHP-Oracle Binding

I’ve got a problem on  CakePHP-Oracle when doing INSERT/UPDATE operation to a field with large size text.

The error usually  “string literal too long”.

I’ve tried to use binding which works like a charm (at least until now), here’s the example:

$conn = OCILogon(‘username’, ‘password’, ‘databasename’);
$stmt  = ‘INSERT INTO pegawai(pegawaiid, namapegawai, alamat) ‘;
$stmt .= ‘VALUES(:pid, :nama, :alm)’;

$stid = OCIParse($conn, $stmt);

OCIBindByName($stid, “:pid”,   $f_id , 4);
OCIBindByName($stid, “:nama”, $f_name, -1);
OCIBindByName($stid, “:alm”, $f_address, -1);


The number 4 on the binding pid is the numeric digit width.