欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ORA-00928: 缺失 SELECT 关键字

程序员文章站 2024-01-02 09:00:22
...

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

向表格中插入记录(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,只有修改配置文件,在列名上加"[]"如下:




ORA-00928: 缺失 SELECT 关键字

上一篇:

下一篇: