Focal Point
Float returned instead of integer

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9801010313

January 08, 2009, 06:39 PM
JK
Float returned instead of integer
I have a fex that I am using as a wrappper around some sql queries. In my fex I have it do a PRINT * so that it can be as generic as possible.

When I run my query in SQL PLUS it brings back the results from my Oracle database as Integers. When I run the query by calling it from the fex, it comes back and displays as floating. Why is this happening and how do I get it to stop? I do not want to have to specify each field manually and then change the type to I.


ENGINE SQLORA SET DEFAULT_CONNECTION &CONNECTION
SQL SQLORA PREPARE SQLOUT FOR
-INCLUDE &TEST
;
END



TABLE FILE SQLOUT
PRINT *


HEADING
&HEADLINE1
&HEADLINE2
FOOTING
&FOOTLINE1
&FOOTLINE2

ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *


7.7.02/AIX/Excel, PDF, HTML
January 09, 2009, 05:24 AM
hammo1j
wf looks at number attribute only of Oracle column and does not regard digits and precision chosing an overall default type of D20.2 which can be varied by various means but not adjusted so it takes account of the precision on individual fields.

This from the manual

Considerations for the NUMBER Data Type
When working with the NUMBER data type, where the precision is between 32 and 37, by
default the NUMBER data type is mapped to the server data type double float (D), with a
precision of 20 and a scale of 2.
When working with the NUMBER data type, where the precision is 38, by default the
NUMBER data type is mapped to the server data type Integer (I), with a display length of
11.
To override the precision of the NUMBER data type, where the precision is between 32 and
38, use the ORANUMBER setting.


Syntax: How to Set ORANUMBER
ENGINE [SQLORA] SET ORANUMBER {COMPAT|DECIMAL}
where:
SQLORA
Indicates the Adapter for Oracle. You can omit this value if you previously issued the
SET SQLENGINE command.
COMPAT
Indicates that the NUMBER data type will be mapped to the server data type double
float (D), with a precision of 20 and a scale of 2. COMPAT is the default value.
DECIMAL
Indicates that the NUMBER data type will be mapped to the server data type decimal
(P), with a precision of 33.


The only way round this is to create a master.

Ironically there are ways to alter the less frequently used integer, float and double oracle types!


Example: Setting the Precision and Scale Attributes
The following example shows how to set the precision attribute for all INTEGER 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 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




Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo