create table WEB_CLASSFY
(
ID NUMBER not null,
CLASSNAME varchar2(20),
ONEKEYWORD varchar2(1024),
TWOKEYWORD varchar2(1024),
THREEKEYWORD varchar2(1024),
MAKEDATE NUMBER(20)
)
create sequence WEB_CLASSFY_ID
minvalue 1
nomaxvalue
increment by 1
start with 1
nocache;
int类型:
create or replace trigger WEB_CLASSFY_insertId
before insert on WEB_CLASSFY for each row
begin
select WEB_CLASSFY_ID.nextval into:new.id from dual;
end;
字符串:
create or replace trigger WEB_CLASSFY_insertId
before insert on WEB_CLASSFY for each row
begin
select to_char(WEB_CLASSFY_ID.nextval) into:new.id from dual;
end;
insert into WEB_CLASSFY(CLASSNAME,MAKEDATE) values ('经济');