Posted on 2009-04-03 09:27
Prayer 閱讀(1994)
評(píng)論(0) 編輯 收藏 引用 所屬分類:
DB2
db2數(shù)據(jù)類型轉(zhuǎn)換:
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)
這是我在項(xiàng)目過程中遇到的一個(gè)通過觸發(fā)器保存刪除掉或者修改掉的數(shù)據(jù)到一個(gè)xml列中,組串的時(shí)候需要用的。用掉我一個(gè)上午四處找資料,實(shí)驗(yàn)。
網(wǎng)上的很多介紹都太籠統(tǒng),不適用。有錯(cuò)誤的地方請(qǐng)指出,如果還有需要添加的,或者您認(rèn)為重要的可以通知我,我會(huì)加上的。謝謝!
http://blog.csdn.net/anyoneking/archive/2007/11/01/1861337.aspx