Different results from the same calculations between SQL and PL/SQL

This SQL statement:
select 1074 * (4 / 48) from dual;
Gives the 89.5 result.
However this PL/SQL block
declare
    tmp     NUMBER;
begin
    SELECT 1074 * (4 / 48) into tmp from dual;
    dbms_output.put_line('Result '||tmp);
end;
Gives a different result:
Result 89.49999999999999999999999999999999999996

If I change and give my variable tmp, a precision and scale, (38.36) say the result is 89.5.

Ed. I did about 10g (10.2.0.4.0) and 11g (11.1.0.7.0) with the same result in both.

Published by: kendenny on July 9, 2010 10:19 for more information

What is your current value of NUMLARGEUR in SQL * more (I assume that you use as your tool)?

SQL> set numwidth 50
SQL> select 1074 * (4 / 48) from dual;

                                       1074*(4/48)
--------------------------------------------------
         89.49999999999999999999999999999999999996

Tags: Database

Similar Questions

  • Why can I get two different results from the same coefficients?

    I get two different results of the evaluation of the polynomial function.

    For the first, I get the coefficients of a polynomial function to adapt.  I feed the coefficients of the function made the function Eval Poly and get the correct 12.8582 result when I evaluate 49940.

    For the second, I create constant array of values that have been returned by the polynomial Fit function (I typed in).  However, I get an incorrect result of - 120.7913 when I feed the constant table the function Eval Poly when I evauate 49940.

    How this can happen when I use the same values in table?

    A picture of what I explained is attached.

    Hi Altran,

    are you sure about using the 'same '?

    You compare them? Do you have (at least) set them to 17 digits display properties?

    Please attach a VI instead of an image...

  • Different results from the "auto levels" in LR and PS

    I use LR + PS CC 2015 (latest versions).

    When you change the same photo into LR and PS (open in LR) and do a "leveling car" ("automatic Tonwertkorrektur") LR into PS Camera Raw Filter exposure settings, contrast, lighting,... are almost all different. And: the Visual result is more beautiful in PS - but I want to make fundamental changes in LR due to bulk editing capabilities.

    My question now is: why is it different? What is should not be the same algorithms in LR and PS because they both use ACR in the background?

    Or make me a different configuration for LR and PS?

    I'm stuck...

    MGo wrote:

    Strange, that is what it looks like to me the PS ACR:

    I don't have the camera profile selection box - as I have in LR...

    Yes, you are missing the "Camera profile" selector (Kameraprofil). I never saw that happen with the English language setting. You open a camera raw file? Only camera raw and converted DNG camera raw files will have camera profile selections. All other file formats will only show "Embedded" (Eingebettet). Perhaps with the language German selection it does not at all appear with formats JPEG, TIFF, etc. file formats?

    I suggest you post this question in the forum Photoshop here: General Photoshop Discussion

  • Different output for the same query in SQL Server and Oracle

    I have two tables table1 and table2

    -table1 has two columns c1 int and varchar c2. There are no constraints added in it. It contains data as shown below

    C1 c2
    -------------------
    d 6
    5 d
    102 g
    6%
    f 103
    5.
    501 j
    1 g
    601 n
    2 m

    -table2 has only a single column c1 int. There is no added in constraints. It contains data as shown below

    C1
    ----
    6
    1
    4
    3
    2

    now when I run below, given the query in sql server and oracle it gives me different results

    Select *.
    FROM table1
    table2 on table2.c1 = table1.c1 inner join (SELECT ROW_NUMBER() (any ORDER by ASC c1) AS c1 from table2)

    output of SQL server
    ------------------------
    C1 c2 c1
    --------------------------------
    1 g 1
    2 m 2
    3 h 3
    4 g 4
    5 d 5


    release of Oracle
    ----------------------
    C1 C2 C1
    ---------------------------------
    5 d 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2


    If you notice the first column in the two outputs. It is sorted in sql server and no oracle.

    Why he behaves differently in oracle? Is there a way I can fix this problem in oracle?

    Thank you
    Jigs

    It is NOT a behavior "differently" in Oracle; you did not specify just an order that you expect of your results, so you'll get output in what order the fantasies of the database showing (ie. no guaranteed order). It is an artifact of the way the database chooses to collect the data and databases (or same sets of data within the same database) can and will most likely behave differently.

    Same SQL Server will not be guaranteed to always get your data in an orderly manner if you exclude the order by clause, even if you think that there always display the data in an orderly manner.

    Your solution is to add an order by clause, in the TWO databases, to force the order of the data output.

  • Different results from the the DLL source code

    Hi all

    I'm new to this forum and also to labview so understandable...

    Then, I got a source project with many under vi of that graphic plots of excel files. I also got the exe after generation.

    The problem is, if I try to compile this project again, the exe gives me different results than what I already have. They should be the same, because I does no update in the source code.

    Can someone explain this behavior? I don't know anything about how it has been made because the guy who create this left the office... I need to make a few updates, but first of all, I have to build corectly.

    Thank you

    Have you compared the date of the exe file with the date of the source code? Are you absolutely sure that no changes have been made to the source code after the build? The construction specifications are part of the project. Unless you changed something there, builds should be the same.

    You have the source code control? Issues like this should not be a if you make and use wisely.

  • Why do I get different results for the same resolution but different boxes of Windows, Windows 7 and XP

    I use an .exe on two different windows boxes, in Windows 7 and XP.  I put both for resolution 1024 x 768.

    Win 7 (old laptop and Dell desktop computer) I have a large application to watch.  On the WIn XP boxes all fonts to big.  It doesn't make sense for me as all PC's have the same resolution.

    Has anyone go through this before?

    System for XP and Vista/Win7 fonts are different.

    See

    http://forums.NI.com/T5/LabVIEW/elements-have-moved-when-opening-VI-with-F3-patch/m-p/1054817

    http://forums.NI.com/T5/LabVIEW/what-can-affect-the-size-of-a-front-panel-object-between/m-p/1058607...

    http://forums.NI.com/T5/LabVIEW/font-size-on-Windows-7-with-LabVIEW-2009/m-p/1055114/highlight/true#...

    and several other similar topics.

  • different results for the same statement 9i / 10g why?

    Hi all

    I have problem in the SQL statement that it worked very well in oracle 9i, once I upgrade to 10g, this statement does not work

    I create a table:
    create table TEST_TAB (colA tank (6));

    insert into TEST_TAB values ('A');

    now when I run the following statement in oracle 9i

    Select count (*)
    of TEST_TAB
    where colA as "A";


    Count (*)
    ---------------
    1

    But in oracle 10g

    It gives
    Count (*)
    -----------
    0

    I know I can fix education by adding % at the end to bring data or triming CLC, but I can't because that statement use frequently in the application source

    My question, how can I solve this problem, what the related setting for this I check all the nls_... setting, it's the same in oracle 9i


    all boards

    Yes, it's Bug 2883715 possible bad results of AS against a column of type CHAR with no wildcard

    [Bug 2883715| https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=2883715.8]

    If you have everything you need to tell the developers what needs to be done.

  • Different results, running the same Javascript - CC vs CS6

    I am having some problems affecting the font size of a text using Javascript. For some reason, I always get characters of 2.88 points as opposed to what I put it to (in this case, it's 12). Anyone know what is the problem that the PS is not recognizing the command to set the font size here and why?

    #9740928-Pastie

    Line 42 is where I'll put the size.

    Line 27, that's where the variable is defined. I tried just punching in an integer with the same results.

    Thanks for any help.


    So I think that there could be a problem with Adobe CC or maybe some changes in its development with regard to the way he treats the Javascript. I ran several tests today and did some reading. At the end of the line, I decided to try the script on CS6 and I got the correct results. The script works on CS6, but not cc? I made an example of script I did my tests to take a pic to Adobe team. It's the end of this post.


    I'm not the master script by any stretch of the imagination, but I find it odd that this script works correctly on Adobe CS6, but does not change the size of font correctly on Adobe CC. I expect that same results. If any of you come up with anything please let me know. Cheers.

    BEGINNING OF THE SCRIPT

    var defaultRulerUnits = preferences.rulerUnits;

    preferences.rulerUnits = Units.PIXELS;

    var AD = activeDocument;

    Size = 53;

    var TextLayer = AD.artLayers.add ();

    TextLayer.kind = LayerKind.TEXT;

    TextLayer.opacity = 90;

    var txtRef = TextLayer.textItem;

    txtRef.font = "Impact."

    txtRef.contents = size;  The size of 53 is reflected in CS6, but when this script is run on CC, is not. Sometimes 12, sometimes it is 2.88.

    txtRef.size = size;

    END OF SCRIPT

    ^ I save it as a. JS


    Post edited by: Clayton Krause

    The ruin of font size of DOM somewhere in 2014 of the CC is a known problem.

    Re: Do you have CC 2014.2 break textItem.size?

    The alternative would use code AM.

  • shows different images on the same chassis with half and full resolution

    In the same framework, don't know why I'm using half resolution or high resolution, the same show different picture frame

    sometimes half resolution shows the picture right on some frames, but sometimes not, and vice versa.

    for example.

    at 02:00 I put picture called "pic5" on the chassis, but full resolution shows the photo of "pic6", and although I use half of the resolution to see a preview, it shows "pic5.

    but at 03:00 I put picture called "pic4" on the chassis, full resolution shows the 'pic4' photo, but half resolution to preview, it shows "pic5.

    and while I'm making, it uses the result of full resolution

    I had used Edition > purge > all memory and hidden, to address this problem sometimes, but not everytime.

    How do I do with it?

    I had used edit > purge > all memory and hidden, to address this problem sometimes, but not everytime.

    How do I do with it?

    Well Yes, it is a cache problem. You should try to remove all your cache completely-> memory and disk cache preferences

  • I need several Web sites with different models but the same data. (Headers and footers different no body)

    I use Dreamweaver 20141. I do it literately tons of sites and each has hundreds of pages, so I need a way almost drag and then just change the links which would make things go a lot faster. Data or the body is going to be the same as the model data.

    Use the SSI (SSI) to put the code of the repetitive content body in a separate include file.

    Build your various pages with unique headers and footers, and then "call" content with a PHP link.

  • SimpleDateFormat giving different results for the same string in the form

    I use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/i18n/SimpleDateFormat.html for formatting my date and time fields.

    I got a bug report that a device on English (UK) has a problem where the time turns off the screen, and I was able to reproduce this on device and Simulator.

    It's the pattern string that I use: hh:mma

    (hour 2 digits, colon, minute 2-digit and one letter for 'a' or 'p')

    English or r I get the result you want, for example 12: 12 p '

    "On English (UK), I get two letters for one / p marker, for example ' 12:12.

    (as if I had used 'hh:mmaa').

    What is the desired behavior? My client doesn't like it and wants a look and feel unique, with only one letter for 'a' or 'p', and I'm a little hesitatant to use aubstring...

    I usually do so, but our customer asked specifically localized to the date and time formatting.
    I have the model in my resource files, as the requested values are not easy to manage with the dateformat standard.

    Well, I have submitted comments on the entry of doc API, the doc is fake or the OS has a bug.
    I use substring if the string endsWith (am or pm) now...

  • Using different filters on the same measure in single result table (view)

    I have a table of twelve columns, each column with different filters tailor-made same table actually. Say a filter column (several people existing on 01/01/2003) comes from people dimension (date_of_birth < = January 1, 2003 ""). Two filter in column b (number of people living in Bucharest between 1 January 2004 and 1 January 2006 "") is (between 2004 and 2006 date_of_birth) etc.
    How do I use column a & column b in the same table of results (view)? I need the different filters on the same table.

    Thank you!

    Published by: seiciu on March 27, 2010 08:51

    Hello
    This filter clause works.
    filter (using Date = current_date)
    filter (using Date = date'2010-01-01')
    filter (measures using the year between 2004 and 2006)
    Concerning

  • Can someone explain why these two paintings 'look' different even if they are from the same source?

    Hi all!

    I'm just curious, why these two tables are different and are they really different in terms of structure, even if they are from the same source? The left is the exit of tdms get properties and the other is a power of arry auto indexed.

    Nilesh-

    No doubt, you are referring to the visual aspect, since the data are the same. One of them uses a different type of indicator of the chain. You probably click right and choose 'create-> Indicator '. When you perform this LabVIEW will use the same style of indicator as what sub-VI/uses. In case you made directly from the PDM function, but the other was created between the autoindex loop tunnel for, in the second he used everything that was default in your preferences.

  • can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    Yes. The only problem that I see if Macs were different countries. The method of payment in the account/ID must be associated with the country where the unit is located and you can only buy Apps from the store of the country where the computers are located

  • When I create two keyframes at the same position between keyframes at different positions this way adds a loop. How can I get rid of the loop?

    When I create two keyframes at the same position between keyframes at different positions this way adds a loop. How can I get rid of the loop? I was just by dragging the handles on the vertex point, but I want to get rid of the loop together.

    Focus on the Bezier handles on the motion path in the Composition window. You can select the tool pen (g) and hold down the Alt/Option key to select the tool convert Vertex (it looks like a V on the side) and then fix the handle manually or click on the top of the trajectory to change it to a straight line. You can also play with spatial interpretation Keyframe.

    To avoid this, you can change the interpolation of keyframes in space to linear preferences. Most of the time I don't like straight so I keep my default value of Bézier.

Maybe you are looking for

  • Airport express to extend wi - fi using the adapter but NOT extreme airport

    Hello I am looking to buy an express airport in order to listen to music through my stereo and also create another network wireless upstairs in my house. My question is, I currently have no apple down wireless router and I have connected to a line ad

  • Any chance you get the status bar?

    Any chance can get you the status bar, because all updates FF28 past do not have the status bar which is where most of my favorite Addons are located (for example, eQuake Alert and ForecastFox. It's really annoying. I had to disable the automatic upd

  • Satellite Pro M70 recovery disk - where can I get a new one?

    Hi all. I'm trying to help my friend to untangle its M70 that was severely marred by many pieces of adware, malware, trojans... you name it. It has very little installed or stored on it so a complete reinstallation seems to be the easiest option. How

  • Context of the sequence becomes invalid when the runtime is longer

    I have a sequence that loop for about 70 k iterations (which is pretty huge). The sequence called a subsequence where the inhabitants of the sequence called are modified. Question is, around 65 th iteration k, I get an error message indicating that t

  • Scans to scan in blank page

    My HP Officejet Pro 8600 to analyze very well.  Now it's scanning copy very very light, and the third was empty.  The printer and copy the feature work very well.  Is the blow to scan?