序號 | 語法 | 錯訊 | 解法 |
1 | select max(adr1001) from gp0adr1 order by adr1001 | Invalid expression in the ORDER BY clause (not contained in either an aggregate function or the GROUP BY clause) | 將order by拿掉,因為這種狀況不需要下order by,或使用order by 1,但不建議,因為這種情況不需要下order by。 |
2 | Select Acct002, Acct002 from wacct where acct001=98 order by acct002 | Ambiguous field name between a field and a field in the select list with name ACCT002 | 使用order by 1,但因為使用index,所以之後改這個語法時必須注意要往後面增加要select的欄位 |
3 | Insert into winvn (invn001, invn002, invn001) values (97, “test001”, 98) | Column winvn.invn001 cannot be repeated in INSERT statement. | 不可在Insert語法內出現重覆的欄位,在IB5、IB7這樣的語法是可以的,但會變成「後蓋前」所以在Firebird應該要去除前面的欄位,保留後面的 |
4 | Update winvn set invn003=’test’, invn003=’test2’ where invn001=98 and invn002=’113’ | Column winvn.invn003 cannot be repeated in UPDATE statement. | 不可在Update語法內出現重覆的欄位,在IB5、IB7這樣的語法是可以的,但會變成「後蓋前」所以在Firebird應該要去除前面的欄位,保留後面的 |
5 | select dtou010, sum(dtou011), sum(dtou013) from wdtou where dtou003=98 group by dtou010 order by dtou003, dtou010 | Invalid expression in the ORDER BY clause (not contained in either an aggregate function or the GROUP BY clause). | 這個語法在IB5及IB7是可以的,解法為將order by裏面的dtou003拿掉,因為dtou003不在group by裏面 |
6 | 某程式在WINDOWS7中開啟時會產生錯誤,錯誤發生在PutWs0cuasData中,會使用RequestLive的情況下直接對資料庫修改資料,在POST會產生錯誤 | Record/key deleted | 該Table的主KEY是Cuas001,Cuas011,但是在給予資料時只給予Cuas001,只要在補上Cuas011的資料就可過了 |
7 | Select Pamd002,Pamd003,Paro005 from Wpamd Left join Wparo on Pamd001=Paro001 and Pamd002=Paro004 and Pamd003=Paro002 where Pamd001=:Pamd001 and (Pamd003=”50” or Pamd003=”50A”) Group by Pamd002,Pamd003,Paro005 Order by Pamd002,Paro005,Pamd003,Pamd004,Pamd005 | Invalid expression in the ORDER BY clause (not contained in either an aggregate function or the GROUP BY clause). | 這個語法在IB5及IB7是可以的,解法為將Group by拿掉在Select後面+上distinct,因為只是要重複資料顯示一筆而已 |
8 | select Sum(TXAC003) as TXAC003 from WTXAC where TXAC001 = 98 and TXAC002 in (3600) | Invalid modify request. conversion error from string “044A “ | 由於TXAC002欄位型態為CHAR 故後面條件所給予的值也必須是字串型態。 此語法在IB5跟IB7可以過 |
9 | Select * from ws0cust where cust001=-1 | Conversion error from string “Test “ | cust001為字串型態,而where語法的右邊為-1的整數型態,Firebird會先將左邊欄位的值試著轉為整數,所以出錯,但IB5這句語法是沒有錯誤的,解法為將=-1改為=”-1” |
InterBase 與 FireBird 語法兼容問題記錄
最新推荐文章于 2020-08-05 15:04:21 发布