2 Replies Latest reply on Feb 26, 2013 2:37 PM by flanapa_wipro

    OLEDB upgrade causes change in number precision output

    flanapa_wipro

      Hi,

       

      After a sequence of upgrades and migrations we have the following symptoms.

       

      With PI-OLEDB version  3.1.0.0 numeric outputs were padded or chopped to give fixed width output.  eg. 12.3456789 becomes 12.3456 (7 chars) 12.34 becomes 12.3400 (7 chars)

       

      With PI-OLEDB version 3.3.0.1 no padding or chopping 12.3456789 is written as 12.3456789 and 12.34 stays as 12.34

       

      Is there some setting or config in the new PI-OLEDB which will allow output to be padded like above?

       

      The code used to produce the outputs is from a 3rd party and we are told that it does no padding or chopping of its own.

       

      Any ideas?

       

      Thanks,

       

      Paul

       

       

        • Re: OLEDB upgrade causes change in number precision output

          Hello Paul,

           

          I have been talking to PI OLEDB Provider (Classic) developers and there is no padding / chopping implemented in any of the versions.

           

          I have also installed both versions you mentioned and found that the behavior you describe for PI OLEDB Provider 3.1.0.0 is when casting to string. Version 3.1.0.0 is rounding to 4 decimal places. Recent versions do not round when casting to string. To be able to achieve a rounding / formatting the Format function was introduced (not supported in 3.1.0.0).

           

          Let's assume your 3rd party applications query looks similar to this:

           
          SELECT tag, time, cast(value AS String) value FROM picomp WHERE tag like 'SIN%' and time > '*-2h'
          

          The equivalent using Format function would look like this:

           
          SELECT tag, time, Format(value, '#.####') value FROM picomp WHERE tag like 'SIN%' and time > '*-2h'