新建表時報ORA-00904錯~~?

ggygd 2006-03-03 10:12:12
-- Create table
create table TBL_ITEM_ESP
(
ITEMNO varchar2(15) not null,
DESC varchar2(500),
Mar varchar2(2) default 0 not null
)
tablespace USERS
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
-- Grant/Revoke object privileges
...全文
141 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zlz_212 2006-03-07
  • 打赏
  • 举报
回复
来晚了 汗!
WeiCui 2006-03-06
  • 打赏
  • 举报
回复
ORA-00904 string: invalid identifier

Cause: The column name entered is either missing or invalid.

Action: Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word.
ggygd 2006-03-03
  • 打赏
  • 举报
回复
ZJDING
boydgmx 2006-03-03
  • 打赏
  • 举报
回复
SQL> create table TBL_ITEM_ESP
2 (
3 ITEMNO varchar2(15) not null,
4 DESC varchar2(500),
5 Mar varchar2(2) default 0 not null
6 )
7 /
DESC varchar2(500),
*
ERROR 位于第 4 行:
ORA-00904: : 无效的标识符

看看报错时那个*号所在的位置,就知道哪里错了。

DESC 是个保留字,不能用的。

非要用的话,可以:

SQL> create table TBL_ITEM_ESP
2 (
3 ITEMNO varchar2(15) not null,
4 "DESC" varchar2(500),
5 Mar varchar2(2) default 0 not null
6 )
7 /

表已创建。
bobfang 2006-03-03
  • 打赏
  • 举报
回复
ORA-00904 string: invalid identifier

Cause: The column name entered is either missing or invalid.

应该是desc字段名的问题,desc是保留字。

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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