PreparedStatement.setFloat does not enter precise values into database

Hi
I have written a program where I am entering a record in to the
database using a prepared statement. The problem is for float datatypes, the
values being entered into the database are not rounded off. e.g. 1.65 is
being entered as 1.64999999
I am using the Sybase database and the driver is
com.sybase.jdbc2.jdbc.SybDriver.
If I replace PreparedStatement with Statement I am getting the precise values
Regards
Sudeep

SOME THINGS YOU SHOULD KNOW ABOUT FLOATING-POINT ARITHMETIC
What Every Computer Scientist Should Know About Floating-Point Arithmetic
Beat yawmark to it :-)

Similar Messages

  • Function Does Not Return any value .

    Hi ,
    I am wrtting the below funtion without using any cursor to return any message if the value enters by parameters
    does not match with the value reterived by the function select statement or it does not reterive any value that
    for the parameters entered .
    E.g:
    CREATE OR REPLACE FUNCTION TEST_DNAME
    (p_empno IN NUMBER,p_deptno IN NUMBER)
    RETURN VARCHAR2
    IS
    v_dname varchar2(50);
    v_empno varchar2(50);
    V_err varchar2(100);
    v_cnt NUMBER := 0;
    BEGIN
    SELECT d.dname,e.empno
    INTO v_dname ,v_empno
    FROM scott.emp e , scott.dept d
    WHERE e.empno=p_empno
    AND d.deptno=p_deptno;
    --RETURN v_dname;
    IF p_empno IS NOT NULL AND p_deptno IS NOT NULL
    THEN IF v_dname is NULL THEN
    v_err :='Not Valid';
    RETURN v_err;END IF;
    ELSIF p_empno IS NOT NULL AND p_deptno IS NOT NULL
    THEN IF v_dname is NOT NULL THEN
    RETURN v_dname; END IF;
    ELSE
    RETURN v_dname;
    END IF;
    END;
    Sql Statement
    SELECT TEST_DNAME(1234,30) FROM dual
    AND IF I enter a valid combination of parameter then I get the below error :
    e.g:
    SQL> SELECT TEST_DNAME(7369,20) FROM dual
    2 .
    SQL> /
    SELECT TEST_DNAME(7369,20) FROM dual
    ERROR at line 1:
    ORA-06503: PL/SQL: Function returned without value
    ORA-06512: at "SCOTT.TEST_DNAME", line 24
    Where I am missing .
    Thanks,

    Format you code properly and look at it:
    CREATE OR REPLACE
       FUNCTION TEST_DNAME(
                           p_empno IN NUMBER,
                           p_deptno IN NUMBER
        RETURN VARCHAR2
        IS
            v_dname varchar2(50);
            v_empno varchar2(50);
            V_err varchar2(100);
            v_cnt NUMBER := 0;
        BEGIN
            SELECT  d.dname,
                    e.empno
              INTO  v_dname,
                    v_empno
              FROM  scott.emp e,
                    scott.dept d
              WHERE e.deptno=d.deptno
                AND e.empno=p_empno
                AND d.deptno=p_deptno;
            --RETURN v_dname;
            IF p_empno IS NOT NULL AND p_deptno IS NOT NULL
              THEN
                IF v_dname is NULL
                  THEN
                    v_err :='Not Valid';
                    RETURN v_err;
                END IF;
            ELSIF p_empno IS NOT NULL AND p_deptno IS NOT NULL
              THEN
                IF v_dname is NOT NULL
                  THEN
                    RETURN v_dname;
                END IF;
             ELSE
               RETURN v_dname;
           END IF;
    END;
    /Both p_empno and p_deptno in
    SELECT TEST_DNAME(7369,20) FROM dualare not null. So SELECT will fetch some v_dname and v_empno. Since p_empno and p_deptno iare not null your code will go inside outer IF stmt and will execute its THEN branch. That branch consist of nothing but inner IF statement. And since v_dname is NOT NULL it will bypass that inner IF and exit the outer IF. And there is no RETURN stmt after that outer IF. As a result you get what you get - ORA-06503. Also, both if and elsif in your code check same set of conditions which makes no sense.
    SY.

  • Security Update 2008-006 SHA 1 digest does not match posted value

    : /usr/bin/openssl sha1 SecUpd2008-006PPC.dmg
    SHA1(SecUpd2008-006PPC.dmg)= 7b3aed47dbad3d55d90d093a6fb7a81c34c22a2c
    does not match the value:
    61898bf315d04958aaf487bb92ba257d059a33ce
    posted on the web page:
    http://www.apple.com/support/downloads/securityupdate2008006clientppc.html
    I've downloaded the file more than once but I get the same SHA1 value each time. I get this value:
    7b3aed47dbad3d55d90d093a6fb7a81c34c22a2c
    The disk image mounts but I'm reluctant to install a security update (or anything else) that does match the posted SHA1 value.
    Is the value posted on the web page wrong and the one I've gotten from the downloaded file correct or am I getting a corrupted/modified disk image?

    Thanks for looking into this. As fas as I am concerned it is no corporate or school network. I have downloaded the file at home from my personal internet connection. This is a DSL connection that runs through a DSL router. My computer is connected directly to the router via ethernet cable. There is a firewall (packet filter) in place but nothing (that I know of) that modifies download files.
    I have never had such problems before with this internet connection. And I have downloaded quite a lot of updates from Apple's web site with this connection and always checked the sha1 digest.
    I just downloaded the security update at the company I am working for. So this is a corporate network. I got the same sha1 digest as before at home. Not sure if this helps.
    Holger

  • All-in-one 6830 printer Does not enter sleep mode when connected to a phone line

    HP staff  help. HP all-in-one printer 6830 does not enter sleep mode when conntected to a phone line via 1-Line jack.  The Firmware is PNP1CN1521AR. On August 1, 2015,  I purchased an HP all-in-one 6830  printer and upgraded to firmware PNP1CN1521AR.When a phone line is connected to 1-Line jack of 6830, the printer will no longer enter  sleep mode and the display remains on indefinitly.Removing the phone connection either from the wall outlet or from the printer causes the sleep mode to work correctly again where the control panel display turns off after 5 minutes (or optionally  after 10 or 15 minutes).This problem was previously reported by a user and has not been resolved, see:http://h30434.www3.hp.com/t5/Other-Printing-Questions/Sleep-mode-of-Officejet-Pro-6830/td-p/4772182 The user did not receive a resolution to this problem according to the thread.
    There seems to be a  6830 printer firmware or hardware problem causing this. HP  should be able to confirm this problem on 6830 easily.
    Please advise ASAP.
    Thanks 

    It's a regular analog phone line. I've tested it with other phone lines. No difference. I have another all-in-one printer which works fine (goes to sleep mode) when plugged into the same phone line.
    The 6830 works ok in other aspects. The only problem is the sleep mode. Any 6830 with the firmware I mentioned should replicate the same result, regardless of anything else. The previous firmware to PNP1CN1521AR also created this problem according to the original report of this problem by another user.
    I'm sure there's a bug in the firmware. A subroutine in the firmware monitoring the incoming fax ringing, mistakenly, sees the voltage across the phone jack pins as an event and wakes up the printer instantly even though there's no ringing. As the previous user also suspected, there seems to be an error in the phone line voltage threshold used by the firmware. The present firmware always sees a ringing at the phone line which causes it to never stay in sleep mode.

  • Visual Studio 2012 SharePoint Project Error : The partial project item type does not have a value for this property

    Hi,
    I am getting this error from visual studio 2012 whenever i try to create the following project types:
    - Workflow Custom activity
    - Web parts
    The error is as mentioned below
    "The partial project item type does not have a value for this property"
    Due to this the when I add above type of items in my project, they show a red cross icon against them.
    Please let me know If have you any solution?

    Hi
    I had same issue. Below is the solution
    Installing
    "Visual Studio 2012 Update 3" usually solves this problem. (You can download it through microsoft's official site at
    "http://www.microsoft.com/en-in/download/details.aspx?id=39305")
    Hansraj Rathva

  • My Ipod Touch (4g) does not enter itunes.

    If I plug my ipod in my computer. Itunes is supposed to start but it doesn't anymore.
    Also if I start Itunes by myself, my Ipod does not enter it.
    There is no sign that my Ipod is connected to my Itunes, so I can't synchronise it.
    I've already tried to re-install Itunes and many other things but it still doesn't work.
    I really hope someone can help me.

    Try
    iOS: Device not recognized in iTunes for Windows
    I would start with               
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or               
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    New cable and different USB port?
    Runs this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Try on another computer to help determine if computer or iPod problem

  • In a purchase order for 3 GR's Quantity does not equal the value

    Hi,
    I have found the difference in one purchase order, there have been 3 GRs where the Qty does not equal the Value.  How has this happened?
    Any guesses why the difference has come.
    Thanks&regards,
    Veena

    Hi Vishal,
    In po history for agt 3 Gr's  Quantity does not equal the values. I hope the difference is Movement types. But exactly where to check this movements i am not getting.
    Can you tell me this which T.code.
    Tx,

  • Report similar to MC$4 that does not show absolute values

    Hi all,
    We need a report similar to Report similar to MC$4 which has the same drilldown capabilities but does not show absolute values, and instead shows the proper (actual) values.
    Or if its possible to change something in the MC$4 report to show the actual values and not the absolute.
    Thanks in advance!
    George

    HI
    Your input criteria should contain all plant numbers and the period to be analyzed.  Execute the report and then select:  Plant Analysis\Export\Transfer to XXL\Deselect all options and tick Plant, Storage Location and Month.  Follow the options to export to Excel.  Report will be based on Plant, Storage location and Month.
    Regards

  • ME23n , Does not shows the values correctly in print preview

    Hi,
    When viewing a PO using ME23n , it does not shows the values correctly in the print preview.
    For example;
    This is the vendor & its address.  (check attached image img1.jpg)
    ZERANDIB BUSINESS APPLIANCES
    Number-122/A
    PO BOX 41,112,REID AVENUE
    COLOMBO-04
    When displaying the print preview, it shows only some parts of the above address
    Shows only; (check attached image img2.jpg)
    ZERANDIB BUSINESS APPLIANCES
    PO BOX 41,112,REID AVENUE
    These values are getting from a table called LFA1. I have checked that table & in that table all the values exists correctly.
    I have noted issue is with, having only a single word. (If address or name having only a single word, that is without spaces, it will not going to show in the print preview) -
    In the above example, it is not showing Number-122/A and  COLOMBO-04 (Its a single word. No spaces there)
    If its like --> Number - 122/A   &  COLOMBO - 04 ,  then it will display in the print preview correctly (where there are spaces after - mark)
    check img3.jpg
    If its having more than one word, then it will display correctly in the print preview.  As below;
    ZERANDIB BUSINESS APPLIANCES
    Number - 122/A
    PO BOX 41,112,REID AVENUE
    COLOMBO - 04
    If its 2 or more words, it shows correctly.
    If its 1 word, then its not showing!
    Why it is happening like that? Any ideas how to resolve this issue?
    regards.
    zerandib

    It turns out that this problem went away after the program crashed.  Everything seems to be working well now.

  • The report does not accept the value for apps.fnd_profile.value('USER_ID')

    Hi,
    I followed the below note and added a report to my SSHR menu.
    How To Add A Report To A 11i Self Service Menu [ID 334847.1]
    In my report , I have a condition in the query
    and a.created_by =apps.fnd_profile.value('USER_ID')
    When the report is submitted as a request , it works fine., however the same report when called from the self service page does not accept any value for apps.fnd_profile.value('USER_ID') .
    Is there a workaround to handle this problem.
    regards

    hi,
    I had already tried the option apps.fnd_global.USER_ID too.
    However it does not accept the value for apps.fnd_global.USER_ID.
    We want to call the reports in SSHR using oaf and at the same time the records that are pending for approval created by the employee should only be visible.
    regards
    Maya

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Function Previous() does not retrieve good values

    Hello Forum,
    I'm using BO XIR2, Desktop Intelligence.
    I'm displaying some quantities and turnover by month and I try to compute the % of increase/decrease between a month and the previous month. The report looks like that :
    .........................Jan......%.......Feb........%.......March........%.......Apr
    Quantity...............10..................15........50.............16........-6
    Turnover............. 3.5....................4........14............3.9.....-2.5
    I use fonction Previous to compute the % of discrepancy. For example, for quantity : % = (qty-Previous(qty))/Previsous(qty)
    My problem : for some months, the Previous(function) does not retrieve the value of the previous month. It usually adds 1 or 2 to the value of the previous month.
    Does anyone face the same problem ?
    Best Regards

    Hi,
    try sorting your data in the SQL query based using the month number (ascending).
    Regards,
    Stratos

  • Print job does not enter queue

    When attempting to print from a program or a test page nothing happens.  The print queue shows zero documents in the queue.  All indicators say the printer is working and connected etc.  The print job simply does not enter the queue.  There is nothing in the queue.  I have emptied and stopped and started the spooler.  Hot and cold rebooted. Deleted printer and reinstalled. Zilch. **bleep**?
    This question was solved.
    View Solution.

    Hi,
    Please Download and Run the HP Print Scan Doctor from the Below Mentioned Link. That Should fix your Problem.
    Find and Fix Common Printer Problems Using HP Diagnostic Tools for Windows
    Regards,
    Salam_E
    I am a HP Employee
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How come F10 does not put my clip into the timeline ?

    How come F10 does not put my clip into the timeline ?
    When I pressed F10, the sound icon appears instead.
    Am I missing out something ?
    Thanks

    skalicki` wrote:
    Technically, to make the function keys work you don't need to change the second box to dash. I don't know why I gave that advice, but it isn't necessary. I guess I said that simply because that's what I have it set to.
    The reason there are two boxes is so that you can set Exposé to using both the function keys and the mouse. For example, if I have +All Windows+ set to F9 and Secondary Mouse Button, then it will show all open windows if I click F9 or right-click. That is why you actually don't need to have the second boxes for any of these set to dashes. You could set them to your mouse buttons, or if you wanted you could set the first box of any of these to any function key, as long as it isn't set to the same one as the key you want to use for your shortcuts within FCE.
    I hope this made sense, I realize that I might not have explained it very clearly.
    Message was edited by: skalicki`
    Thanks skalicki, I think I got it. You've been of great help !!

  • Constant PCORP for Ledger !* does not contain any value

    Dear SAP Guru's,
    I have a user attempting to process a credit memo via t-code FB75 and is receiving the following error message while attempting to post the transaction.
    Constant PCORP for Ledger !* does not contain any value
    The user was able to post to other customer accounts but this one.  The customer master looks fine. 
    POINTS AWARDED.
    Thanks!

    Hi,
    Pls go to the following path
    GL accounting(new)-business transaction-Doument Spiltting-Activate doument spiltting.
    Praobaly you would have chosen the standary a/c assignment check box and constant.
    That's y this error occured even i have got same error and it resolved now.

Maybe you are looking for

  • [solved] Wrong display of fonts (all square boxes now)

    Hi! I tried Infinality  (https://wiki.archlinux.org/index.php/Fo - Infinality) for font-hinting a few days / weeks ago. Everything worked fine until I recently did - like every day - a pacman -Syu since that update my Fonts are all Squares now. Only

  • HP Pavilion dv2500 no sound card detected after reinstallation

    HP Pavilion entertainment PC (Laptop) dv2500 OS Windows 7 Ultimate AMD system, nvidea  I recently upgraded a friends computer from Windows Vista to, windows 7 Ultimate. The icon for sound in the task bar ( a speaker) has a red x marked on the speaker

  • I am trying SOAP to SOAP scenario an i am getting the following error

    HTTP operation 'POST' could not be performed on URL '/XISOAPAdapter/MessageServlet?channel=:BS:CC'due to an error :The connection with the server was terminated abnormally.   Can some one help me out , really urgent

  • Help required with Gnome 3 Input Sources

    I used CapsLock before gnome 3.6 upgrade all working fine, however new Input Sources broke my system a little bit I fixed my CapsLock by dconf-editor org\gnome\desktop\input-sources\xkb-options ['grp:caps_toggle', 'grp_switch', 'grp_led:caps'], but I

  • Download sap query

    hello everyone i have found a link on the sap ftp website contains some links and i want to know if those links contains the sap ERP or not the link is below ftp://ftp.sap.com/pub/sdn/devkits/netweaver/abap/ thanks in advance