SQL> CREATE OR REPLACE
2 TRIGGER c##iam_admin.AFTER_LOGON_TRG AFTER LOGON ON c##iam_admin.SCHEMA
3 BEGIN DBMS_APPLICATION_INFO.set_module(USER, 'Initialized');
4 EXECUTE IMMEDIATE 'ALTER SESSION SET current_schema=c##iam';
5 END c##iam_admin.AFTER_LOGON_TRG;
6 /
Warning: Trigger created with compilation errors.
当我检查显示错误时,它会给出
Errors for TRIGGER C##IAM_ADMIN.AFTER_LOGON_TRG:
PLS-00103:遇到符号“。”当期待其中一个 以下内容:
答案 0 :(得分:1)
未经测试,但结束标记应该只是标签而不是限定名称。尝试:
create or replace trigger c##iam_admin.after_logon_trg
after logon on c##iam_admin.schema
begin
dbms_application_info.set_module(user, 'Initialized');
execute immediate 'ALTER SESSION SET current_schema=c##iam';
end after_logon_trg;
我现在无法测试,我不确定你甚至可以在那里使用结束标记,所以如果这不起作用,请尝试以
结尾end;