sql - Getting ORA-00904: : invalid identifier in oracle application express
问题描述
I want to create this simple table in oracle application express but i keep getting the error
ORA-00904: : invalid identifier
and I have no idea why.
CREATE TABLE ArtWork (
ArtWorkId NUMBER (6,0) CONSTRAINT aw_pk PRIMARY KEY,
Name VARCHAR2 (20),
Desc VARCHAR2 (25)
);
解决方案
desc
is a reserved word (it is used to to specifiy the sort direction, for example in an order by
clause).
You need to either surround it with double quotes, or better yet change your column name to something that does not clash with a language keyword, so you don't need to worry about it later on:
CREATE TABLE ArtWork (
ArtWorkId NUMBER (6,0) CONSTRAINT aw_pk PRIMARY KEY,
Name VARCHAR2 (20),
Description VARCHAR2 (25)
);
推荐阅读
- java - 如何在 Spring 中使用列表作为模型属性?
- ios - 在表视图的自定义单元格上隐式展开可选值时意外发现 nil
- acumatica - 在事件处理程序中运行长时间操作
- javascript - 使用 Jquery/Javascript 选择数组中的项目
- javascript - 通过 JavaScript 连接附加 HTML
- r - 我可以根据其他帧中的 ID 过滤数据帧吗?
- python - 如何在 Python 中交换图像中的随机像素?
- mysql - MySQL:1 个大型或单个表?
- c# - 在设置和验证中具有相同参数的起订量
- android-studio - 错误:从二进制存储读取数据时出现问题