如题,我这有脚本文件,里面有很多语句:
create sequence TTE_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
cache 20
order;create table CATEGORY
(
CAT_KEY NUMBER(38) not null,
PARENT_KEY NUMBER(38) not null,
PARENT_TYPE NUMBER(38) not null,
CAT_NAME VARCHAR2(64) not null,
CHILD_TYPE NUMBER(38) not null
);alter table CATEGORY
add constraint CATEGORY primary key (CAT_KEY)
using index;
alter table CATEGORY
add constraint PC unique (PARENT_KEY, CAT_NAME)
using index; create table USERS
(
USE_ID VARCHAR2(64) not null,
USE_NAME VARCHAR2(64) not null,
USE_PASSWORD VARCHAR2(64) not null,
USE_DEPT VARCHAR2(64),
USE_JOB VARCHAR2(64),
USE_TEL VARCHAR2(64),
USE_EMAIL VARCHAR2(64),
USE_KEY NUMBER(38) not null,
USE_ADMIN NUMBER
);alter table USERS
add constraint USE_KEY primary key (USE_KEY)
using index;
alter table USERS
add constraint USE_ID unique (USE_ID)
using index; create table MANAGER_ORNOT
(
MAN_ID NUMBER,
MAN_NAME VARCHAR2(4)
);create table TEST_PROJECT
(
TP_KEY NUMBER(38) not null,
TP_CREATED_DATETIME DATE not null,
TP_LASTMODIFIED_DATETIME DATE not null,
TP_NAME VARCHAR2(64) not null,
CAT_KEY NUMBER(38) not null,
TP_CREATOR NUMBER(38) not null,
TP_LASTMODITOR NUMBER(38) not null
);
alter table TEST_PROJECT
add constraint TESTPROJECT primary key (TP_KEY)
using index;
alter table TEST_PROJECT
add constraint TC unique (TP_NAME, CAT_KEY)
using index;
alter table TEST_PROJECT
add constraint CAT_KEY foreign key (CAT_KEY)
references CATEGORY (CAT_KEY) on delete cascade;
create table TEST_TABLE_BASE_INFO
(
TTBASE_KEY NUMBER(38) not null,
TAB_SEQUENCE NUMBER(38) not null,
TAB_NAME VARCHAR2(128) not null,
USE_KEY NUMBER(38),
TP_KEY NUMBER(38) not null
);
alter table TEST_TABLE_BASE_INFO
add constraint TESTTABLEBASE primary key (TTBASE_KEY)
using index;
alter table TEST_TABLE_BASE_INFO
add constraint TT unique (TAB_NAME, TP_KEY)
using index;alter table TEST_TABLE_BASE_INFO
add constraint TP_KEY2 foreign key (TP_KEY)
references TEST_PROJECT (TP_KEY) on delete cascade;create table VERSION_TYPE
(
VT_KEY NUMBER(38) not null,
VT_NAME VARCHAR2(64) not null,
TP_KEY NUMBER(38) not null,
VT_TYPE NUMBER(38),
UL_TIME DATE not null,
VT_LASTMODITOR NUMBER(38) not null,
PHA_KEY NUMBER(38)
);
alter table VERSION_TYPE
add constraint VERSIONTYPE primary key (VT_KEY)
using index;
alter table VERSION_TYPE
add constraint TP_KEY foreign key (TP_KEY)
references TEST_PROJECT (TP_KEY) on delete cascade;
create table TEST_TABLE
(
TAB_KEY NUMBER(38) not null,
VT_KEY NUMBER(38) not null,
UL_TIME DATE not null,
TTBASE_KEY NUMBER(38) not null,
USE_KEY NUMBER(38)
);
alter table TEST_TABLE
add constraint TESTVT primary key (TAB_KEY)
using index;
alter table TEST_TABLE
add constraint TTBASEINFO_KEY foreign key (TTBASE_KEY)
references TEST_TABLE_BASE_INFO (TTBASE_KEY) on delete cascade;
alter table TEST_TABLE
add constraint VT_KEY foreign key (VT_KEY)
references VERSION_TYPE (VT_KEY) on delete cascade;create table WORK_ITEM
(
WOR_KEY NUMBER(38) not null,
TAB_KEY NUMBER(38) not null,
WOR_SEQUENCE NUMBER(38) not null,
WOR_ID VARCHAR2(1024) not null,
WOR_NAME VARCHAR2(1024) not null
);
alter table WORK_ITEM
add constraint WORKITEM primary key (WOR_KEY)
using index;
alter table WORK_ITEM
add constraint TAB_KEY foreign key (TAB_KEY)
references TEST_TABLE (TAB_KEY) on delete cascade;create table OPERATING_STEP
(
OPE_KEY NUMBER(38) not null,
WOR_KEY NUMBER(38) not null,
OPE_SEQUENCE NUMBER(38),
OPE_NAME VARCHAR2(2048),
OPE_EXPECT VARCHAR2(2048),
OPE_SERTIME VARCHAR2(64),
OPE_SATTIME VARCHAR2(64),
OPE_REAL VARCHAR2(1024),
OPE_OPERATOR VARCHAR2(64),
OPE_AUDITOR VARCHAR2(64),
OPE_AUDTIME DATE,
OPE_INSTRUCTION VARCHAR2(512)
);
alter table OPERATING_STEP
add constraint OPS primary key (OPE_KEY)
using index;
alter table OPERATING_STEP
add constraint WOR_KEY foreign key (WOR_KEY)
references WORK_ITEM (WOR_KEY) on delete cascade;
create table OPS_INS_RELATION
(
OPE_KEY NUMBER(38) not null,
INS_KEY NUMBER(38) not null
);create table SATELLITE
(
SAT_KEY NUMBER(38) not null,
SAT_ID VARCHAR2(16) not null,
SAT_NAME VARCHAR2(64) not null,
USE_KEY NUMBER(38) not null
);
alter table SATELLITE
add constraint SAT_KEY primary key (SAT_KEY)
using index;
alter table SATELLITE
add constraint SAT_ID unique (SAT_ID)
using index; create table PHASE
(
PHA_KEY NUMBER(38) not null,
SAT_KEY NUMBER(38) not null,
PHA_NAME VARCHAR2(64) not null
);
alter table PHASE
add constraint PHASE primary key (PHA_KEY)
using index ;alter table PHASE
add constraint SP unique (SAT_KEY, PHA_NAME)
using index;
alter table PHASE
add constraint EWQ foreign key (SAT_KEY)
references SATELLITE (SAT_KEY) on delete cascade;create table PRIVILEGE
(
PRI_KEY NUMBER(38) not null,
PRI_NAME VARCHAR2(255) not null,
PRI_ID NUMBER(38) not null
);
alter table PRIVILEGE
add constraint PRIVILEGE primary key (PRI_KEY)
using index;
create table USER_PRIVILEGE
(
UP_KEY NUMBER(38) not null,
USE_KEY NUMBER(38) not null,
PRI_ID NUMBER(38) not null
);
alter table USER_PRIVILEGE
add constraint USER_PRIVILEGE_RELATION primary key (UP_KEY)
using index;
create table VT_TYPE
(
VT_TYPE NUMBER(38) not null,
VT_TYPE_NAME VARCHAR2(32) not null
);
alter table VT_TYPE
add constraint VERSION primary key (VT_TYPE)
using index; create or replace trigger CATEGORY_TRIGGER
before insert on category
for each row
declare
begin
select TTE_SEQ.nextval into:new.CAT_KEY from sys.dual ;
end CATEGORY_TRIGGER;
/
create or replace trigger OPE_INS_TRIGGER
before insert on ops_ins_relation
for each row
declarebegin
select TTE_SEQ.nextval into:new.OPE_KEY from sys.dual ;
end OPE_INS_TRIGGER;
/
create or replace trigger OS_Trigger
before insert on operating_step
for each row
declarebegin
select TTE_SEQ.nextval into:new.OPE_KEY from sys.dual;
end OS_Trigger;
/
create or replace trigger Phase_Trigger
before insert on phase
for each row
declare
begin
select TTE_SEQ.nextval into:new.PHA_KEY from sys.dual ;
end Phase_Trigger;
/
create or replace trigger satellite
before insert on satellite
for each row
declare
begin
select TTE_SEQ.nextval into:new.SAT_KEY from sys.dual ;
end satellite;
/
create or replace trigger TP_Trigger
before insert on test_project
for each row
declare
begin
select TTE_SEQ.nextval into:new.TP_KEY from sys.dual;
end TP_Trigger;
/
create or replace trigger TT_BASE_INFO_TRIGGER
before insert on test_table_base_info
for each row
declare
begin
select TTE_SEQ.nextval into:new.TTBASE_KEY from sys.dual ;
end TT_BASE_INFO_TRIGGER;
/
create or replace trigger tt_test
before insert on test_table
for each row
declare
begin
select TTE_SEQ.nextval into:new.TAB_KEY from sys.dual ;
end tt_test;
/
create or replace trigger UP_TRIGGER
before insert on user_privilege
for each row
declare
begin
select TTE_SEQ.nextval into:new.UP_KEY from sys.dual ;
end UP_TRIGGER;
/
create or replace trigger user_trigger
before insert on users
for each row
begin
select TTE_SEQ.nextval into:new.USE_KEY from sys.dual ;
end;
/
create or replace trigger VT_Trigger
before insert on version_type
for each row
declare
begin
select TTE_SEQ.nextval into:new.VT_KEY from sys.dual;
end VT_Trigger;
/
create or replace trigger WorkItem_Trigger
before insert on work_item
for each row
declare
begin
select TTE_SEQ.nextval into:new.WOR_KEY from sys.dual ;
end WorkItem_Trigger;
/create or replace view use_pri as
select USERS.USE_KEY,USERS.USE_ID,USERS.USE_PASSWORD,USER_PRIVILEGE.PRI_ID
from USERS,USER_PRIVILEGE
where USERS.USE_KEY=USER_PRIVILEGE.USE_KEY;create or replace view vt_type_allinfo as
select
SATELLITE.SAT_KEY,VERSION_TYPE."VT_KEY",VERSION_TYPE."VT_NAME",VERSION_TYPE."TP_KEY",VERSION_TYPE."VT_TYPE",
VERSION_TYPE."UL_TIME",VERSION_TYPE."VT_LASTMODITOR",USERS.USE_NAME,VT_TYPE.VT_TYPE_NAME,PHASE.PHA_KEY,PHASE.PHA_NAME
from SATELLITE,VERSION_TYPE,USERS,VT_TYPE,PHASE
WHERE VERSION_TYPE.VT_TYPE=VT_TYPE.VT_TYPE
AND VERSION_TYPE.VT_LASTMODITOR=USERS.USE_KEY
AND VERSION_TYPE.PHA_KEY=PHASE.PHA_KEY
AND SATELLITE.SAT_KEY=PHASE.SAT_KEY;
INSERT INTO USERS (USE_ID,USE_NAME,USE_PASSWORD,USE_DEPT,USE_JOB,USE_TEL,USE_EMAIL,USE_ADMIN)
VALUES('admin','管理员','Tkc18+yPWLU=',' ',' ',' ',' ','1');
INSERT INTO MANAGER_ORNOT VALUES('0','否');
INSERT INTO MANAGER_ORNOT VALUES('1','是');
INSERT INTO PRIVILEGE VALUES(1,'测试细则负责人','1');
INSERT INTO PRIVILEGE VALUES(2,'测试细则编辑人员','2');
INSERT INTO VT_TYPE VALUES('0','工作版');
INSERT INTO VT_TYPE VALUES('1','稳定版');
INSERT INTO VT_TYPE VALUES('2','发布版');
INSERT INTO VT_TYPE VALUES('3','模板');我该怎么用c#来运行这个脚本呢?
create sequence TTE_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
cache 20
order;create table CATEGORY
(
CAT_KEY NUMBER(38) not null,
PARENT_KEY NUMBER(38) not null,
PARENT_TYPE NUMBER(38) not null,
CAT_NAME VARCHAR2(64) not null,
CHILD_TYPE NUMBER(38) not null
);alter table CATEGORY
add constraint CATEGORY primary key (CAT_KEY)
using index;
alter table CATEGORY
add constraint PC unique (PARENT_KEY, CAT_NAME)
using index; create table USERS
(
USE_ID VARCHAR2(64) not null,
USE_NAME VARCHAR2(64) not null,
USE_PASSWORD VARCHAR2(64) not null,
USE_DEPT VARCHAR2(64),
USE_JOB VARCHAR2(64),
USE_TEL VARCHAR2(64),
USE_EMAIL VARCHAR2(64),
USE_KEY NUMBER(38) not null,
USE_ADMIN NUMBER
);alter table USERS
add constraint USE_KEY primary key (USE_KEY)
using index;
alter table USERS
add constraint USE_ID unique (USE_ID)
using index; create table MANAGER_ORNOT
(
MAN_ID NUMBER,
MAN_NAME VARCHAR2(4)
);create table TEST_PROJECT
(
TP_KEY NUMBER(38) not null,
TP_CREATED_DATETIME DATE not null,
TP_LASTMODIFIED_DATETIME DATE not null,
TP_NAME VARCHAR2(64) not null,
CAT_KEY NUMBER(38) not null,
TP_CREATOR NUMBER(38) not null,
TP_LASTMODITOR NUMBER(38) not null
);
alter table TEST_PROJECT
add constraint TESTPROJECT primary key (TP_KEY)
using index;
alter table TEST_PROJECT
add constraint TC unique (TP_NAME, CAT_KEY)
using index;
alter table TEST_PROJECT
add constraint CAT_KEY foreign key (CAT_KEY)
references CATEGORY (CAT_KEY) on delete cascade;
create table TEST_TABLE_BASE_INFO
(
TTBASE_KEY NUMBER(38) not null,
TAB_SEQUENCE NUMBER(38) not null,
TAB_NAME VARCHAR2(128) not null,
USE_KEY NUMBER(38),
TP_KEY NUMBER(38) not null
);
alter table TEST_TABLE_BASE_INFO
add constraint TESTTABLEBASE primary key (TTBASE_KEY)
using index;
alter table TEST_TABLE_BASE_INFO
add constraint TT unique (TAB_NAME, TP_KEY)
using index;alter table TEST_TABLE_BASE_INFO
add constraint TP_KEY2 foreign key (TP_KEY)
references TEST_PROJECT (TP_KEY) on delete cascade;create table VERSION_TYPE
(
VT_KEY NUMBER(38) not null,
VT_NAME VARCHAR2(64) not null,
TP_KEY NUMBER(38) not null,
VT_TYPE NUMBER(38),
UL_TIME DATE not null,
VT_LASTMODITOR NUMBER(38) not null,
PHA_KEY NUMBER(38)
);
alter table VERSION_TYPE
add constraint VERSIONTYPE primary key (VT_KEY)
using index;
alter table VERSION_TYPE
add constraint TP_KEY foreign key (TP_KEY)
references TEST_PROJECT (TP_KEY) on delete cascade;
create table TEST_TABLE
(
TAB_KEY NUMBER(38) not null,
VT_KEY NUMBER(38) not null,
UL_TIME DATE not null,
TTBASE_KEY NUMBER(38) not null,
USE_KEY NUMBER(38)
);
alter table TEST_TABLE
add constraint TESTVT primary key (TAB_KEY)
using index;
alter table TEST_TABLE
add constraint TTBASEINFO_KEY foreign key (TTBASE_KEY)
references TEST_TABLE_BASE_INFO (TTBASE_KEY) on delete cascade;
alter table TEST_TABLE
add constraint VT_KEY foreign key (VT_KEY)
references VERSION_TYPE (VT_KEY) on delete cascade;create table WORK_ITEM
(
WOR_KEY NUMBER(38) not null,
TAB_KEY NUMBER(38) not null,
WOR_SEQUENCE NUMBER(38) not null,
WOR_ID VARCHAR2(1024) not null,
WOR_NAME VARCHAR2(1024) not null
);
alter table WORK_ITEM
add constraint WORKITEM primary key (WOR_KEY)
using index;
alter table WORK_ITEM
add constraint TAB_KEY foreign key (TAB_KEY)
references TEST_TABLE (TAB_KEY) on delete cascade;create table OPERATING_STEP
(
OPE_KEY NUMBER(38) not null,
WOR_KEY NUMBER(38) not null,
OPE_SEQUENCE NUMBER(38),
OPE_NAME VARCHAR2(2048),
OPE_EXPECT VARCHAR2(2048),
OPE_SERTIME VARCHAR2(64),
OPE_SATTIME VARCHAR2(64),
OPE_REAL VARCHAR2(1024),
OPE_OPERATOR VARCHAR2(64),
OPE_AUDITOR VARCHAR2(64),
OPE_AUDTIME DATE,
OPE_INSTRUCTION VARCHAR2(512)
);
alter table OPERATING_STEP
add constraint OPS primary key (OPE_KEY)
using index;
alter table OPERATING_STEP
add constraint WOR_KEY foreign key (WOR_KEY)
references WORK_ITEM (WOR_KEY) on delete cascade;
create table OPS_INS_RELATION
(
OPE_KEY NUMBER(38) not null,
INS_KEY NUMBER(38) not null
);create table SATELLITE
(
SAT_KEY NUMBER(38) not null,
SAT_ID VARCHAR2(16) not null,
SAT_NAME VARCHAR2(64) not null,
USE_KEY NUMBER(38) not null
);
alter table SATELLITE
add constraint SAT_KEY primary key (SAT_KEY)
using index;
alter table SATELLITE
add constraint SAT_ID unique (SAT_ID)
using index; create table PHASE
(
PHA_KEY NUMBER(38) not null,
SAT_KEY NUMBER(38) not null,
PHA_NAME VARCHAR2(64) not null
);
alter table PHASE
add constraint PHASE primary key (PHA_KEY)
using index ;alter table PHASE
add constraint SP unique (SAT_KEY, PHA_NAME)
using index;
alter table PHASE
add constraint EWQ foreign key (SAT_KEY)
references SATELLITE (SAT_KEY) on delete cascade;create table PRIVILEGE
(
PRI_KEY NUMBER(38) not null,
PRI_NAME VARCHAR2(255) not null,
PRI_ID NUMBER(38) not null
);
alter table PRIVILEGE
add constraint PRIVILEGE primary key (PRI_KEY)
using index;
create table USER_PRIVILEGE
(
UP_KEY NUMBER(38) not null,
USE_KEY NUMBER(38) not null,
PRI_ID NUMBER(38) not null
);
alter table USER_PRIVILEGE
add constraint USER_PRIVILEGE_RELATION primary key (UP_KEY)
using index;
create table VT_TYPE
(
VT_TYPE NUMBER(38) not null,
VT_TYPE_NAME VARCHAR2(32) not null
);
alter table VT_TYPE
add constraint VERSION primary key (VT_TYPE)
using index; create or replace trigger CATEGORY_TRIGGER
before insert on category
for each row
declare
begin
select TTE_SEQ.nextval into:new.CAT_KEY from sys.dual ;
end CATEGORY_TRIGGER;
/
create or replace trigger OPE_INS_TRIGGER
before insert on ops_ins_relation
for each row
declarebegin
select TTE_SEQ.nextval into:new.OPE_KEY from sys.dual ;
end OPE_INS_TRIGGER;
/
create or replace trigger OS_Trigger
before insert on operating_step
for each row
declarebegin
select TTE_SEQ.nextval into:new.OPE_KEY from sys.dual;
end OS_Trigger;
/
create or replace trigger Phase_Trigger
before insert on phase
for each row
declare
begin
select TTE_SEQ.nextval into:new.PHA_KEY from sys.dual ;
end Phase_Trigger;
/
create or replace trigger satellite
before insert on satellite
for each row
declare
begin
select TTE_SEQ.nextval into:new.SAT_KEY from sys.dual ;
end satellite;
/
create or replace trigger TP_Trigger
before insert on test_project
for each row
declare
begin
select TTE_SEQ.nextval into:new.TP_KEY from sys.dual;
end TP_Trigger;
/
create or replace trigger TT_BASE_INFO_TRIGGER
before insert on test_table_base_info
for each row
declare
begin
select TTE_SEQ.nextval into:new.TTBASE_KEY from sys.dual ;
end TT_BASE_INFO_TRIGGER;
/
create or replace trigger tt_test
before insert on test_table
for each row
declare
begin
select TTE_SEQ.nextval into:new.TAB_KEY from sys.dual ;
end tt_test;
/
create or replace trigger UP_TRIGGER
before insert on user_privilege
for each row
declare
begin
select TTE_SEQ.nextval into:new.UP_KEY from sys.dual ;
end UP_TRIGGER;
/
create or replace trigger user_trigger
before insert on users
for each row
begin
select TTE_SEQ.nextval into:new.USE_KEY from sys.dual ;
end;
/
create or replace trigger VT_Trigger
before insert on version_type
for each row
declare
begin
select TTE_SEQ.nextval into:new.VT_KEY from sys.dual;
end VT_Trigger;
/
create or replace trigger WorkItem_Trigger
before insert on work_item
for each row
declare
begin
select TTE_SEQ.nextval into:new.WOR_KEY from sys.dual ;
end WorkItem_Trigger;
/create or replace view use_pri as
select USERS.USE_KEY,USERS.USE_ID,USERS.USE_PASSWORD,USER_PRIVILEGE.PRI_ID
from USERS,USER_PRIVILEGE
where USERS.USE_KEY=USER_PRIVILEGE.USE_KEY;create or replace view vt_type_allinfo as
select
SATELLITE.SAT_KEY,VERSION_TYPE."VT_KEY",VERSION_TYPE."VT_NAME",VERSION_TYPE."TP_KEY",VERSION_TYPE."VT_TYPE",
VERSION_TYPE."UL_TIME",VERSION_TYPE."VT_LASTMODITOR",USERS.USE_NAME,VT_TYPE.VT_TYPE_NAME,PHASE.PHA_KEY,PHASE.PHA_NAME
from SATELLITE,VERSION_TYPE,USERS,VT_TYPE,PHASE
WHERE VERSION_TYPE.VT_TYPE=VT_TYPE.VT_TYPE
AND VERSION_TYPE.VT_LASTMODITOR=USERS.USE_KEY
AND VERSION_TYPE.PHA_KEY=PHASE.PHA_KEY
AND SATELLITE.SAT_KEY=PHASE.SAT_KEY;
INSERT INTO USERS (USE_ID,USE_NAME,USE_PASSWORD,USE_DEPT,USE_JOB,USE_TEL,USE_EMAIL,USE_ADMIN)
VALUES('admin','管理员','Tkc18+yPWLU=',' ',' ',' ',' ','1');
INSERT INTO MANAGER_ORNOT VALUES('0','否');
INSERT INTO MANAGER_ORNOT VALUES('1','是');
INSERT INTO PRIVILEGE VALUES(1,'测试细则负责人','1');
INSERT INTO PRIVILEGE VALUES(2,'测试细则编辑人员','2');
INSERT INTO VT_TYPE VALUES('0','工作版');
INSERT INTO VT_TYPE VALUES('1','稳定版');
INSERT INTO VT_TYPE VALUES('2','发布版');
INSERT INTO VT_TYPE VALUES('3','模板');我该怎么用c#来运行这个脚本呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货