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>


原文链接:http://www.linuxidc.com/Linux/2011-06/36749.htm

你可能感兴趣的:(oracle,select)