Oracle sql,在不同方案的表上触发
Oracle sql, trigger on tables in different schemes
我使用以下 sql 创建我的触发器
CREATE OR REPLACE TRIGGER INSERT_LOG
AFTER INSERT
ON EXTERNAL_SCHEME.PAYMENT
FOR EACH ROW
BEGIN
INSERT INTO MY_SCHEMA.DM_LOGGER(ID, TECHNOLOGY, WORKFLOW, NAME_EVENT, TIME_EVENT)
VALUES (PAYMENT.id, 'Repository', 'UP', (select repo.name from
pay_repository repo join pay_pmt pay on repo.id = pay_pmt.repository_id
where repo.id = pay.repository_id),(select to_char(SYSDATE, 'hh24:mi:ss') from dual));
END;
当我执行这个触发器时,我得到以下异常:
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label
我不明白。我与这两个计划都有联系,我从不想改变什么。怎么了?
好像缺少权限,请执行,
grant create trigger to schemaname;
如果它仍然给出错误,那么 select 特权可能在其他模式的表上丢失,为此你可以 运行 这个,
grant select on otherschema.table_name to <schema_name> ;
我使用以下 sql 创建我的触发器
CREATE OR REPLACE TRIGGER INSERT_LOG
AFTER INSERT
ON EXTERNAL_SCHEME.PAYMENT
FOR EACH ROW
BEGIN
INSERT INTO MY_SCHEMA.DM_LOGGER(ID, TECHNOLOGY, WORKFLOW, NAME_EVENT, TIME_EVENT)
VALUES (PAYMENT.id, 'Repository', 'UP', (select repo.name from
pay_repository repo join pay_pmt pay on repo.id = pay_pmt.repository_id
where repo.id = pay.repository_id),(select to_char(SYSDATE, 'hh24:mi:ss') from dual));
END;
当我执行这个触发器时,我得到以下异常:
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label
我不明白。我与这两个计划都有联系,我从不想改变什么。怎么了?
好像缺少权限,请执行,
grant create trigger to schemaname;
如果它仍然给出错误,那么 select 特权可能在其他模式的表上丢失,为此你可以 运行 这个,
grant select on otherschema.table_name to <schema_name> ;