create or replace trigger snet_tiubr_fnd_app_form
before insert or update on snet_fnd_app_form
for each row
declare
vUserName varchar2(40);
begin
if INSERTING then
if :new.created_date is null then
:new.created_date := sysdate;
end if;
if :new.app_form_id is null then
select wtolentino.S_fnd_app_form.nextval
into :new.app_form_id
from dual;
end if;
if :new.created_by is null then
begin
select ctut_id
into :new.created_by
from tdbxdata.account_reference
where account_id = sys_context('USERENV','SESSION_USER');
exception
when no_data_found then
null;
end;
end if;
end if;
if UPDATING then
if :new.updated_date is null then
:new.updated_date := sysdate;
end if;
if :new.updated_by is null then
begin
select ctut_id
into :new.updated_by
from tdbxdata.account_reference
where account_id = sys_context('USERENV','SESSION_USER');
exception
when no_data_found then
null;
end;
end if;
end if;
end;
/
i am attempting to compile a trigger and was getting an error
SQL> show errors;
Errors for TRIGGER SNET_TIUBR_FND_APP_FORM:
LINE/COL ERROR
-------- -----------------------------------------------
19/25 PL/SQL: ORA-00942: table or view does not exist
17/9 PL/SQL: SQL Statement ignored
37/25 PL/SQL: ORA-00942: table or view does not exist
35/9 PL/SQL: SQL Statement ignored
when i attempt to remove this line of code from the trigger it works
begin
select ctut_id
into :new.created_by
from tdbxdata.account_reference
where account_id = sys_context('USERENV','SESSION_USER');
exception
when no_data_found then
null;
end;
and
begin
select ctut_id
into :new.updated_by
from tdbxdata.account_reference
where account_id = sys_context('USERENV','SESSION_USER');
exception
when no_data_found then
null;
end;
i have a select grants to the tdbxdata.account_reference thru a role. do i need a direct select grants? please advise thanks.
SQL> select count(*) from tdbxdata.account_reference;
COUNT(*)
----------
13841