fjun0910的专栏

鉴于止水,修己以敬。

ORA-00928: 缺失 SELECT 关键字

向表格中插入记录(insert into)时候,报异常,提示:ORA-00928: 缺失 SELECT 关键字(missing SELECT keyword)

 

原因:

1、如网上大部分出现的类似,是因为列名上不能添加单引号

 如写成INSERT INTO USERTAB ('uniPositionCode','transferGroupName','appCode','appName','transferPort','cfg_network','transferProtocol','transferip','insideState') VALUES('01330000','1','20','4343','9513','0','9513','0.0.0.0','0') 就会报错;

2、另一个原因可能是你的oracle数据库表名或列名属于sql中的保留字,如表名写成PASSWORD,有列名写成USER

 

最常见的oracle保留字有这些:
ACCESS ADD ALL ALTER AND ANY AS ASC AUDIT BETWEEN BY CHAR
CHECK CLUSTER COLUMN COMMENT COMPRESS CONNECT CREATE CURRENT
DATE DECIMAL DEFAULT DELETE DESC DISTINCT DROP ELSE EXCLUSIVE
EXISTS FILE FLOAT FOR FROM GRANT GROUP HAVING IDENTIFIED
IMMEDIATE IN INCREMENT INDEX INITIAL INSERT INTEGER INTERSECT
INTO IS LEVEL LIKE LOCK LONG MAXEXTENTS MINUS MLSLABEL MODE
MODIFY NOAUDIT NOCOMPRESS NOT NOWAIT NULL NUMBER OF OFFLINE ON
ONLINE OPTION OR ORDER PCTFREE PRIOR PRIVILEGES PUBLIC RAW
RENAME RESOURCE REVOKE ROW ROWID ROWNUM ROWS SELECT SESSION
SET SHARE SIZE SMALLINT START SUCCESSFUL SYNONYM SYSDATE TABLE
THEN TO TRIGGER UID UNION UNIQUE UPDATE USER VALIDATE VALUES
VARCHAR VARCHAR2 VIEW WHENEVER WHERE WITH

 

 

ps:使用hibernate,只有修改配置文件,在列名上加"[]"如下:

      <id name="uid" type="java.lang.String">
            <column name="[UID]" />
            <generator class="assigned" />
        </id>

阅读更多
个人分类: oracle
上一篇生成javadoc时编码出错
下一篇Tomcat 修改根目录
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭