哪位帮忙把下面的mysql建表语句转成oracle的?
oracle我学的不多,手头有没有参考书....希望大家能帮帮我,谢谢啦create table if not exists t_user
(
user_id varchar(10) primary key not null,
user_name varchar(20) not null,
password varchar(20),
contact_tel varchar(30),
email varchar(30),
create_date datetime
);/*==============================================================*/
/* Table: t_client */
/*==============================================================*/
create table if not exists t_client
(
id int primary key auto_increment not null,
pid int not null,
name varchar(40) not null,
client_id varchar(10),
client_level char(3),
bank_acct_no varchar(30),
contact_tel varchar(20),
address varchar(50),
zip_code varchar(20),
is_leaf char(1) default 'N',
is_client char(1) default 'N'
);/*==============================================================*/
/* Table: t_temi_client */
/*==============================================================*/
create table if not exists t_temi_client
(
id int primary key auto_increment not null,
pid int not null,
name varchar(40) not null,
temi_id varchar(20),
temi_lelve char(3),
contact_tel varchar(18),
contactor varchar(30),
address varchar(50),
zip_code varchar(20),
is_leaf char(1) default 'N',
is_temi_client char(1) default 'N'
);/*==============================================================*/
/* Table: t_items */
/*==============================================================*/
create table if not exists t_items
(
item_no varchar(10) primary key not null,
item_name varchar(30) not null,
spec varchar(30),
pattern varchar(30),
category char(3) not null,
unit char(3) not null
);/*==============================================================*/
/* Table: t_fiscal_year_period */
/*==============================================================*/
create table if not exists t_fiscal_year_period
(
id int primary key auto_increment not null,
fiscal_year int not null,
fiscal_period tinyint not null,
begin_date datetime not null,
end_date datetime not null,
period_sts char(1) default 'N'
);
oracle我学的不多,手头有没有参考书....希望大家能帮帮我,谢谢啦create table if not exists t_user
(
user_id varchar(10) primary key not null,
user_name varchar(20) not null,
password varchar(20),
contact_tel varchar(30),
email varchar(30),
create_date datetime
);/*==============================================================*/
/* Table: t_client */
/*==============================================================*/
create table if not exists t_client
(
id int primary key auto_increment not null,
pid int not null,
name varchar(40) not null,
client_id varchar(10),
client_level char(3),
bank_acct_no varchar(30),
contact_tel varchar(20),
address varchar(50),
zip_code varchar(20),
is_leaf char(1) default 'N',
is_client char(1) default 'N'
);/*==============================================================*/
/* Table: t_temi_client */
/*==============================================================*/
create table if not exists t_temi_client
(
id int primary key auto_increment not null,
pid int not null,
name varchar(40) not null,
temi_id varchar(20),
temi_lelve char(3),
contact_tel varchar(18),
contactor varchar(30),
address varchar(50),
zip_code varchar(20),
is_leaf char(1) default 'N',
is_temi_client char(1) default 'N'
);/*==============================================================*/
/* Table: t_items */
/*==============================================================*/
create table if not exists t_items
(
item_no varchar(10) primary key not null,
item_name varchar(30) not null,
spec varchar(30),
pattern varchar(30),
category char(3) not null,
unit char(3) not null
);/*==============================================================*/
/* Table: t_fiscal_year_period */
/*==============================================================*/
create table if not exists t_fiscal_year_period
(
id int primary key auto_increment not null,
fiscal_year int not null,
fiscal_period tinyint not null,
begin_date datetime not null,
end_date datetime not null,
period_sts char(1) default 'N'
);
解决方案 »
- oracle疑问
- 安装oracle遇到问题,请指教
- 在oracle的存储过程中,如何获取最近一次执行的sql操作?
- ORACLE9i客户端升级10的补丁,谢谢大家提供
- PL/SQL问题3
- 菜鸟求解,包的扩展
- 启动数据库错误
- oracle8.0.5如何更改为共享模式?
- 菜鸟问题。按照用户导入,导出数据
- 在PL/SQL中用“SELECT TEST_SEQ.NEXTVAL FROM DUAL”居然取出两个值出来,哪为大侠有遇到这种情况吗?
- 请教分组排序取第一条记录问题?????
- 这个SQL查询怎么写?????????????????????????????????????????????????????????????????????
/*==============================================================*/
/* Table: t_flow_card_master */
/*==============================================================*/
create table if not exists t_flow_card
(
vou_no varchar(16) primary key not null,
fiscal_year int not null,
fiscal_period tinyint not null,
client_id varchar(10) not null,
opr_type char(1) not null,
record_date datetime not null,
recorder_id varchar(10) not null,
vou_sts char(1) default 'N',
confirmer_id varchar(10),
conf_date datetime,
spotter_id varchar(10),
spot_date datetime,
spot_re varchar(60),
spot_flag char(1) default 'N',
adjust_time datetime,
adjuster_id varchar(10)
);/*==============================================================*/
/* Table: t_flow_card_detail */
/*==============================================================*/
create table if not exists t_flow_card_detail
(
id int primary key auto_increment not null,
vou_no varchar(16) not null,
aim_id varchar(10) not null,
item_no varchar(10) not null,
qty decimal(10,2) default 0,
amt decimal(10,2) default 0,
adjust_qty decimal(10,2) default 0,
adjust_reason varchar(50),
adjust_flag char(1) default 'N'
);/*==============================================================*/
/* Table: t_data_dict */
/*==============================================================*/
create table if not exists t_data_dict
(
id char(3) primary key not null,
name varchar(20) not null,
category varchar(30) not null
);
/*==============================================================*/
/* View: v_aim_client */
/*==============================================================*/
create view v_aim_client(id, name, level_id, level_name) as
select a.client_id as id, a.name, a.client_level as type_id, b.name as type_name from t_client a, t_data_dict b where a.client_level=b.id
union
select a.temi_id as id, a.name, a.temi_lelve as type_id, b.name as type_name from t_temi_client a, t_data_dict b where a.temi_lelve=b.id
;
insert into t_client(pid, name, is_leaf, is_client) values (0, '所有分销商', 'N', 'N');insert into t_client(pid, name, is_leaf, is_client) values (1, '华北区', 'N', 'N');
insert into t_client(pid, name, is_leaf, is_client) values (2, '北京', 'N', 'N');
insert into t_client(pid, name, client_id, client_level, bank_acct_no, contact_tel, address, zip_code, is_leaf, is_client) values (3, '北京市医药股份有限公司', '2001', 'A03', 'bank00001', '1351111111', '北京市', '100000', 'Y', 'Y');
insert into t_client(pid, name, is_leaf, is_client) values (1, '东北区', 'N', 'N');
insert into t_client(pid, name, is_leaf, is_client) values (5, '吉林省', 'Y', 'N');
insert into t_client(pid, name, is_leaf, is_client) values (5, '辽宁省', 'Y', 'N');
insert into t_client(pid, name, is_leaf, is_client) values (5, '黑龙江省', 'Y', 'N');
insert into t_temi_client(pid, name, is_leaf, is_temi_client) values (0, '所有终端客户', 'N', 'N');
insert into t_temi_client(pid, name, is_leaf, is_temi_client) values (1, '华北区', 'N', 'N');
insert into t_temi_client(pid, name, is_leaf, is_temi_client) values (2, '北京', 'N', 'N');
insert into t_temi_client(pid, name, temi_id, temi_lelve, contact_tel, contactor, address, zip_code, is_leaf, is_temi_client) values (3, '北京中医医院', '5001', 'D01', '1351111111', '张三', '北京市', '100000', 'Y', 'Y');
insert into t_temi_client(pid, name, temi_id, temi_lelve, contact_tel, contactor, address, zip_code, is_leaf, is_temi_client) values (4, '中日医院', '5002', 'D01', '1351111111', '李四', '北京市', '100000', 'Y', 'Y');insert into t_data_dict(id, name, category) values('A01', '一级分销商', 'client_level');
insert into t_data_dict(id, name, category) values('A02', '二级分销商', 'client_level');
insert into t_data_dict(id, name, category) values('A03', '三级分销商', 'client_level');
insert into t_data_dict(id, name, category) values('A04', '总部', 'client_level');
insert into t_data_dict(id, name, category) values('B01', '医疗器械', 'item_category');
insert into t_data_dict(id, name, category) values('B02', '中成药', 'item_category');
insert into t_data_dict(id, name, category) values('B03', '西药', 'item_category');
insert into t_data_dict(id, name, category) values('C01', '盒', 'item_unit');
insert into t_data_dict(id, name, category) values('C02', '片', 'item_unit');
insert into t_data_dict(id, name, category) values('C03', '箱', 'item_unit');
insert into t_data_dict(id, name, category) values('D01', '甲级医院', 'temi_client_level');
insert into t_data_dict(id, name, category) values('D02', '乙级医院', 'temi_client_level');
insert into t_data_dict(id, name, category) values('D03', '丙级医院', 'temi_client_level');
insert into t_data_dict(id, name, category) values('D04', '药店', 'temi_client_level');
insert into t_data_dict(id, name, category) values('D05', '其他', 'temi_client_level');
insert into t_user(user_id, user_name, password) values('root', '管理员', 'root123');
create table t_user
(
user_id varchar2(10) primary key not null,
user_name varchar2(20) not null,
password varchar2(20),
contact_tel varchar2(30),
email varchar2(30),
create_date date
); /*==============================================================*/
/* Table: t_client */
/*==============================================================*/
create table t_client
(
id int primary key not null,
pid int not null,
name varchar2(40) not null,
client_id varchar2(10),
client_level char(3),
bank_acct_no varchar2(30),
contact_tel varchar2(20),
address varchar2(50),
zip_code varchar2(20),
is_leaf char(1) default 'N',
is_client char(1) default 'N'
); /*==============================================================*/
/* Table: t_temi_client */
/*==============================================================*/
create table t_temi_client
(
id int primary key not null,
pid int not null,
name varchar2(40) not null,
temi_id varchar2(20),
temi_lelve char(3),
contact_tel varchar2(18),
contactor varchar2(30),
address varchar2(50),
zip_code varchar2(20),
is_leaf char(1) default 'N',
is_temi_client char(1) default 'N'
); /*==============================================================*/
/* Table: t_items */
/*==============================================================*/
create table t_items
(
item_no varchar2(10) primary key not null,
item_name varchar2(30) not null,
spec varchar2(30),
pattern varchar2(30),
category char(3) not null,
unit char(3) not null
); /*==============================================================*/
/* Table: t_fiscal_year_period */
/*==============================================================*/
create table t_fiscal_year_period
(
id int primary key not null,
fiscal_year int not null,
fiscal_period int not null,
begin_date date not null,
end_date date not null,
period_sts char(1) default 'N'
);