oracle ORA 00936 missing expression 報錯的幾種情況和解決方法
ORA-00936: missing expression Cause: A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE. Action: Check the statement syntax and specify the missing component.
我遇到的2種 ORA-00936: missing expression 報錯情況1、插入表資料 insert into t1 values select 1 from dual;2、用pl/sql developer 工具比較時報錯 原因:表字段是oracle關鍵字----也就是在查詢這個帶有關鍵字列的時候測試1:SQL> create table t1 ("desc" varchar2(10));
表已建立。
SQL> desc t1;名稱 是否為空? 型別----------------------------------------- -------- ----------------------------desc VARCHAR2(10)
SQL> insert into t1 values select 1 from dual;insert into t1 values select 1 from dual *第 1 行出現錯誤:ORA-00936: 缺失表示式SQL>解決就是把values去掉就可以了
測試2:SQL> select desc from t1;select desc from t1 *第 1 行出現錯誤:ORA-00936: 缺失表示式
SQL>測試2(2):用pl/sql developer 工具比較時的報錯解決方法:ALTER TABLE T1 RENAME COLUMN "desc" TO desc_;(比較的話目標和源庫都要相同)再比較或者查詢就沒有問題了祝好~