Oracle Identity column || كثرة الاصدارات للاوراكل لها اسباب
create table students
( id number,
name varchar2(200),
constraint students_pk primary key (id)
);
create sequence students_seq
start with 1;
create or replace trigger students_gen_id
before
insert on students
for each row
begin
:new.id:=students_seq.nextval;
end;
insert into students (name) values ('khaled');
insert into students (name) values ('ali');
select * from students;
---------------------------------------
drop table students;
drop sequence students_seq;
create table students
( id number GENERATED ALWAYS AS IDENTITy,
name varchar2(200),
constraint students_pk primary key (id)
);
insert into students (name) values ('ahmed');
select * from students;
https://www.oracletutorial.com/oracle....