03 December 2008

Reading Oracle NUMBER Datatype Column

[DSEE 8.0.1, Oracle 10g, AIX]
Event Type: Warning
Message: ora_bay_ts_cust_info: Column CUST_ID floating point decimal is not fully supported; adjusting the scale.
Message: ora_bay_ts_cust_info: When checking operator: When binding output interface field "CUST_ID" to field "CUST_ID": Implicit conversion from source type "decimal[38,10]" to result type "decimal[38,0]": Possible precision limitation.

Details:
BAY_TS_CUST_INFO เป็นตารางบน Oracle 10g โดยที่ Column CUST_ID เป็น Primary Key มี data type คือ Number
Warning นี้จะเกิดขึ้นเฉพาะการอ่านข้อมูลจาก Oracle Enterprise Stage บน column ที่มี data type เป็น Number เท่านั้น ถ้าเป็น Number(n) หรือ Integer หรือ Decimal(m,n) จะไม่เกิดปัญหานี้
cust_id_number 

Cause:
data type NUMBER ของ Oracle เป็น data type ที่ไว้เก็บตัวเลข สามารถยืดหยุ่นเป็น Integer หรือ Decimal ก็ได้ โดยสามารถขยายไปได้ถึง Decimal(38,10). เมื่อเรา import table definition DataStage จะเลือกใช้ Decimal(38,10) แทน NUMBER. Warning ที่เห็นเกิดขึ้นเพราะ DSEE ไม่ support data type NUMBER ของ Oracle ทำให้ DSEE ทำการเปลี่ยน scale ของตัวเลขไป ซึ่งขณะนี้ก็ยังไม่ทราบว่าการทำงานภายใน DSEE เองไปเปลี่ยนแปลงตัวเลขนี้อย่างไร 

Action1:
ถ้ามองว่า warning message นี้ไม่สำคัญมากนัก ให้ Suppress warning log ไปก็ได้
or Action2:
ให้แก้ SQL statement ตอนที่ select data ออกมาจาก Oracle Enterprise Stage โดยใข้ CAST function  เช่น
select cast(col1 as decimal(38,10)) as col1 from tab1;

No comments: