之前的代码如下
CREATE TABLE [dbo].[userinfo] ( [userid] [int] IDENTITY (1, 1) NOT NULL , [username] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [pwd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [erp] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [fullname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [logins] [int] NULL , [lastlogin] [datetime] NULL , [lastip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [rights] [nvarchar] (2250) COLLATE Chinese_PRC_CI_AS NULL , [depid] [int] NULL , [groups] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL , [jiguan] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [sex] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [birthday] [datetime] NULL , [indep_time] [datetime] NULL , [minzu] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [mianmao] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [code] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [wenhua] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [from_time] [datetime] NULL , [to_time] [datetime] NULL , [person_class] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [work_type] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [gongzi] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [content1] [ntext] COLLATE Chinese_PRC_CI_AS NULL , [name1] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [time1] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [content2] [ntext] COLLATE Chinese_PRC_CI_AS NULL , [name2] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [time2] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [train_item] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO
修改后的代码
CREATE TABLE userinfo ( userid NUMBER(20) NOT NULL , username NVARCHAR2 (50) , pwd NVARCHAR2 (50) , erp NVARCHAR2 (50) , fullname NVARCHAR2 (50) , logins NUMBER NULL , lastlogin DATE NULL , lastip NVARCHAR2 (50) , rights NVARCHAR2 (50) , depid NUMBER NULL , groups NVARCHAR2 (250) , jiguan NVARCHAR2 (50) , sex NVARCHAR2 (50) , birthday DATE NULL , indep_time DATE NULL , minzu NVARCHAR2 (50) , mianmao NVARCHAR2 (50) , code NVARCHAR2 (50) , wenhua NVARCHAR2 (50) , from_time DATE NULL , to_time DATE NULL , person_class NVARCHAR2 (50) , work_type NVARCHAR2 (50) , gongzi NVARCHAR2 (50) , content1 nCLOB , name1 NVARCHAR2 (50) , time1 NVARCHAR2 (50) , content2 nCLOB , name2 NVARCHAR2 (50) , time2 NVARCHAR2 (50) , train_item NVARCHAR2 (50) )
CREATE SEQUENCE SE_userinfo INCREMENT BY 1 START WITH 1 maxvalue 999999999 minvalue 1 NOCYCLE NOCACHE NOORDER
create trigger tr_userid before insert on userinfo for each row begin select SE_userinfo.nextval into:new.userid from dual; end;
CREATE TABLE crm_sys_role( id NUMBER(20), remark CLOB, name VARCHAR2(100), constraint sys_role_id_pk primary key (id) );
alter table crm_sys_user add CONSTRAINT crm_sys_userfk_2 FOREIGN KEY (groupId) REFERENCES crm_sys_user_group (id)