EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Converting an INT to DECIMAL

    Posted Tue May 17, 2016 09:13 AM

    In EGL when I attempt to assign an INT field to a DECIMAL field I get a warning error about it possibly being truncated.  Is there a built in function I should be using to get rid of the warning error or should I just ignore the error?

    msoucy


  • 2.  Re: Converting an INT to DECIMAL

    Posted Tue May 17, 2016 10:08 AM

    Hi,

    I think there is not a built in function...

     

    You could use a larger decimal field:

    decimal(9);

    decimal(10,1);

    decimal(11,2);

     

    But why do you don't use only an INT field if the value has no decimal places?

     

    Kind Regards!

     

     

     

    Marcel-D


  • 3.  Re: Converting an INT to DECIMAL

    Posted Tue May 17, 2016 10:26 AM

    Okay, here's a little background on what I am doing.  I'm pulling data from a MS SQL Server database developed by a software vendor.  They have defined their database column as INT.  The database column has a possible value of 1 - 5.  The data I am pulling from the SQL Server database table is being stored in a DB2 table on our IBM i.  In my DB2 table I had defined the column as decimal(1, 0). The data used to be captured in my EGL program, but now it's being captured in a SQL Server database application. Other data is captured in my EGL application that does not exist in the SQL Server application.  All this data is brought together and is used to generate various reports that were originally developed prior to the purchase and implementationof the SQL Server application.  I guess I will just ignore the warning errors as it's not worth the effort to redefine my DB2 table.  Thank you for your help.

    msoucy


  • 4.  Re: Converting an INT to DECIMAL

    Posted Tue May 17, 2016 03:26 PM

    Mike,

     

    Decimal(1,0) will not hold as large of a number as is possible in an INT field.   So, that is why the warning comes out.   If you don't want the warning, then change the EGL Editor preferences.  There is a preference that was added at 9.1 or 9.1.1 which says that "Warn when moving data to a smaller field".    If you don't want the warning, then uncheck this.   You can also ignore if you know the data will never be too big for the decimal(1,0) field.

     

    take care.

     

    Mark
     

    markevans