Hey all,


I need a numeric data type with 38 digits, like number(38) in Oracle. Do we have that in DB2?


I checked SQL Limits in SQL Reference and i think we are limited to DECFLOAT(34). I'm wrong, right? 


Anybody help?




Views: 1055

Reply to This

Replies to This Discussion


NUMBER data type support has the following restrictions:
  • There is no support for the NUMBER data type with a precision attribute greater than 31, a precision attribute of asterisk (*), a scale attribute that exceeds the precision attribute, or a negative scale attribute. There is no corresponding DECIMAL precision and scale support for such data type specifications.

Correct me if I am wrong here, but in Oracle a Number(38) would be a 38 digit number with no decimal places, so in DB2 either a decimal or numeric type of 38,0 like decimal(38,0) would be what you want.

Hi Michael,


Thanks, but I have an error when I try to create with decimal(38,0) or numeric(38,0).


SQL0604N  O atributo de comprimento, precisão ou escala para coluna, tipo distinto, tipo estruturado, tipo de matriz, atributo de tipo estruturado, rotina, tipo de destino de conversão, mapeamento de tipo ou variável global "numeric(38,0)" não é válido.


Both just support 31 digits.


Yup, I thought that was decimal places, so it looks like a REAL or DOUBLE or FLOAT are your choices. Of course you could consider storing the first 31 digits in one column and the remaining in a second one.

Regardless, good luck!


Featured Downloads

Try BLU Acceleration on Cloud

© 2020   Created by channeldb2.   Powered by

Badges  |  Report an Issue  |  Terms of Service