在powerdesign里面设计好了数据库,问下,如何自动生成oracle的建表语句啊?我邮件 -->sql previews出来的在plsql的sql窗口一运行,老是报错?ORA-00900: not invalid identifer
解决方案 »
- exp备份找不到备份文件呢
- 请问Case when用法`Oracle
- 菜鸟求解forms开发中画布的问题
- 跪请:Fedora Core 7下安装Oralce 9.2服务端的详细步骤,尤其是安装前后FC7的设置方面,困饶我很长时间了啊!
- 请教 求字段最大值的最优 方法
- oralce在存储过程中解析xml字符串
- 请教一个查询语句
- 一个简单的有关日期的查询,100分 在线等 写成存储过程 给高分
- 我在自己的机子上装了oracle8并建了一个数据库orcl,请问我 如果要同时能够连接orcl 和另一个局域网内的网络上的
- 如何将Exp导出的.dmp文件Imp到指定的TableSpace里面? or 如何将大Database的结构Imp到一个小TableSpace?
- oracle 用RMAN复制数据库出现错误,临时文件temp01.dbf 与系统文件冲突
- 需要查找这样的数据的SQL语句怎么写啊?急急急!
/* DBMS name: Sybase AS Anywhere 9 */
/* Created on: 2009-04-13 10:30:59 */
/*==============================================================*/
if exists(
select 1 from sys.systable
where table_name='T_ACCESS_COUNT'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_ACCESS_COUNT
end if;if exists(
select 1 from sys.systable
where table_name='T_DEPARTMENT_TYPE'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_DEPARTMENT_TYPE
end if;if exists(
select 1 from sys.systable
where table_name='T_MESSAGE'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_MESSAGE
end if;if exists(
select 1 from sys.systable
where table_name='T_REPOSITY_INDEX'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_REPOSITY_INDEX
end if;if exists(
select 1 from sys.systable
where table_name='T_SEARCH_KEY'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_SEARCH_KEY
end if;if exists(
select 1 from sys.systable
where table_name='T_SORT'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_SORT
end if;if exists(
select 1 from sys.systable
where table_name='T_TOOLS'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_TOOLS
end if;
if exists(
select 1 from sys.systable
where table_name='T_WORKPAPER'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table T_WORKPAPER
end if;
/*==============================================================*/
/* Table: T_MESSAGE */
/*==============================================================*/
create table T_MESSAGE
(
ID numeric not null,
CONTENT varchar(2000),
RECEIVED_ID numeric,
WORK_ID numeric,
DEAL_USER_ID numeric,
ISREAD numeric,
constraint PK_T_MESSAGE primary key (ID)
);comment on table T_MESSAGE is
'工单处理信息表:工单处理完毕后,系统给发起工单的用户留言‘处理完毕’';comment on column T_MESSAGE.ID is
'消息标识ID';comment on column T_MESSAGE.CONTENT is
'消息内容';comment on column T_MESSAGE.RECEIVED_ID is
'消息录入用户ID';comment on column T_MESSAGE.WORK_ID is
'消息录入时间';/*==============================================================*/
/* Table: T_REPOSITORY_RELATION */
/*==============================================================*/
create table T_REPOSITORY_RELATION
(
ID numeric,
RELATION_IDS varchar(4000),
POST_USER_ID numeric,
POST_TIME date,
STATUS numeric
);comment on table T_REPOSITORY_RELATION is
'知识库信息关联表';/*==============================================================*/
/* Table: T_REPOSITORY_SYS_LOG */
/*==============================================================*/
create table T_REPOSITORY_SYS_LOG
(
ID numeric not null,
OPER_USER_ID numeric,
OPER_TABLE varchar(50),
OPER_TABLE_ID numeric,
OPER_ACTION varchar(20),
OPER_RESULT varchar(500),
OPER_ERROR varchar(500),
OPER_TIME date,
constraint PK_T_REPOSITORY_SYS_LOG primary key (ID)
);comment on table T_REPOSITORY_SYS_LOG is
'知识库操作日志表';comment on column T_REPOSITORY_SYS_LOG.ID is
'日志标识ID';comment on column T_REPOSITORY_SYS_LOG.OPER_USER_ID is
'操作员人员ID';comment on column T_REPOSITORY_SYS_LOG.OPER_TABLE is
'操作表名字
';comment on column T_REPOSITORY_SYS_LOG.OPER_TABLE_ID is
'操作表的数据标识ID';comment on column T_REPOSITORY_SYS_LOG.OPER_ACTION is
'操作动作(insert、update、delete、search)';comment on column T_REPOSITORY_SYS_LOG.OPER_RESULT is
'操作结果';comment on column T_REPOSITORY_SYS_LOG.OPER_ERROR is
'操作失败信息';comment on column T_REPOSITORY_SYS_LOG.OPER_TIME is
'操作时间';/*==============================================================*/
/* Table: T_REPOSITY */
/*==============================================================*/
create table T_REPOSITY
(
ID numeric not null,
FILE_ID varchar(20),
TITLE varchar(100),
CONTENT clob,
TYPE numeric,
DISABLEED date,
VALID_TIME date,
LEVEL_ID numeric,
STATUS numeric,
POST_USER_ID numeric,
POST_TIME datetime,
UPDATE_USER_ID numeric,
UPDATE_TIME date,
CHECK_USER_ID numeric,
CHECK_TIME date,
constraint PK_T_REPOSITY primary key (ID)
);comment on table T_REPOSITY is
'知识库信息表';comment on column T_REPOSITY.ID is
'标识ID';comment on column T_REPOSITY.FILE_ID is
'文件编号,唯一值';comment on column T_REPOSITY.TITLE is
'知识库标题';comment on column T_REPOSITY.CONTENT is
'知识库内容';comment on column T_REPOSITY.TYPE is
'知识库分类';comment on column T_REPOSITY.DISABLEED is
'失效时间';comment on column T_REPOSITY.LEVEL_ID is
'重要 置1 一般置-1';comment on column T_REPOSITY.STATUS is
'状态 -2未审核 -1审核未通过 1 审核通过 2失效 3 删除';/*==============================================================*/
/* Table: T_REPOSITY_ANNEX */
/*==============================================================*/
create table T_REPOSITY_ANNEX
(
PK_AUTO_ID NUMBER,
FK__REPOSITORY_ID VARCHAR,
ANNEX_PATH VARCHAR,
FK_POST_USER_ID NUMBER,
POST_TIME DATE,
NUMBER NUMBER,
UPDATE_TIME DATE
);comment on table T_REPOSITY_ANNEX is
'知识库信息对应附件表';/*==============================================================*/
/* Table: T_REPOSITY_INDEX */
/*==============================================================*/
create table T_REPOSITY_INDEX
(
ID numeric not null,
FILE_ID varchar(20),
TITLE varchar(100),
CONTENT clob,
TYPE numeric,
DISABLEED date,
VALID_TIME date,
LEVEL_ID numeric,
STATUS numeric,
POST_USER_ID numeric,
POST_TIME date,
UPDATE_USER_ID numeric,
UPDATE_TIME date,
CHECK_USER_ID numeric,
CHECK_TIME date,
constraint PK_T_REPOSITY_INDEX primary key (ID)
);
/*==============================================================*/
/* Table: T_SORT */
/*==============================================================*/
create table T_SORT
(
ID numeric,
PID numeric,
NAME varchar(20),
SORT numeric,
CHECK_FLAG numeric,
PUBLIC_TAG numeric,
TEMPLATE_ID numeric,
POST_USER_ID numeric,
POST_TIME datet,
UPDATE_USER_ID numeric,
UPDATE_TIME date,
IS_FINAL numeric,
INDEX_NUM numeric
);
.......comment on column T_WORKPAPER.DEAL_USER_ID is
'当用户进行审核的时候,在处理完毕之前,绑定这个工单,别的用户不能操作这个工单。';这是我根据powerdesigner生成的sql脚本,在plsql里面执行不通过,报错如下:ORA-00900: invalid SQL statement
Database -->Change Current DBMS ...-->选择你要的oracle版本.
如果中途出错,作对应修改即可
/* DBMS name: Sybase AS Anywhere 9 */
/* Created on: 2009-04-13 10:30:59 */
/*==============================================================*/
从这里可以看出,楼主用的是默认的Sybase数据库,所以生成的脚本是Sybase数据库规范的。你需要进去 Database-->Change the Target DBMS-->General-->DBMS选项里面选择你的oracle版本即可,点击确定按钮。
然后Database-->Database General生成脚本!