How to determine INT and FLOAT in a DECODE statement

Can anyone help me with the following problem:
I have a column defined as a NUMBER(15,4). I am trying to determine the java type using the getScale() method in ResultSetMetaData. When the scale is greater than 0, then it is an float, else it is an int. In this case, the getScale() method should return 4. However, when querying with a DECODE statement on the NUMBER(15,4) field, the getScale() method always returns 0 and the value is therefore converted to an int. Anyone knows how to solve this problem?
Thanks

Alcides,
Oracle NUMBER data type is mapped to "java.math.BigDecimal" class.
You will find more information in the JDBC Developer's Guide and Reference which is part of the Oracle documentation and available from:
http://www.oracle.com/technology/documentation/index.html
Good Luck,
Avi.

Similar Messages

  • How to separate debit and credit values in gl statement report (daywise)

    hi
    experts,
    i have report.
    selection criteria is
    chars of account.
    gl account
    date .
    how to separate debit and credit values in gl statement?.(i know there is a indicator shkzg).
    but send me code.
    op
    date,   total credit,total debit , balances.
    also calculate opening and closing balance.
    u created such type of report then plz help me.
    thanks&regards.\
    ajay.

    Hi,
    Usually it can be determined using the field shkzg. If it contain 'S' its debit and if it contains 'H' then its credit.
    Before showing the amount you need to do like;
    IF wa_gl-shkzg = 'H'.
    wa_gl-dmbtr = wa_gl-dmbtr * (-1). " dbmtr - amount
    ENDIF.
    This will solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Jun 3, 2009 12:29 PM

  • How to input char and float

    hello,
    I'm working in Linux platform.I'm new to Java programming ,will u help me to input char and float variables?
    and also will u tell me how to clear the screen(just like we do system("clear"))
    thank you
    anchal...

    hello,
    I'm working in Linux platform.I'm new to Java
    Java programming ,will u help me to input char and
    float variables?If u want to input variables from a properties file look at the class java.util.Properties(http://java.sun.com/j2se/1.4/docs/api/java/util/Properties.html)
    If you want to read user input from the keyboard look at System.in (http://java.sun.com/j2se/1.4/docs/api/java/lang/System.html#in)
    and also will u tell me how to clear the screen(just
    like we do system("clear"))
    thank you
    anchal...
    for( int i = 0; i < 25; i++ )
      System.out.println();

  • How to determine Frozen and Running apps?

    For the purpose of saving battery life, how do we determine frozen and running apps? Is there a tool available for this?

    Thanks HangTime! What do I multiply it by?
    Multiply it by the seconds I counted?
    This is going to help TONS going forward.
    Message was edited by: Macthang

  • How to determine Chord and BPM

    Hi everyone,
    I'm a garage band beginner. I've successfully recorded 2 songs with loops, harmonies, and vocal tracks - even the occasional editing of a loop but I have difficulty when I start up a new project trying to determine chord and bpm - well, mostly bpm.
    There is a song I want to cover and customize myself. Is there anything in garage band or anywhere on the web that anyone knows of where I can play a song and it determines the bpms?
    Thanks in advance for your help.

    Thanks HangTime! What do I multiply it by?
    Multiply it by the seconds I counted?
    This is going to help TONS going forward.
    Message was edited by: Macthang

  • How to determine height and width of a JScrollPane client

    Hi,
    I wish to display a webpage in a JScrollPane and wish to determine the height and width of the HTML content so that I can use the information to generate PDF and control the content on each page. Can anybody let me know how I can do this?
    Thanks in advance
    Prashant Baj

    JEditorPane and getSize()?

  • How to determine rows and columns of a two dimensional array at runtime?

    Dear All,
    I am using Java 5.
    I have defined an array as follows:
    int[][] arr= { {1,2,3}, {4,5,6}};
    Using the reference of arr, how can i get the rows (2) and columns (3) of this array at run-time?
    Thanks in advance.
    -Sameer

    rows and columns are simply the way you visualize the array.
    int[][] arr= { {1,2,3}, {4,5,6}};
    in above code
    if you access array element as arr[x][y]
    then x can have 0 or 1 where y can have 0,1 or 2
    */

  • How to determine Tax and Basic amount from BSEG entry

    Hi Guru's,
    How can I determine from the BSEG table the following lines for one BELNR?
    I need to know the TAX amount and the basic amount (without TAX). When I search  the bseg table I see tree lines and the field DMBTR contains all values but I need to determine which line is the line with tax amount and the line with the basic amount.
    Hope someone can help me out.
    Best regards.
    Edited by: Julius Bussche on Jan 9, 2009 1:58 PM
    Please use meaningfull subject titles.

    Hello,
    How can I determine from the BSEG table the following lines for one BELNR?
    I need to know the TAX amount and the basic amount (without TAX). When I search the bseg table I see tree lines and the field DMBTR contains all values but I need to determine which line is the line with tax amount and the line with the basic amount.
    In our system we have BSEG-BUZID: 'T' (for Tax items)
    For the Tax line:
    BSEG-HWBAS: Tax Base Amount in Local Currency
    BSEG-DMBTR: Tax Amount in Local Currency
    Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 9, 2009 1:39 PM

  • How to determine type and access of REF TO DATA

    Hello experts,
    I have a structure with two fields, one string as name/ID and the second one REF TO DATA as placeholder for any value, so DATA can take for example another string or a numeric value or whatever. Ok, now I want to handle this DATA based on it's type, which is unknown at that point. So I first DESCRIBE the field (its type). If for example this type results in a string, I want to move this string data from REF TO DATA into a local string value. Then I want to reformat the string value and save it again to the REF TO DATA field.
    So, in short, I have these tasks:
    1. determine type of REF TO DATA
    2a. if it's a string, then move the val. of the string into a local string variable
    2b. or alternatively do something else, if it's not a string value
    3. do something with the local string, then save it back to the REF TO DATA field
    Any ideas?
    Thank in advance for your help!
    Kind regards, Matthias

    Hi Matthias
    I think you missed a little and very important detail here:
      ASSIGN ls_rec-value TO <fs>.
    That's not what we want, instead you need to use:
      ASSIGN ls_rec-value->* TO <fs>.
    That's why you are obtaining this type 'l' which is refering to a TYPE REF TO DATA itself. Doing it the right way your final type would be 'C' which corresponds with a character data type.
    Best Regards

  • How to determine model and specs using serial number

    I am usually a PC guy, but I recently acquired a damaged MacBook Pro 15 mid 2010 and would like to determine the parts inside ie; processor, motherboard. Is it possible to get these specs by using the serial number? Any guidance would be appreciated .

    This site is thought to be benign:
    http://www.appleserialnumberinfo.com
    as is this one in the netherlands:
    http://www.chipmunk.nl/klantenservice/applemodel.html
    Once you know a little more, detailed specs for every aspect are available on:
    http://everymac.com

  • How to Determine BHCA and ACH in UCCX Environment v8.5.1

    Hi,
    I need to calculate the busy hour call attempts and average call handle time in a UCCX environment.
    I know for a UCCE you can simply run a SQL query, but I am having trouble with the UCCX.
    UCCX version is 8.5.1
    Thank you, 

    "The Traffic Analysis Report shows information related to any call that hits Unified CCX. In that sense, it is an accurate reflection of BHCA (Busy Hour Call Attempts).
    To get the BHCC (Busy Hour Call Completion) from Unified CCX perspective, we need to calculate BHCA - (all aborted calls + all rejected calls). The Aborted and Rejected Call Detail Report can help retrieve that information."
    http://docwiki.cisco.com/wiki/Which_reports_should_be_used_to_determine_BHCA_and_BHCC%3F

  • HOW TO GET TOP AND BOTTOM RECORDS IN SQL STATEMENT, URGENT

    Hi,
    I want to get the TOP 2 and BOTTOM 2 records (TOP 2 SAL , BOTTOM 2 SAL) from the following query result for each department . How do I get it using a SQL statement ? Thanks
    SQL> SELECT A.DNAME, B.ENAME, B.SAL FROM DEPT A, EMP B WHERE A.DEPTNO = B.DEPTNO ORDER BY DNAME, SAL
    DNAME------------ENAME--------SAL
    ACCOUNTING-------KING--------5000
    ----------------CLARK--------2450
    ---------------MILLER--------1300
    RESEARCH--------SCOTT--------3000
    -----------------FORD--------3000
    ----------------JONES--------2975
    ----------------ADAMS--------1100
    ----------------SMITH---------800
    SALES-----------BLAKE--------2850
    ----------------ALLEN--------1600
    ---------------TURNER--------1500
    -----------------WARD--------1250
    ---------------MARTIN--------1250
    ----------------JAMES---------950
    14 rows selected.

    Search for "top-N query" in oracle doucmentation.
    Example :
    for top 2
    SELECT * FROM
    (SELECT empno FROM emp ORDER BY sal)
    WHERE ROWNUM < 3;
    for bottom 2
    SELECT * FROM
    (SELECT empno FROM emp ORDER BY sal desc)
    WHERE ROWNUM < 3;

  • How to determine package size dynamically for select - endselect statement in ABAP

    Hi All,
    I was using select- edselect with package size but i have hard coding the package size. Can any one tell me the the process to determine dynamic package size so that i can use in parallel processing.

    Hi,
    If you are looking to determine or set the value of package size dynamically then use below code for reference.
    DATA: itab TYPE TABLE OF spfli,
           wa like LINE OF itab,
           n    TYPE i.
    n = 10.
    SELECT carrid connid
    FROM   spfli
    INTO   CORRESPONDING FIELDS OF TABLE itab
    PACKAGE SIZE n.
       LOOP AT itab INTO wa.
         WRITE: / wa-carrid, wa-connid.
       ENDLOOP.
    ENDSELECT.
    If you are concerned about the performance then either use SELECT with OPEN CURSOR and CLOSE CURSOR.
    Let me know if it helped?
    Regards,
    Zuber

  • Random int and char

    I am developing a program that generates a SIP message. For the branch tag of Via header field i need to generate random mixture of integers and strings....sth like this (89hg823Hjkg8).
    I know how to generate int and string separately....but ive no idea how to generate the mixture of two. help
    thanx in advance

    You could use java.util.Random to generate random numbers from 48 to 122 inclusive and then cast it as a char. Only problem is that several of the numbers within this range represent other characters such as ? > @ etc.

  • How do you determine StringBuffer and List capacity?

    hi all,
    I'm curious and would like to post this query that how to determine the StringBuffer and List capacity after read some of the Java Platform performance book. Some of this performance books simply tells number of capacity brieftly without telling what and how does the capacity stand for.
    First, the book mentioned StringBuffer(50). Note, my question is that what is this 50 stand for? 50 Characters? or any. Can someone help me to rectify this?
    Second, List. ArrayList(0.75). And what is this 0.75(by default) stand for? A heap space? Then how many of them? How many objects that can be stored for not to "exceed 0.75"?
    Please help. :)
    regards,
    Elvis
    scjp

    I think the capacity is the CURRENT size of a container. But it is not equal to the number of elements that container currently hold. Just like, a house can have 10 people within, but problably only 3 people at some time. Also, the capacity is not equal to the maximum size, because container can grows automatically.
    For example, a container whose capacity is 50, currently has 30 elements in it. If you add 10 elements more. That is only an addition operation. But if you add 30 elements to it. Then the container first enlarge its capacity according to some arithmetic(a enlarging rate), secondly carry out the addition operation.
    Now that the capacity is the size, it should be a number standing for HOW MANY elements.... In the case of StringBuffer, it should be how many chars; in the case of ArrayList, it should be how many Objects. I do not think 0.75 can stand for a capacity. Prabaly, it was used to describe the enlarging rate when containers need to contain more elements than its current capacity. ( From JDK API, you can see the type of capacity is int ).
    For containers and alike, the questions "how many I can hold" and "how many I am holding", "Do I can enlarge"? are helpful for understanding how it works.

Maybe you are looking for

  • How can I delete old web site designs from Muse CC 2014.1. (13 Aug. 2014)?

    Having recently installed the latest update to Muse and been obliged to re-name my web site file I thought it only appropriate to clean up the desktop.  In DW there is a message window where a site can be deleted but I do not see a similiar method in

  • Printing Problem in An Report

    Hi Experts, I am not able to print a report output, the error which it is displaying it is Incomplete list print-out due to a width > 255, Yes the width has crossed 255, but what is the alternative to take the report which has crossed the with of 255

  • Photoshop Elements CD for MAC/PC

    I recently purchased a MacBook Pro and also have a PC desktop with Elements 9.  I want to upgrade to Elements 13 and put the software on both machines.  The problem is the software for Elements 13 Mac/PRO seems to come only in a CD/DVD.  The MAC does

  • The quality of my DVD is garbage! Help?

    Hi everyone, I dont know what the problem is, as I burn DVD's every week. For whatever reason, when I export from my Premiere project to Encore, the quailty looks horrible. The graphics are jagged and the video looks like it was shot on Hi-8. I tried

  • Delegates in Java

    Is there anyway to trigger non-GUI events in Java, by declaring delegates? Ex. If I have a jar class in which pennies are being added, I want to be able to declare a delegate for the jar. I want to be able to create a listener for an event when a pen