Hi Erman
I have two schemas/users. HR_USER owns a table called DUMMY_PERSON and HRPERSAL_USER owns a table called DUMMY_PER_GEN_DET. I'm trying to create a trigger that will update table DUMMY_PERSON whenever there's a new insert in a column called PERSALNO on table DUMMY_PER_GEN_DET. I'm getting an error which says table or view doesn't exist, but I granted HRPERSAL_USER update and insert privileges on table DUMMY_PERSON. This is my code: create or replace TRIGGER DUMMY_HRPERSAL_TRIGGER AFTER INSERT OR UPDATE ON DUMMY_PER_GEN_DET FOR EACH ROW WHEN (new.R_INDICATOR = '0') BEGIN INSERT INTO DUMMY_PERSON (PERSALNO,COL_SEQ) VALUES (:new.PERSALNO,DUMMY_HRPERSAL_SEQ.NEXTVAL); END; Is there something which maybe I didn't include in my code? |
Administrator
|
1)Who is the owner of the trigger?
2)what happens when you create trigger with the following -> create or replace TRIGGER DUMMY_HRPERSAL_TRIGGER AFTER INSERT OR UPDATE ON DUMMY_PER_GEN_DET FOR EACH ROW WHEN (new.R_INDICATOR = '0') BEGIN INSERT INTO HR_USER.DUMMY_PERSON (PERSALNO,COL_SEQ) VALUES (:new.PERSALNO,DUMMY_HRPERSAL_SEQ.NEXTVAL); END; (change - HR_USER.DUMMY_PERSON) |
Thanks for your response, 1) HRPERSAL_USER is the owner of the trigger
On Tue, Nov 7, 2017 at 10:27 AM, ErmanArslansOracleBlog [via Erman Arslan's Oracle Forum] <[hidden email]> wrote: 1)Who is the owner of the trigger? |
Administrator
|
What error are you getting during compilation?
|
Administrator
|
Also, set the following in your session and reproduce the problem in the same session.
ALTER SESSION SET EVENTS '942 trace name context forever, level 1'; Send me trace file after that.. |
In reply to this post by ErmanArslansOracleBlog
I just noticed that table DUMMY_PERSON has just been updated, it took very long to update thou. Do you maybe know why it takes very long to update? If so how can one reduce the amount of time it takes to update.On Tue, Nov 7, 2017 at 11:26 AM, ErmanArslansOracleBlog [via Erman Arslan's Oracle Forum] <[hidden email]> wrote: What error are you getting during compilation? |
Administrator
|
What?
you just said that you had compilation error? So your update problem solved? Please clarify that first. After that, answer the following.. What update are you doing? How many rows are there in the table? What columns are there and what about the indexes on that table? How many indexes and what are the size of them? |
I got the following messages: compiled (with errors)I did an insert in the PERSALNO column on the DUMMY_PER_GEN_DET table I checked the DUMMY_PERSON table, and noticed that it had updated the PERSALNO column.On Tue, Nov 7, 2017 at 11:51 AM, ErmanArslansOracleBlog [via Erman Arslan's Oracle Forum] <[hidden email]> wrote: What? |
Administrator
|
So?any updates?
|
Well the trigger seems to be working, thanks man On 08 Nov 2017 10:03 AM, "ErmanArslansOracleBlog [via Erman Arslan's Oracle Forum]" <[hidden email]> wrote: So?any updates? |
Free forum by Nabble | Edit this page |