SQL> DROP TABLE k; Table dropped -- 建立表K,字段名為UID(oracle關(guān)鍵字) SQL> CREATE TABLE k(UID INT); CREATE TABLE k(UID INT) ORA-00904: : invalid IDENTIFIER -- 字段名加""表創(chuàng)建成功 SQL> CREATE TABLE k("UID" INT); Table created --插入一些數(shù)據(jù) SQL> INSERT INTO k VALUES(1); 1 row inserted SQL> INSERT INTO k VALUES(2); 1 row inserted SQL> INSERT INTO k VALUES(3); 1 row inserted -- 查詢時加不加""都正常(似乎不太符合規(guī)范) SQL> SELECT UID FROM k; UID ---------- 5 5 5 SQL> SELECT "UID" FROM k; UID --------------------------------------- 1 2 3
-- update時必須加上"" SQL> UPDATE k SET UID=5 WHERE UID=3; UPDATE k SET UID=5 WHERE UID=3 ORA-01747: invalid user.table.column, table.column, or column specification SQL> UPDATE k SET "UID"=5 WHERE "UID"=3;