InterBase 與 FireBird 語法兼容問題記錄

序號

語法

錯訊

解法

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語法內出現重覆的欄位,在IB5IB7這樣的語法是可以的,但會變成「後蓋前」所以在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語法內出現重覆的欄位,在IB5IB7這樣的語法是可以的,但會變成「後蓋前」所以在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).

這個語法在IB5IB7是可以的,解法為將order by裏面的dtou003拿掉,因為dtou003不在group by裏面

6

某程式WINDOWS7中開啟時會產生錯誤,錯誤發生在PutWs0cuasData,會使用RequestLive的情況下直接對資料庫修改資料,POST會產生錯誤

Record/key deleted

Table的主KEYCuas001,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).

這個語法在IB5IB7是可以的,解法為將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

故後面條件所給予的值也必須是字串型態。

此語法在IB5IB7可以過

9

Select * from ws0cust where cust001=-1

Conversion error from string “Test “

cust001為字串型態,而where語法的右邊為-1的整數型態,Firebird會先將左邊欄位的值試著轉為整數,所以出錯,但IB5這句語法是沒有錯誤的,解法為將=-1改為=”-1”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值