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     [closed] WebFOCUS only keeps 2 decimal digits from Oracle SQL Passthrough

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[closed] WebFOCUS only keeps 2 decimal digits from Oracle SQL Passthrough
 Login/Join
 
Platinum Member
posted
I just notice that when doing SQL Passthrough from Oracle in our system, webfocus will only keep 2 decimal digits :

Example:

(TWR_1M is a NUMERIC field with about 10 decimal digits)

SQL SQLORA
SELECT TWR_1M 
FROM U_CA_REP;
END


-- This will return numbers in 0.00 format


SQL SQLORA
SELECT CAST(TWR_1M AS NUMERIC(10,4)) 
FROM U_CA_REP;
END


-- This will return numbers in 0.0000 format

However, I need to use CASE...WHEN...END in the SQL. Even with a CAST, webfocus will always return 0.00, although the same query will return the desired precision in DBVisualizer:


SQL SQLORA
SELECT 
CASE WHEN TWR_1M = 0 OR TWR_1M IS NULL THEN NULL
ELSE CAST(TWR_1M AS NUMERIC(10,4)) AS RET_1M 
FROM U_CA_REP;
END



This has never been a problem in MS SQL Server.

Is there a server setting I can prevent webfocus from only returning 2 decimal digits?

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


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Expert
posted Hide Post
Is it possible that your data adapter connection is set to do this by default, or that there is a setting in edasprof.prf that sets the decimal places to 2?

Look at Adapter Administration for UNIX, Windows, OpenVMS, IBM i, and z/OS > Using the Adapter for Oracle > Changing the Precision and Scale of Numeric Columns".

quote:
The following example shows how to set the precision attribute for all INTEGER and SMALLINT
fields to 7:
ENGINE SQLORA SET CONVERSION INTEGER PRECISION 7
The following example shows how to set the precision attribute for all DOUBLE PRECISION
fields to 14 and the scale attribute to 3:
ENGINE SQLORA SET CONVERSION FLOAT PRECISION 14 3
The following example shows how to set the precision attribute for all INTEGER and SMALLINT
fields to the default:
ENGINE SQLORA SET CONVERSION INTEGER RESET
The following example shows how to set the precision and scale attributes for all fields to
the defaults:
ENGINE SQLORA SET CONVERSION RESET


We have these settings in our edasprof.prf:

ENGINE SQLORA SET DATETIME OFF
ENGINE SQLORA SET VARCHAR OFF
ENGINE SQLORA SET FETCHSIZE 1000


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Francis,

I was able to solve this by adding

ENGINE SQLORA SET CONVERSION FLOAT PRECISION x y


to edaprof.

I also suspect that someone may have set this in the connector. But I when I open connector setting from the webconsole I only found this:

 OPTIMIZATION    
 OPTIFTHENELSE    
 FETCHSIZE      
 INSERTSIZE      
 AGGREGATE_AWARENESS    
 
Controlling Session Parameters  
 AUTODISCONNECT    
 NONBLOCK      

Miscellaneous Settings  
 PASSRECS    
 

None of the above is related to precision. Is there any other place that I should look into?

Thanks!


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Virtuoso
posted Hide Post
SQL SQLORA
SELECT 
   CAST(
      CASE WHEN TWR_1M = 0 OR TWR_1M IS NULL THEN NULL
      ELSE TWR_1M 
      END
   AS NUMBER(10,4)) RET_1M 
FROM U_CA_REP;
END


This will give you a consistent format.

CAST the whole CASE statement, not just a portion of it. Otherwise the iWay Adapter for Oracle must adjust for the "bigger" numeric definition it will receive and may default to D20.2 internally.

You haven't mentioned what the actual data precision and scale of TWR_1M is in your database. That may help clear out some of your doubts ... or make them worse Big Grin



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
njsden, good to know that. Maybe this is webfocus default. Thanks.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report 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     [closed] WebFOCUS only keeps 2 decimal digits from Oracle SQL Passthrough

Copyright © 1996-2020 Information Builders