Posted on 2009-04-03 09:27
Prayer 閱讀(1994)
評論(0) 編輯 收藏 引用 所屬分類:
DB2
db2數據類型轉換:
money為Integer Integer ----> char char(money)
char -------> Integer Integer(trim(char(money)))
money為double(8,2) double ----->char char(cast(money as decimal(8,2)))
char ------->double cast(cast(char(cast(a.money as decimal(8,2))) as decimal(8,2)) as double)
money為decimal(8,2) decimal ------->char Digits(money)
char ------->decimal cast(Digits(money) as decimal(8,2))
money為date date ------>char char(money)
char ------>date date(trim(char(money)))
money為bigint bigint ---->char char(money)
char ----->bigint cast(char(money) as bigint)
這是我在項目過程中遇到的一個通過觸發器保存刪除掉或者修改掉的數據到一個xml列中,組串的時候需要用的。用掉我一個上午四處找資料,實驗。
網上的很多介紹都太籠統,不適用。有錯誤的地方請指出,如果還有需要添加的,或者您認為重要的可以通知我,我會加上的。謝謝!
http://blog.csdn.net/anyoneking/archive/2007/11/01/1861337.aspx