Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

After Update triggger not fired after update query from PHP

adhiahmadMay 16 2014 — edited May 19 2014

Please help, I have an after update trigger in my oracle xe 11gr2..

The trigger is working perfectly if I did update from SQLPLUS..

Here the trigger:

create or replace

TRIGGER "PENDTRIG"

after update on PENDUDUK

for each row

declare

pragma autonomous_transaction;

BEGIN

INSERT INTO PENDTEMP VALUES (:OLD.NIK,:NEW.NAMA,:NEW.TEMPATLAHIR,

:NEW.TGLLAHIR,:NEW.PROVINSI,:NEW.KOTAKAB,:NEW.KECAMATAN,

:NEW.KELDESA,:NEW.RW,:NEW.RT,:NEW.ALAMAT,:NEW.JENKELAMIN,:NEW.GOLDARAH,

:NEW.AGAMA,:NEW.STATPERNIKAHAN,:NEW.PEKERJAAN,:NEW.KEWARGANEGARAAN,'update');

COMMIT;

END;

But I have a problem, when I did a query update from PHP for something like this:

<?php

date_default_timezone_set('Asia/Jakarta');

include ("oraconn.php");

$update = "update PENDUDUK set NAMA = 'Adhi' where NIK = 3273032502910001";

$statement = oci_parse($c, $update);

oci_execute($statement,OCI_NO_AUTO_COMMIT);

$committed = oci_commit ($c);

  if (!$committed) {

    echo "Proses input gagal!";

  }

?>

The table updated, but the trigger is not fired.. What should I do? Please help!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2014
Added on May 16 2014
3 comments
1,826 views