Error translated from Portuguese to English: “Error data conversion or data format conversion.”
I have created a view:
MNUM DECIMAL 8,0
create view db.abc as select * from x where decimal(SUBSTR(MNUM, 2,6), 6, 0) = 57092
the mnum looks like 1057092 in this example, SUBSTR(MNUM, 2,6)=057092 and decimal(SUBSTR(MNUM, 2,6), 6, 0) should be = 57092 but throws that error!
thanks for any help
You can use the MOD function to get a part of the number instead of struggling with the char and numeric operations
They return the same result, but the last one can be applied for number operations only. And, if you wat to secure your number to a decimal with 6 places, you can do this (if your DB2 version allows it):
Just to be sure that your operation can work, you should evaluate if the MNUM value is not null: