用show error来查看错误信息

解决方案 »

  1.   

    我看了,说是出现 语句 DROP,但是我的第一个触发器已经用END表示结束了啊~~~~~
    不解?
    请赐教~~~~~~
      

  2.   

    所用的对象都存在是没有问题的~~~~~~~~~
    是不是在一个.sql文件中只能创建一个触发器啊?
      

  3.   

    drop table t_country;
    /
    create table t_country(country_id number(12),country_name varchar(30));
    /
    drop sequence s_country_id;
    /
    create sequence s_country_id increment by 1 start with 1 maxvalue 999999999;
    create or replace trigger bef_ins_t_country before insert on t_country referencing old as old new as new for each row
    BEGIN
       select s_country_id.nextval into :new.country_id from dual;
    END;
    /
    drop table t_city;
    /
    create table t_city(city_id number(12),city_name varchar(30));
    /
    drop sequence s_city_id;
    /
    create sequence s_city_id increment by 1 start with 1 maxvalue 999999999;
    /
    create or replace trigger bef_ins_t_city before insert on t_city referencing old as old new as new for each row
    BEGIN
       select s_city_id.nextval into :new.city_id from dual;
    END bef_ins_t_city;
    /
    执行一下,ok了?
      

  4.   

    谢谢楼上~~~~~
    已经OK了,在第一个触发器的END后面加一个/就行了~~~~~~~~~
    多谢、小弟初学Oracle 以后还请多多指教~~~~~~
    :)
      

  5.   

    对象不存在,为何要多加一个drop.--报错
    用create or replace用替代.