DB2數(shù)據(jù)類型轉(zhuǎn)換要用到的操作代碼描述
此文章主要向大家描述的是DB2數(shù)據(jù)類型轉(zhuǎn)換的實際操作步驟,我們首先是以介紹DB2數(shù)據(jù)類型轉(zhuǎn)換的實際操作代碼來引出DB2數(shù)據(jù)類型轉(zhuǎn)換的操作步驟,以下就是文章的主要內(nèi)容的詳細描述,望大家在瀏覽之后會對其有更深的了解。
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)
這是我在項目過程中遇到的一個通過觸發(fā)器保存刪除掉或者修改掉的數(shù)據(jù)到一個xml列中,組串的時候需要用的。用掉我一個上午四處找資料,實驗。網(wǎng)上的很多介紹都太籠統(tǒng),不適用。有錯誤的地方請指出,如果還有需要添加的,或者您認為重要的可以通知我,我會加上的。謝謝!
以上的相關(guān)內(nèi)容就是對DB2數(shù)據(jù)類型轉(zhuǎn)換的介紹,望你能有所收獲。
【編輯推薦】