Skip to Main Content

SQL & PL/SQL

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!

Simple Trigger Issue?

JazzyBJan 2 2019 — edited Jan 3 2019

I am attempting to create a trigger that will insert values into an audit table for approval by an admin user. The trigger will insert new values that are added into a consultant table into this audit table.

DROP TABLE  MyAuditTable;
CREATE TABLE
MyAuditTable (
  audit_id INTEGER NOT NULL
,
  new_name VARCHAR2
(30),
  new_postcode VARCHAR2
(20),
  status VARCHAR2
(15),
  CONSTRAINT pk_MyAuditTable PRIMARY KEY
( audit_id )
);

drop trigger
MyTrigger;
create trigger
MyTrigger
after insert on my_consultant_table
for each row
begin
  insert
into MyAuditTable values (
  
MySeq.nextval, :new.con_name,
  
:new.con_postcode,
  
'Pending')

end;
/

The trigger has no errors but does not insert data into my audit table.

Ideally looking to create a second trigger so that once 'pending' has been changed to something along the lines of 'authorised' the changes are made.

Can anyone provide insight as to how I can overcome this so that the data is correctly inserted into my audit table and not instantly updated into the consultant table?

Many Thanks!

This post has been answered by AndrewSayer on Jan 3 2019
Jump to Answer

Comments

2841567
Answer

Solved.

Found the mount instructions elsewhere:

[root@oracle7c OVM_EL5U4_X86_OVM_MANAGER_PVM]# fdisk -lu System.img

Disk System.img: 9023 MB, 9023132160 bytes, 17623305 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x0002a119

     Device Boot      Start         End      Blocks   Id  System

System.img1   *          63      192779       96358+  83  Linux

System.img2          192780    13414274     6610747+  83  Linux

System.img3        13414275    17623304     2104515   82  Linux swap / Solaris

mount -t auto -o loop,offset=$((63*512)) System.img /mnt/System

mounted the image file as /mnt/System.

Marked as Answer by 2841567 · Sep 27 2020
1 - 1

Post Details

Added on Jan 2 2019
17 comments
352 views