简体   繁体   English

在z / os的DB2 sql中将smallint填充为0

[英]pad smallint with 0s in DB2 sql for z/os

is there any way to pad 0's to smallint in DB2 for mainframe z/OS. 在大型机z / OS中,有什么方法可以将0填充到smallint。 I am not writing any program but running query directly on DB2 QMF. 我没有编写任何程序,而是直接在DB2 QMF上运行查询。

Field definition: 栏位定义:

Column Name  Col type length
some_column  Smallint  2

 some_column     result
 -----------     ------
  288         ==>  0288
  88          ==>  0088
  1224        ==>  1224

在DB2 for z / OS的当前所有受支持版本中,都有一个功能DIGITS()可以完全满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM