SQLT_NUM mapping to int, float, decimal

Hi there,
I use OCI calls to get the data type of my attributes. OCI treats integer, decimal and float as SQLT_NUM type internally. I use OCCIAttrGet() to get the scale and precision of these data types. How do I classify them as int, float and decimal based on scale and precision??
Thanks,
Sashi

If scale = 0 then use int (watch out for ranges though - Oracle can hold integers far greater than the int datatype can hold).
If scale > 0 then you use either float or decimal (I assume you mean double). I suppose which one you use depends on the range of values / precision required.
Adrian

Similar Messages

  • How to Map Fomulas for Float Glass Process

    Hi All,
    Can anybody suggest how to map formulas for float glass process.
    As in float Glass process continuous production is going on single line, within that continuous ingredients are added in furnace and molten glass mass is coming out. this molten glass is now adjusted to particular thickness and then finally cut into specific sizes as per cusotmer requirment.
    Final product is in various thickness, width and length.
    Entire process is automated.
    If anybody already implemented same scenario, please share knowledge.

    Hi
    The following is the mapping process and it is tricky process need to map carefully.
    You can define this as a single formula.
    Output: Packed - cut to size - Finished Good Item.
    Input: All the Raw materials (Sand, Dolamite, Limestone, Soda Ash, Sodium Sulphate, Carbon, Iron Oxide)
    Packaging materials + Labels + Boxes etc.
    Define Routing:
    Resource: Furnace, Any other importance resource like Equipment that controls thickness, cutter etc, Labor, Associated Overhead
    Create recipe using the formula and routing.
    Various factors that can affect the mapping:
    1) Formula maintenance: You have to define formula for each output item.
    2) Possibility of dynamic determination of output item: If it is possible to produce different combination of thickness/width (and hence different FG item) in the same batch, then this won't be the right mapping.
    3) Process variations: Also formula mapping depends on how accurate is production process. If user wants to produce item X (say thickness 10mm) but due to quality issue produced item Y (say thickness 9mm) and such cases happens very often, this won't be right solution.
    4) Inventory measurement: This will determine the break-points. If you cannot measure the quantity (or even estimate) then you cannot define it as an intermediate item.
    I will explain how point 4 can lead to different way of formula mapping.
    Say you have a furnace that needs to run continuously for better quality or throughput. Hence you will be continuously adding raw materials to furnace and produce different outputs. You can break the single formula into multiple formulas as -
    Formula 1) Output: Molten mass of glass
    Input: All the Raw materials (Sand, Dolamite, Limestone, Soda Ash, Sodium Sulphate, Carbon, Iron Oxide)
    Formula 2) Output: Packed - cut to size - Finished Good Item.
    Input: Molten mass of glass
    To have formula in such fashion you should have a way to measure or estimate the weight of Molten mass of glass.
    If you are estimating the weight, there should be historical data available to determine what should be realistic output quantity for given input quantity. How much will be process loss and loss due to unwanted by product such as slag etc.
    Further you can break formula 2 as
    Output: One large sheet of give thickness
    Input: Molten mass of glass
    Output: Packed - cut to size - Finished Good Item.
    Input: The large sheet of give thickness.
    This kind of different mapping is possible which normally depends on:
    1) Complexity of process
    2) How complex BOM structure user wants to have
    3) Are there any benefits of maintaining such complex system - like accurate costing or accurate production monitoring or facilitating planning process.
    4) Can user maintain the complex system? Are they ready to capture data at finer level. Is it possible to capture the data.
    5) And most important thing is how to handle exceptions. If every thing goes smoothly as planned (less exceptions) then user can have and afford any level of complexity. But if there are many exceptions to the normal process you have to concentrate more on how to handle the exceptions.
    6) Satisfy all users: Accounting, Planning, Production, Quality, Inventory handling. Formula/Recipe touches all these modules.
    Regards
    Raj
    Sierra

  • Separate the int and decimal parts of a double var

    Hi,
    I would like to know how can I obtain the int part and decimal of a double var.
    Example:
    2.3455
    int -->2
    decimal--->3455
    Also I would like to know how I can specify the precision of the decimal part. For example: 3455 if want a 2 decimal precision--> 34
    Regards and thanks with anticipation.

    Hi all,
    I too have a way to this solve this.
    1. Convert the double into a string.
    2. Split it by . symbol, which will produce an array of two elements.( First one is integer part, another one is decimal part)
    3. Now we can easily do type casting and get two variables.
    Example:
    double base = 2.5689;
    String str = Double.toString(base);
    String[] out = null;
    out = str.split(".");
    int a = Integer.parseInt(out[0]);
    double b = Double.parseDouble(out[1]);Thanks
    Ram

  • Handling int/float inputs in a form.

    I am working with JFC and creating an Item Master form which display several user inputs. I am using JTextfield for getting user inputs.
    My problem is in the cases of inputs like item serial no an integer type of data or item price/item quantity float type of data. I am looking for something which help me provide the number format and min/max value and also it will let me allow to store the respective integer/float value in integer float variable for numeric calculation.
    Is there any way out?? Because JTextField does not allow me to do so.

    You will need to add a key listener to the fields so you can restrict the type of input. You also need to use Character.isDigit and other methods. I wrote the following class myself
    *   @Description  : One of the handy classes to test different    *
    *                         types of text fields: integer, decimal,        *
    *                         alphabetical and alphabetical with a space.   *
    *   @author  : Software Engineering- Hanan Moh'd                  *
    *   @Company : Dubai Women's College                              *
    *   @version : 1.1, 4 - 5 - 2002.                                    *
    import java.awt.event.*;
    import java.awt.Toolkit;
    public class FieldListener implements KeyListener
         static final int INTEGER_FIELD = 1,
                             DECIMAL_FIELD = 2,
                             ALPHA_FIELD      = 3,
                             STRING_FIELD = 4;
         private int type = 0;
    //******************************* constructor  ***************************************
         FieldListener(int fieldType)
              type = fieldType;
         FieldListener()     {     }
    //******************************* key listener methods *******************************
         public void keyPressed(KeyEvent ke)          {     }     
         public void keyReleased(KeyEvent ke)     {     }
         public void keyTyped(KeyEvent ke)
              char c = ke.getKeyChar();
              switch (type )
                   case INTEGER_FIELD:
                        if (!(Character.isDigit(c) || c == KeyEvent.VK_BACK_SPACE ) )
                             consume( ke);                    
                        }     //end of if
                        break;
                   case DECIMAL_FIELD:               
                        if (!(Character.isDigit(c) || c == '.' || c ==KeyEvent.VK_BACK_SPACE) )
                             consume( ke);                          
                        }     //end of if
                        break;
                   //alpha with spaces          
                   case ALPHA_FIELD:
                        if (!(Character.isLetter(c) || c == ' ' || c == KeyEvent.VK_BACK_SPACE))
                             consume( ke);                         
                        break;
                   //alpha no spaces
                   default :
                        if (!(Character.isLetter(c) || c == KeyEvent.VK_BACK_SPACE))
                             consume( ke);                          
                        break;
              }     //end of switch
    //******************************* other methods **************************************
         /** disallow the typed key & generates sound */
         private void consume(KeyEvent ke)
              ke.consume();
              Toolkit toolkit = Toolkit.getDefaultToolkit();     
               toolkit.beep();          //make a sound

  • Programming problems with INT / FLOAT

    I got a problem with datatypes float and int.
    I'm just developing a c-program on HP-UX with the gcc-compiler. 'cause i have not ever been done an ORACLE-access before, i has started with the "cdemo2.c" - example from the oracle-demo-dircetory in version 8.0.4.
    in the DB there's a column with NUMBER-TYPE, but when i call the oci-function (or what ever it is) "odescr()", the variable "scale" (which is supposed to differentiate between FLOAT_TYPE and INT_TYPE) always is set to "0". this variable should be set to anything else but "0" if a FLOAT_TYPE is detected, but it isn't.
    what I do wrong ???
    How can I know the exact datatype, when a NUMBER_TYPE in the DB appears ???
    if there is a better way to realize an oracle-access in C, please don't wait to tell it to me
    many thanks
    null

    You basically got it. Another approach is to always work on the rightmost digit; that way you'll always be dividing, mod'ing, or multiplying by 10.
    You don't need to know the length of anything to use a for loop. Remember that a for loop has 4 parts: the initialization, the conditional, the "update", and the body. (There are probably more correct names for these that I can't recall right now.) The conditional and the update tend to be length checks and increments only because for loops are commonly used over arrays or strings, but they don't have to be.
    Another hint: how do you know when you're done pulling the digits out of the source number? What is the value of the source number when you're done?

  • XMLBeans: Mapping xsd:int to Java int

    hello,
    I have the following problem with the XMLBean xsd:int to Java Mapping:
    An xsd:int element maps to the Java type int, in the normal case this mapping is ok. But when the xsd:int element is defined as nilable="true" or minoccurs="0" shouldn't it be mapped to the Java Class Integer (because there is no null value for Java int)?
    Is there a way to change the XMLBean mapping to the Integer Class in that case?
    thanks for your help!
    Edited by: mriedo on Jun 10, 2008 2:37 AM
    Edited by: mriedo on Jun 10, 2008 3:22 AM

    Hi danielamadei,
    I'm assuming you are using a project with the schema builder facet enabled. If so, this can be done by using adding an xsdconfig file to your schemas folder with contents like the following:
    ==someFile.xsdconfig==
    <?xml version="1.0" encoding="UTF-8"?>
    <xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
    < ! - - (comments get hidden)  this will change the package from noNamespace to foo.bar.baz when no namespace exists -->
    <xb:namespace uri="##any">
      <xb:package>org.openuri.easypo.xsdconfig</xb:package>
    </xb:namespace>
    < ! - - (comments get hidden) this is an alternate way to do this -->
    <xb:namespace>
        <xb:package>foo.bar.baz</xb:package>
    </xb:namespace>
    < ! - - (comments get hidden)  this will change the package name for all elements and types in the namespace http://some.namespace -->
    <xb:namespace uri="http://some.namespace">
        <xb:package>bam.bazzle</xb:package>
    </xb:namespace>
    </xb:config>==
    Here is a link to the xmlbeans FAQ on the subject
    http://wiki.apache.org/xmlbeans/XmlBeansFaq#configPackageName
    Hope this helps,
    -jacobd
    Edited by jacobd at 09/06/2007 4:06 PM

  • Showing a floating decimal in a adf table

    hi there,
    i hava created a adf table out of a data control, the problem in the bean i have strings and a double value.
    The strings a shown, but the double value (very tiny values like 1.36E-6) are rounded to 0, but thats isnt well in my case....
    so how can i show the floating point notation???
    thx
    grettings
    hannes

    Where do you get the floating point numbers from? From the db via an entity object (EO) or a view Object (VO) or from an EJB?
    You only mentioned that you used a data control.
    If the values are read from the DB and your business layer uses EOs and/or VOs, you go to the model project, search the EO in question in the application navigator and double click it. Then select the 'Attributes' section of the wizzard and follow the instructions from the previous posting.
    Timo

  • Floating Decimal problem!!

    Dear all,
    Dear all,
    I wrote a java application to manipulate some data format transferring. I can run it on Windows with jdk 1.3. But when I ran it on Red Hat, I got such problem:
    Exception in thread "main" java.lang.NumberFormatException: -0.715
    at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1213)
    at java.lang.Double.valueOf(Double.java:183)
    at java.lang.Double.<init>(Double.java:258)
    at MethodEvaluation.ReadDataIn(MethodEvaluation.java:259)
    at MethodEvaluation.RunLCV(MethodEvaluation.java:67)
    at MethodEvaluation.main(MethodEvaluation.java:29)
    I'm very confused! Why the same program and the same data set got different results !?
    Please help me to resolve this problem! Thank you!

    It might have to do with locale settings and the decimal delimiter's being . or ,

  • Float to int

    Hi guys,
    I have the following float variable:
    public float cameraX;after performing the following assignment :
    cameraX=cameraPosition.x;I have to convert cameraX into an integer, or trunk the decimal part of this float number; which methods in which classes can I use?
    Bye and thanks

    No need to use classes here, simlply cast your floating point value to an int -- float myFloat= 123.456;
    int myInt= (int)myFloat; // myInt contains 123 now kind regards,
    Jos

  • Zeroes after decimal getting trimmed after 1:1 mapping of EDIFACT

    hi all
    i have created 1:1 mapping for XML->EDI.
    i took the output from XI and gave it as input.However, in the output of the mapping, the zeroes after decimal are getting deleted.
    for example if the input contain 2500.000, the output of the mapping contains 2500.
    I want 2500.000 in the output.
    Any suggestions as how to overcome the problem?

    hi Kai
    sorry ..i think i didnt convey properly my prob.
    This is what i want.
    My scenario is IDOC->EDIFACT using XI.
    i did a XI graphical mapping from IDOC ->to->EDIFACT_XML.Here for a particular field i got the output as 2500.000.
    Now this EDIFACT_XML is converted into EDIFACt using 1:1 mapping of BIC MD.
    When i give 2500.00 as an input to this 1:1 Mapping of BIC MD, the output contains only 2500.
    I'm not having problem in XI but in BIC MD.
    kindly suggest how i can get decimal output from BIC MD.

  • OSb-XQuery-TypeConversion(decimal to int)

    Hi all,
    I need some help in Xquery Transformation
    Source element type is decimal
    target element type is int
    I need to convert to decimal to int in Xquery.
    Actually I tried like this way
    <targetElement>{xs:int($sourceElement)}</targetElement>
    <error>Error occurred while executing XQuery: {err}XP0021: "100.00": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: integer: Invalid integer value: 100.00. Either the XQuery is invalid or it contains custom XQuery functions. Try using the web test console to test this XQuery (Right click on the XQuery file and select Run As ->Run On Server) </error>
    Can u help on this ,Which function do I need to use for type casting in Xquery.
    Regards
    Krishna.

    It's tricky because when you convert from xs:string to xs:integer decimal point is not allowed... So you have to go around and convert to xs:decimal first...
    <targetElement>{xs:int(xs:decimal($sourceElement))}</targetElement>
    Hope this answers your question...
    Cheers,
    Vlad

  • Floating point decimal

    Hi,
    How to get standard floating decimal number out of:
    double a = 0.0;
    double ans = (double)a+1.0/(397+658);
    the answer woulld be 9.478672985781991E-4. how to get say, 0.00094787 as double?
    please help.
    many thanks

    Or use Java 5's Formatter class (or one of its related methods), or BigDecimal class (Or some combination of any of the above.)

  • Decimal Format and Scientific Notation

    I am trying to print numbers in scientific notation using the Decimal Format class. What follows is a simple test program I wrote to find the bug. So far, I have not found a solution.
    import java.text.*;
    public class formatted {
    public static void main (String Arguments[]) {
    DecimalFormat form = new DecimalFormat("0.###E0");
         double numb = 123456.789;
         System.out.println("Nuber is: " +
    form.format(numb));
    The output of this program is... Nuber is: 123456E
    The output is the same if numb is an int, float, or double. If I format the number as "#####.0" or "#####.00" the output is correct. I think that I am following the rules for formatting a number in scientific notation as the process is outlined in the documentation (provided below).
    ***** From Decimal Format under Scientific Notation ***
    Numbers in scientific notation are expressed as the product of a mantissa and a power of ten, for
    example, 1234 can be expressed as 1.234 x 10^3. The mantissa is often in the range 1.0 <= x < 10.0,
    but it need not be. DecimalFormat can be instructed to format and parse scientific notation only via a
    pattern; there is currently no factory method that creates a scientific notation format. In a pattern,
    the exponent character immediately followed by one or more digit characters indicates scientific
    notation. Example: "0.###E0" formats the number 1234 as "1.234E3".
    Anyone understand how the short program is incorrectly written?
    Marc

    The problem is
    format = "0.###E0"
    input number = 123456.789
    output = 123456E (not scientific notation!)
    This is not scientific notation at all. There is no decimal point given and no value in the exponent.
    I understand entirely that by adding more #'es will provide more precision. The bug I have is the output is not printed in the scientific format; other formats work.
    MArc

  • Displaying decimal value in the table!

    Hi All,
    Please help me for this.
    I am calling a BAPI function into webdynpro But In R/3 side one "totalvalue"  column value displayed as Decimal like 3.45 But the same BAPI I am using in webdynpro.It displays Only 3 only How can i display "3.45"
    Please help me.
    Here Iam calling BAPI function directly .
    Thanks In advance
    BHI.

    Thanks for your immediate response.
    Here I maapped the BAPI Funtion Directly .
    There is no chance to see the this is Int or Decimal.
    It is mapping to Directly BAPI function path.
    In Structures showing Element name "total" and builtintype is "Decimal" and length=15 and decimals 2 .
    Could you pls guide me how to display this Decimla structure values into webdynpro.
    Pls help me.
    Thnks
    BHI

  • Map insert bug

    According the C++ standard this piece of code should compile correctly, hoever it does not in Workshop 6 update 2.
    #include <map>
    #include <string>
    int
    main()
    std::map<std::string,float> coll;
    coll.insert(std::make_pair("otto",22.3));
    return 0;
    See also book "The C++ standard library" of Nicolai M. Josuttis
    Note: I use different C++ compilers on several platforms, and only this (SUN Workshop 6 update 2) compiler seems to have a problem with this code.

    I don't remember but I don't think STLport is provided with Forte Developer 6 update 2.
    But anyway I tested the examples on Studio 11 and they do not compile there either.
    CC: Sun C++ 5.8 Patch 121017-08 2006/12/06
    CC test.cpp gives
    Error: Could not find a match for std::map<std::string,float>::insert(std::pair<char[5], double>) needed in main()
    or for the second example taken from above
    Error: Could not find a match for std::multimap<std::string, std::string, std::less<std::string>, std::allocator<std::pair<const std::string, std::string>>>::insert(std::pair<std::string, std::string>) needed in main()
    They do compile with -library=stlport4 though, not much help if you are using thirdparty libraries like Oracle occi. ( Oracle's stance seems to be that libCstd is conforment enough for everybody )
    /Lars

Maybe you are looking for

  • Vendor not assigned to PR when doing a MRP run

    I am doing an MRP run for creating purchase requistions However the vendor is not getting assigned to the PR. I have the vendor defined in the source list (made it fixed) and also created info record. However when i run the MRP the PR is created but

  • Mac os 10.5.7 update messed up my mail. cant see message viewer!!!

    after updating Mac os 10.5.7, I cannot see the message viewer. When i checked the connection doctor it shows that my email ids are online. I tried moving messagerules.plist and messagerules.plist.backup to desktop. Still no joy. Please help

  • Question about Parallels and ATI Radeon 5770

    Ok, so I have a Mac Pro 3,1 here. I'm upgrading it to 16GB and two 7200 RPM 3TB drives which I'll run in Raid 0. It has an ATI 2600HD with 256MB VRAM.  This card has two DVI ports. I just purchased an ATI Radeon 5770.  I will use it with two Cinema D

  • Cache update issue??

    Hi Everyone, I am implementing simple File to JDBC scenario. The sender file adpater is working fine, but the receiver JDBC adapter seems to be causing a bit of problems. I am using MS Access as the data base. Database XI.mdb is in D:/JDBC/XI.mdb The

  • BPS  initial value  at Planning Level

    Hello All I am getting error while using BW Hierarchy at planning level. i find the solution at  Including # initial value using hierachy but its not working i am getting this error "Characteristic Funds Center does not contain the initial value in t