Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] data format issue with decimal
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] data format issue with decimal
 Login/Join
 
Gold member
posted
Hi all,
We have currency column with data type (number) in Dbase.
When I pull the data from the dbase value is showing with 4 decimals (e.g 0.16754).
But when I am trying to pull the data from Web focus environment as below, it showing the data with two decimals.
ENGINE SQLORA SET DEFAULT_CONNECTION &SEL_DSN
ENGINE SQLORA
SELECT CURRENCY FROM CUR_TABLE;
TABLE FILE SQLOUT
PRINT *
END
-EXIT
I need to show the data till 4 deciamls.
Could you please suggest, how can i do this?
Thanks,
Raghu

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
What is the format of the column in Oracle ?

If you add ?FF after TABLE FILE SQLOUT, what is shown ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6175 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Waz,
Thanks for your response.
Format of the column in Oracle is Number,
After adding ?FF in TABLE FILE SQLOUT,It is showing D20.2

Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
I think WebFOCUS is getting confused with the format, are you able to force the format to what you want in the SQL, then it should come through OK.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6175 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I believe the standard WebFOCUS conversion for a plain number field in Oracle is D20.2. I think you will need to define your Oracle currency column as something like number(9,4) in order for WebFOCUS to assign more decimals to the converted column.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Waz,
i tried to force the data type to D20.6 but it is showing the same as .1300 instead of .1345


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
ENGINE SQLORA SET DEFAULT_CONNECTION &SEL_DSN
ENGINE SQLORA
SELECT
TO_CHAR(CURRENCY,'$999,999,999,999,999.9999') "Currency" FROM CUR_TABLE
;

TABLE FILE SQLOUT
PRINT *
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1960 | Location: Centennial, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
SQL SQLORA
SELECT 12345.678912 AS NUM FROM DUAL;
TABLE FILE SQLORA
PRINT NUM
END


Result -> 12,345.68 Mad

SQL SQLORA
SELECT CAST(12345.678912 AS NUMBER(16,6)) AS NUM FROM DUAL;
TABLE FILE SQLORA
PRINT NUM
END


Result -> 12345.678912 Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
If we HOLD the results from the script above we can see that WF now sees the data retrieved as P18.6 instead of the default D20.2, therefore keeping the precision closer to what you need:

0DEFINITION OF HOLD FILE: HDATA
0FIELDNAME                         ALIAS         FORMAT
 NUM                               E01           P18.6       MISSING = ON


Hope this helps.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I had this issue last week. Went to Adapter Administration for UNIX, Windows, OpenVMS, i5/OS, and z/OS (DN4501040.1110). On page 1669 is the Oracle section How to Override the Default Precision and Scale. Based on this, I tried:

ENGINE SQLORA SET CONVERSION FLOAT PRECISION 24 8

This produced the desired precision.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 146 | Registered: October 19, 2010Reply With QuoteReport This Post
Master
posted Hide Post
I'm not sure why WebFOCUS allows D20 when the documentation says that D format allows for 15 significant digits. Packed fields (P format) allows 31 digits. Maybe an IBI person can answer that.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 946 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:
ENGINE SQLORA SET CONVERSION FLOAT PRECISION 24 8

Cool! I wish I'd read that manual before Roll Eyes



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Yes...it is working with ENGINE SQLORA SET CONVERSION FLOAT PRECISION 24 8

Thanks...


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] data format issue with decimal

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.