急!ORA-00900: 无效 SQL 语句;进行数据库导入时出现问题

shujukuxinqingxiaowu 2010-06-17 05:09:28
/*==============================================================*/
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2010-6-17 16:32:10 */
/*==============================================================*/


if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_STUDEN') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_STUDEN
end if;

if exists(select 1 from sys.sysforeignkey where role='FK_T_SELCOU_T_SELCOUR_T_COURSE') then
alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_COURSE
end if;

if exists(select 1 from sys.sysforeignkey where role='FK_T_TESCOU_T_TESCOUR_T_TEACHE') then
alter table t_tescour
delete foreign key FK_T_TESCOU_T_TESCOUR_T_TEACHE
end if;

后面的略掉
*
第 5 行出现错误:
ORA-00900: 无效 SQL 语句
...全文
646 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
心中的彩虹 2010-06-17
  • 打赏
  • 举报
回复
[Quote=引用楼主 shujukuxinqingxiaowu 的回复:]
/*==============================================================*/
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2010-6-17 16:32:10 */
/*===================================================……
[/Quote]


alter table t_selcour
delete foreign key FK_T_SELCOU_T_SELCOUR_T_STUDEN
--全部改为,删除约束不是那样写的
alter table t_selcour
drop constraint 约束名



--把你的改成这样写
alter table t_selcour
drop constraint FK_T_SELCOU_T_SELCOUR_T_STUDEN


gelyon 2010-06-17
  • 打赏
  • 举报
回复
语法:
ALTER TABLE table_name DROP CONSTRAINT constraint_name

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧