Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2010Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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, 2010Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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, 2007Report 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, 2010Report 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: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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, 2005Report 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, 2005Report 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.


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report 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: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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, 2005Report 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, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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

Copyright © 1996-2020 Information Builders