/*==============================================================*/
/* Table: NTB_EMPLOYEEPLAN */
/*==============================================================*//* tablename:要员计划表主表 */create table ntb_employeeplan (
pk_employeeplan CHAR(20) not null
/*要员计划表主键*/,
pk_budget_year CHAR(4) not null
/*预算年度*/,
pk_deptdoc VARCHAR2(40) not null
/*部门编码*/,
pk_cost_center VARCHAR2(20) not null
/*成本中心编码*/,
pk_position VARCHAR2(48) not null
/*职位编码*/,
pk_level CHAR(20) not null
/*级别编码*/,
pk_staff_type VARCHAR2(20) not null
/*人员类别*/,
person_count DECIMAL(8)
/*人数*/,
headhunter CHAR(2) DEFAULT '2'
/*是否需要猎头*/,
headhunting_fees DECIMAL(8)
/*猎头费*/,
gard CHAR(2) DEFAULT '2'
/*是否为应届毕业生*/,
plan_checkin_time CHAR(6)
/*计划到职时间*/,
plan_pay DECIMAL(8)
/*预计合同工资*/,
add_reason VARCHAR2(500)
/*增员理由*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志*/,
constraint PK_NTB_EMPLOYEEPLAN primary key (pk_employeeplan),
foreign key (pk_cost_center) references ntb_costcenter(pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
)/*==============================================================*/
/* Table: NTB_COSTCENTER */
/*==============================================================*//* tablename:NTB_成本中心表 */create table ntb_costcenter (
pk_costcenter CHAR(20) not null
/*成本中心表主键*/,
pk_costcenter_id VARCHAR2(20) not null
/*成本中心编号*/,
pk_costcenter_name VARCHAR2(40) not null
/*成本中心名称*/,
pk_deptdoc VARCHAR2(40) not null
/*所属部门*/,
starttime CHAR(6) not null
/*开始时间*/,
endtime CHAR(6)
/*结束时间*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志 */,
constraint PK_NTB_COSTCENTER primary key (pk_costcenter,pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
)
/* Table: NTB_EMPLOYEEPLAN */
/*==============================================================*//* tablename:要员计划表主表 */create table ntb_employeeplan (
pk_employeeplan CHAR(20) not null
/*要员计划表主键*/,
pk_budget_year CHAR(4) not null
/*预算年度*/,
pk_deptdoc VARCHAR2(40) not null
/*部门编码*/,
pk_cost_center VARCHAR2(20) not null
/*成本中心编码*/,
pk_position VARCHAR2(48) not null
/*职位编码*/,
pk_level CHAR(20) not null
/*级别编码*/,
pk_staff_type VARCHAR2(20) not null
/*人员类别*/,
person_count DECIMAL(8)
/*人数*/,
headhunter CHAR(2) DEFAULT '2'
/*是否需要猎头*/,
headhunting_fees DECIMAL(8)
/*猎头费*/,
gard CHAR(2) DEFAULT '2'
/*是否为应届毕业生*/,
plan_checkin_time CHAR(6)
/*计划到职时间*/,
plan_pay DECIMAL(8)
/*预计合同工资*/,
add_reason VARCHAR2(500)
/*增员理由*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志*/,
constraint PK_NTB_EMPLOYEEPLAN primary key (pk_employeeplan),
foreign key (pk_cost_center) references ntb_costcenter(pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
)/*==============================================================*/
/* Table: NTB_COSTCENTER */
/*==============================================================*//* tablename:NTB_成本中心表 */create table ntb_costcenter (
pk_costcenter CHAR(20) not null
/*成本中心表主键*/,
pk_costcenter_id VARCHAR2(20) not null
/*成本中心编号*/,
pk_costcenter_name VARCHAR2(40) not null
/*成本中心名称*/,
pk_deptdoc VARCHAR2(40) not null
/*所属部门*/,
starttime CHAR(6) not null
/*开始时间*/,
endtime CHAR(6)
/*结束时间*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志 */,
constraint PK_NTB_COSTCENTER primary key (pk_costcenter,pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
)
这是两条DML语句该两个;号或者/符号
应该是第一个表报错吧
要么就是名为ntb_costcenter 的表已存在?
上面的写反了.我是先建NTB_COSTCENTER ,再建 NTB_EMPLOYEEPLAN表时就报错了,
NTB_COSTCENTER 表的PK_NTB_COSTCENTER 对应NTB_EMPLOYEEPLAN 表的pk_cost_center
下面这句报的错
foreign key (pk_cost_center) references ntb_costcenter(pk_costcenter_id),
/*==============================================================*/
/* Table: NTB_COSTCENTER */
/*==============================================================*/ /* tablename:NTB_成本中心表 */ create table ntb_costcenter (
pk_costcenter CHAR(20) not null
/*成本中心表主键*/,
pk_costcenter_id VARCHAR2(20) not null
/*成本中心编号*/,
pk_costcenter_name VARCHAR2(40) not null
/*成本中心名称*/,
pk_deptdoc VARCHAR2(40) not null
/*所属部门*/,
starttime CHAR(6) not null
/*开始时间*/,
endtime CHAR(6)
/*结束时间*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志 */,
constraint PK_NTB_COSTCENTER primary key (pk_costcenter_id), --去掉字段pk_costcenter
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
);/*==============================================================*/
/* Table: NTB_EMPLOYEEPLAN */
/*==============================================================*/ /* tablename:要员计划表主表 */ create table ntb_employeeplan (
pk_employeeplan CHAR(20) not null
/*要员计划表主键*/,
pk_budget_year CHAR(4) not null
/*预算年度*/,
pk_deptdoc VARCHAR2(40) not null
/*部门编码*/,
pk_cost_center VARCHAR2(20) not null
/*成本中心编码*/,
pk_position VARCHAR2(48) not null
/*职位编码*/,
pk_level CHAR(20) not null
/*级别编码*/,
pk_staff_type VARCHAR2(20) not null
/*人员类别*/,
person_count DECIMAL(8)
/*人数*/,
headhunter CHAR(2) DEFAULT '2'
/*是否需要猎头*/,
headhunting_fees DECIMAL(8)
/*猎头费*/,
gard CHAR(2) DEFAULT '2'
/*是否为应届毕业生*/,
plan_checkin_time CHAR(6)
/*计划到职时间*/,
plan_pay DECIMAL(8)
/*预计合同工资*/,
add_reason VARCHAR2(500)
/*增员理由*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志*/,
constraint PK_NTB_EMPLOYEEPLAN primary key (pk_employeeplan),
foreign key (pk_cost_center) references ntb_costcenter(pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
);
/*==============================================================*/
/* Table: NTB_COSTCENTER */
/*==============================================================*/ /* tablename:NTB_成本中心表 */ create table ntb_costcenter (
pk_costcenter CHAR(20) not null
/*成本中心表主键*/,
pk_costcenter_id VARCHAR2(20) not null
/*成本中心编号*/,
pk_costcenter_name VARCHAR2(40) not null
/*成本中心名称*/,
pk_deptdoc VARCHAR2(40) not null
/*所属部门*/,
starttime CHAR(6) not null
/*开始时间*/,
endtime CHAR(6)
/*结束时间*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志 */,
constraint PK_NTB_COSTCENTER primary key (pk_costcenter,pk_costcenter_id),
constraint UK_NTB_COSTCENTER unique (pk_costcenter_id), --或者增加一个唯一性约束
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
);/*==============================================================*/
/* Table: NTB_EMPLOYEEPLAN */
/*==============================================================*/ /* tablename:要员计划表主表 */ create table ntb_employeeplan (
pk_employeeplan CHAR(20) not null
/*要员计划表主键*/,
pk_budget_year CHAR(4) not null
/*预算年度*/,
pk_deptdoc VARCHAR2(40) not null
/*部门编码*/,
pk_cost_center VARCHAR2(20) not null
/*成本中心编码*/,
pk_position VARCHAR2(48) not null
/*职位编码*/,
pk_level CHAR(20) not null
/*级别编码*/,
pk_staff_type VARCHAR2(20) not null
/*人员类别*/,
person_count DECIMAL(8)
/*人数*/,
headhunter CHAR(2) DEFAULT '2'
/*是否需要猎头*/,
headhunting_fees DECIMAL(8)
/*猎头费*/,
gard CHAR(2) DEFAULT '2'
/*是否为应届毕业生*/,
plan_checkin_time CHAR(6)
/*计划到职时间*/,
plan_pay DECIMAL(8)
/*预计合同工资*/,
add_reason VARCHAR2(500)
/*增员理由*/,
delete_flag CHAR(2) DEFAULT '2'
/*删除标志*/,
constraint PK_NTB_EMPLOYEEPLAN primary key (pk_employeeplan),
foreign key (pk_cost_center) references ntb_costcenter(pk_costcenter_id),
ts char(19) default to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
dr number(10) default 0
);