Home > database >  Database error
Database error

Time:09-24

The create or replace the trigger "aa". "belt_aa" before the insert on "aa", "belt_a" rreferencing old AD "old" bew as "new" for each row enable
The begin
The select s_belt_a. Nextval into: new id sys. Dual;
end;
Error message:
(err) ora - 24344: scuess with compilation error

CodePudding user response:

 
SQL>
SQL> The create table belt_aa (int id, name varchar (10));
The Table created
SQL> The create sequence s_belt_a;
The Sequence created
SQL> The create or replace the trigger tri_belt_aa_ins
2 before the insert on belt_aa
3 for each row
4 the begin
5 select s_belt_a. Nextval into: new id from dual;
6 the end;
7/
The Trigger created
SQL> The begin
2 insert into belt_aa (name) values (" zhang ");
3 the insert into belt_aa (name) values (" wang ");
4 the end;
5/
PL/SQL procedure successfully completed
SQL> Select * from belt_aa;
ID NAME
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zhang
2 wang
SQL> Drop table belt_aa purge;
Table dropped
SQL> The drop sequence s_belt_a;
The Sequence dropped

SQL>

CodePudding user response:

Writing is te wrong,
In oracle, careful with double quotes, can bring unexpected trouble,
  • Related