PL/SQL to emulate java.math.BigDecimal.toEngineeringString)

As part of an implementation of the APEX, I want to present the results of a SQL query in the same form as the. java toEngineeringString()

For instructions using the sequence. BigDecimal.toEngineeringString (), the result is:

10 ^ 1.0E - 9-9

10 ^-8 10TH-9

10 ^-7 100F-9

10 ^-6 0.0000010

10 ^-5 0.000010

10 ^-4 0.00010

10 ^-3 0.001

10 ^-2 0.01

10 ^-1 0.1

10 ^ 0 1.0

10 ^ 1 10.0

10 ^ 2 100.0

10 ^ 3 1000.0

10 ^ 4 10000.0

10 ^ 5 100000.0

10 ^ 6 1000000.0

10 ^ 7 10TH + 6

10 ^ 8 100TH + 6

10 ^ 9 1.0E + 9

10 ^ 10 10 + 9

I would like to emulate the same output using SQL or PL/SQL. PL/SQL is preferred, the Summit resulting exit a 100 columns with values of 1E-6 to 1000.00


Any help will be appreciated.

Using excellentEtbin "somehow neater version" as a base, "" we get the exact result you posted:

WITH data (num) AS
(SELECT POWER(10, -10 + level)
 FROM   dual
 CONNECT BY level <= 20
)
SELECT RPAD('10^'||ex, 5) "10^n",
       CASE WHEN ex NOT BETWEEN -6 AND 6 THEN
               TO_CHAR(nu * POWER(10, ex - 3 * FLOOR(ex / 3)))||'E'||TO_CHAR(3 * FLOOR(ex / 3),'FMS9')
            ELSE CASE WHEN ex BETWEEN -6 AND -1 THEN
                    '0'
                 END||TO_CHAR(num)||
                 CASE WHEN ex NOT BETWEEN -3 AND -1 THEN
                    DECODE(SIGN(ex),  0, '.0', 1, '.0', '0') -- TO_CHAR(num)
                 END
       END engineering_string
FROM  (SELECT num,
              TO_NUMBER(SUBSTR(n, INSTR(n, 'E') + 1)) ex,
              TO_NUMBER(SUBSTR(n, 1, INSTR(n, 'E') - 1)) nu
       FROM  (SELECT num,
                     TO_CHAR(num,'9.9999999999999999999999999999999999999EEEE') n
              FROM   data
              )
       );

10^n  ENGINEERING_STRING
----- ------------------
10^-9 1E-9
10^-8 10E-9
10^-7 100E-9
10^-6 0.0000010
10^-5 0.000010
10^-4 0.00010
10^-3 0.001
10^-2 0.01
10^-1 0.1
10^0  1.0
10^1  10.0
10^2  100.0
10^3  1000.0
10^4  10000.0
10^5  100000.0
10^6  1000000.0
10^7  10E+6
10^8  100E+6
10^9  1E+9
10^10 10E+9

20 rows selected.

You can wrap this example in a PL/SQL function, if you are wanting to "convert" the digital data, by exemple.001, 1000,-987654321.1234, etc., or a string "10 ^-10", 10, 24, etc., by overloading the conversion function. ""

You can also write a java class exposing... BigDecimal.toEngineeringstring () method, and using the "loadjava" for Oracle command line utility to load the class in the db and then create a PL/SQL wrapper in the sense of (http://docs.oracle.com/cd/B28359_01/java.111/b31225/chthree.htm):

CREATE OR REPLACE FUNCTION bd2es AS             /* NOTE: psudo code */
LANGUAGE JAVA NAME 'bd2es () return java.lang.String';

See you soon,.

The Canada Gazette

Tags: Database

Similar Questions

  • ADF Mobile: Could not find property inputvalue in class Java.Math.BigDecimal

    I tried to add an element of input text to display in the list like below and received an error message when you navigate away from the text entry field.

    "Can't find property inputvalue in class Java.Math.BigDecimal.

    Can someone show me some pointers on what's wrong with the code below.

    JDEV Version: 11.1.2.4

     <amx:listView var="row" value="#{bindings.Empdtls.collectionModel}"
                            fetchSize="#{bindings.Empdtls.rangeSize}" styleClass="adfmf-listView-insetList"
                            id="lv1" editMode="true">
                <amx:listItem id="li1">
                  <amx:tableLayout width="100%" id="tl1">
                    <amx:rowLayout id="rl1">
                      <amx:cellFormat width="10px" id="cf3"/>
                      <amx:cellFormat width="60%" height="43px" id="cf2">
                        <amx:outputText value="#{row.ClassCode}" id="ot3"/>
                      </amx:cellFormat>
                      <amx:cellFormat width="10px" id="cf4"/>
                      <amx:cellFormat width="40%" halign="end" id="cf1">
                        <amx:inputText value="#{row.bindings.Salary.inputValue}" simple="true" id="it41"/>
                      </amx:cellFormat>
                    </amx:rowLayout>
                  </amx:tableLayout>
                </amx:listItem>
              </amx:listView>
    

    Hello

    #{row.bindings.Salary.inputValue) is not an affair in ADF Mobile Access.} Use #{rank. Salary} instead.

    Frank

  • "" Type = "java.math.BigDecimal type =" Oracle.jbo.domain.Number "VS".

    Hi all! I need some explanation about types: Type = "oracle.jbo.domain.Number"VS Type = "java.math.BigDecimal"

    I have variable enableEditing:
     this.enableEditing = this.getSelectedTaks().getAttribute("TaksacijasPk").equals(taksId); 
    If attribute EO TaksacijasPk is with the type "oracle.jbo.domain.Number" then all work with above the line, but if this attribute is of type "Java.Math.BigDecimal" then code above line do not work. To fix it, I need to add toString() operation in the line of code:
     this.enableEditing = this.getSelectedTaks().getAttribute("TaksacijasPk").toString().equals(taksId); 
    Maybe the question is, why in one case, I have to add toString() operation and in others not?

    Best regards, Debuger!

    Javadoc for the BigDecimal said

    Unlike compareTo, this method takes two objects BigDecimal equal only if they are equal in value and scale (so 2.0 is not equal to 2.00 compared to this method).

    You try to compare a BigDecimal/number for a taskId (which we don't have no idea what class it is).

    Suppose that taskId is a string.

    . Equals() on a number will simply convert the string to a number and check if the values are equal.

    . Equals() on a BigDecimal allows you to convert the string to a BigDecimal by applying the rules described in the BigDecimal (String) constructor, to-wit:

    The scale of the BigDecimal returned will be the number of digits in the fraction, or zero if the string contains no comma, subject to adjustment for any Exhibitor; If the string contains an exponent, the exponent is subtracted from the scale. The value of the scale that results must be between Integer.MIN_VALUE and Integer.MAX_VALUE, inclusively.

    My conjecture only (since you don't seem to be ready to use the debugger and check), is that you have a scale on your BigDecimal which does not match the scale on the BigDecimal which is built from the identifier.

    If I had to try to understand the difference between the two, I'd read the docs. Maybe even create a few test cases. Maybe to run my code in the debugger to see what that my BigDecimals and numbers looked like

  • connection between sql server and java

    someone please tell me how to connect to sql server with java

    Welcome to the forums.

    The forums are a research tool very useful - by using the search box you will see near the top right.  You will find that most of the questions that ask you, which, have already been asked on the forum, so it pays to research frist - that way you get a faster response and you can find other interesting things.

    In this case, I did a quick search using SQL Server and found these threads that will probably help:

    http://supportforums.BlackBerry.com/T5/Java-development/database-connectivity-SQL-Server-2008/m-p/60...

    http://supportforums.BlackBerry.com/T5/Java-development/SQL-Server-connection-in-BB/m-p/416391#M8239...

  • Houston-25009: failed to create an object of type: java.sql.Timestamp type: java.lang.String

    System.out.println ("New Record");

    BindingContext exDup13 = BindingContext.getCurrent ();

    System.out.println ("kjjk45345323245");

    DCBindingContainer dbDup13 = (DCBindingContainer) exDup13.getCurrentBindingsEntry ();

    System.out.println ("kjjk45345345");

    DCIteratorBinding iterDup13 = dbDup13.findIteratorBinding("XYZIterator");

    System.out.println ("kjjk45345345");

    ViewObject voDup13 = iterDup13.getViewObject ();

    System.out.println("bipin:"+voDup13);

    voDup13.setWhereClause ("ID_NO ='" + idNoBnd.getValue () m:System.NET.SocketAddress.ToString () + "'");

    System.out.println("bipin1:");

    voDup13.executeQuery ();

    System.out.println ("bipin2:");

    voDup13.next ();

    System.out.println("kjjre:"+voDup13.GetRowCount());)

    When I am trying to run this code, I get error at last line.

    Error is:

    Houston-25009: failed to create an object of type: java.sql.Timestamp type: java.lang.String with value: 890089

    You can try using getEstimatedRowCount() instead of getRowCount() as:

    System.out.println ("16:"+voDup13.getEstimatedRowCount());

    If you still get error try to getEstimatedRowCount() before defining where clause and see if the error will come up again or not

  • In general, is it better to use java.sql.Date and java.sql.Timestamp instead of oracle.jbo.domain.Date?

    Hello world

    During playback of Oracle ADF Real World Developer's Guide, I noticed the dates match occurring in JDeveloper is different from what is the list in the book. JDeveloper is failing to oracle.jbo.domain.Date, but according to the book:

    DATEjava.sql.DateDATE type is mapped to java.sql.Date if the column in the table is a no time didn't need information zone.
    DATEjava.sql.TimestampDATE type is mapped to java.sql.Timestamp if the column in the table has a component "time" and that the client needs to zone information.
    TIMESTAMPjava.sql.TimestampThe TIMESTAMP type is mapped to java.sql.Timestamp if nanosecond precision is used in the database.

    In general, is it better to use java.sql.Date and java.sql.Timestamp instead of oracle.jbo.domain.Date? Using java.sql.Date and java.sql.Timestamp could save me some headaches conversion date. And, is there a place in JDeveloper to display these maps? I looked around and didn't see anything.

    Thank you.

    James

    User, what version of jdev we are talking about?

    In GR 11, 1 material versions db types date and timestamp are mapped to types of domain data that represents a wrapper for the native data types. The reason was that the framework can work with the domain types regardless of the underlying data type.

    Since Oracle 11 GR 2 maps the types DB to java types (default selection, you can change it when you create a model project, you can set the Data Type Mapping). Once the pilot has business components define you cannot change this setting it would break existing components such as eo or vo.

    So if you are working wit 11 GR 1 subject, you must use the domain types, if you work with GR 11, 2 or 12 c, you can use the domain types, but it is recommended to use the java type mapping.

    Timo

  • Installation of Oracle SQL Developer and Java

    I finished installing the Oracle Client without problems. SQL Developer opened for the first time and he asks me the full path Java.exe.

    That's fine, but when I entered the java.exe I just don't ask again, no errors. Repeat to infinity.

    I have the most recent Java SDK installed and tried the 32-bit and 64-bit versions (jdk 7u4). I even tried to install Oracle Client version 11.1.0 AND 11.2.0 to see if that makes a difference, but it is all the same.

    I uploaded a screenshot if that helps: http://i50.tinypic.com/mjtqte.jpg

    Any ideas?

    Kind regards
    Gunnar Oskarsson

    Hi Gunnar.

    Documentation:
    http://docs.Oracle.com/CD/E25259_01/doc.31/e26419/install.htm#sthref8

    Ideas:

    -Do not use java7
    -Use JDK JRE not
    -On widows, there is a version of SQLDeveloper, including jdk 6 java
    -Instant client is not necessary - but if you want to use use at least 11.2.0.2
    -SetJavaHome updated to sqldeveloper\sqldeveloper\bin\sqldeveloper.conf to point to the JDK
    -There is some confusion about 32-bit and 64-bit operating systems, java and SQLDeveloper, you can search the forum for more details, for example: put on the title: "Unable to start Oracle SQL Developer.

    -Turloch
    SQLDeveloper Forum

  • Using java user-defined aggregate function

    Hello

    I'm trying to implement a with Java user-defined aggregate function.

    Here's the Code Javaclass:

    Import Java.util;
    Oracle.sql import. *;
    import java.sql. *;
    import Java.Math.BigDecimal;
    Oracle import. CartridgeServices.*;

    stored the context type

    public class StoredCtx_SecMax
    {
    private BigDecimal b_max;
    private BigDecimal b_secmax;

    public StoredCtx_SecMax()
    {
    b_max = new BigDecimal (0);
    b_secmax = new BigDecimal (0);
    }

    public void SchreibeMax (entry BigDecimal)
    {
    b_max = entry;
    }

    public void SchreibeSecMax (entry BigDecimal)
    {
    b_secmax = entry;
    }

    public BigDecimal LeseMax()
    {
    Return b_max;
    }

    public BigDecimal LeseSecMax()
    {
    Return b_secmax;
    }
    }

    implementation type

    / public class SecondMax_j implements SQLData
    {
    BigDecimal private key;

    Ultimate SUCCESS of static BigDecimal = new BigDecimal (0);
    Final static BigDecimal ERROR = new BigDecimal (1);


    Implement the SQLData interface.

    String sql_type;
    public String getSQLTypeName() throws SQLException
    {
    Return sql_type;
    }

    ' Public Sub readSQL (SQLInput stream, string typeName) throws SQLException
    {
    sql_type = typeName;
    key = stream.readBigDecimal ();
    }

    Public Sub writeSQL (SQLOutput stream) throws SQLException
    {
    stream.writeBigDecimal (key);
    }


    methods of the type that implements ODCITable interface

    public static BigDecimal ODCIAggregateInitialize (oracle.sql.STRUCT [] sctx)
    throws SQLException
    {
    Connection Conn = DriverManager.getConnection("jdbc:default:connection:");

    create a stored environment and store the result set in it
    StoredCtx_SecMax ctx = new StoredCtx_SecMax();

    context of registry stored with cartridge services
    Touch int;
    try {}
    key = ContextManager.setContext (ctx);
    } catch {} (EC CountException)
    error return;
    }

    Create an instance of StockPivotImpl and store the key of
    Object [] impAttr = new Object [1];
    impAttr [0] = new BigDecimal (key);
    StructDescriptor sd = new StructDescriptor ("SECONDMAX_J", conn);
    SCTX [0] = new STRUCT(sd,conn,impAttr);

    return a SUCCESS;
    }

    public BigDecimal ODCIAggregateIterate (BigDecimal input)
    throws SQLException
    {
    retrieve the context stored with the key
    CTX StoredCtx_SecMax;
    try {}
    CTX = (StoredCtx_SecMax) ContextManager.GetContext (Key.intValue ());
    } catch (InvalidKeyException ik) {}
    error return;
    }

    BigDecimal b_max;
    BigDecimal b_secmax;

    b_max = ctx. LeseMax();
    b_secmax = ctx. LeseSecMax();

    If (eingabe.compareTo (b_max) == 1)
    {
    CTX. SchreibeSecMax (b_max);
    CTX. SchreibeMax (input);
    }
    on the other
    {
    If (eingabe.compareTo (b_secmax) == 1)
    {
    CTX. SchreibeSecMax (input);
    }
    }

    return a SUCCESS;
    }

    public BigDecimal ODCIAggregateTerminate (double [] returnValue, int flags) throws SQLException {}

    retrieve the context stored with the key
    CTX StoredCtx_SecMax;
    try {}
    CTX = (StoredCtx_SecMax) ContextManager.clearContext (Key.intValue ());
    } catch (InvalidKeyException ik) {}
    error return;
    }

    returnValue [0] = ctx. LeseSecMax () .doubleValue ();

    CTX = null;

    return a SUCCESS;
    }


    public BigDecimal ODCIAggregateMerge (oracle.sql.STRUCT ctx2) throws SQLException {}


    return a SUCCESS;
    }
    }


    To implement this in the database, I use the following script:

    CREATE OR REPLACE TYPE IMPROG. SECONDMAX_J as object

    (
    INTEGER key,

    public static function ODCIAggregateInitialize (sctx IN OUT SECONDMAX_J)

    Return number
    IN THE JAVA LANGUAGE
    NAME "Java.Math.BigDecimal return from SecondMax_j.ODCIAggregateInitialize (oracle.sql.STRUCT []).
    ,



    Member ODCIAggregateIterate (self IN OUT SECONDMAX_J function,

    Number return value)
    IN THE JAVA LANGUAGE
    NAME "Java.Math.BigDecimal SecondMax_j.ODCIAggregateIterate return (Java.Math.BigDecimal).
    ,



    Member ODCIAggregateTerminate (self IN SECONDMAX_J function,

    Return returnValue NUMBER, flags in number number)
    IN THE JAVA LANGUAGE
    NAME "Java.Math.BigDecimal return of SecondMax_j.ODCIAggregateTerminate (double [], int).
    ,



    Member ODCIAggregateMerge (self IN OUT SECONDMAX_J function,

    CTX2 IN SECONDMAX_J) return number
    IN THE JAVA LANGUAGE
    NAME "Java.Math.BigDecimal SecondMax_j.ODCIAggregateMerge return (oracle.sql.STRUCT)".
    );
    /

    CREATE OR REPLACE FUNCTION F_SECONDMAX_J (NUMBER value) RETURN NUMBER

    PARALLEL_ENABLE

    AGGREGATION to the HELP of SecondMax_j;
    /



    When I now use the F_SECONDMAX_J function.

    "(Columnname) select F_SECONDMAX_J from Tablename t;

    It works perfectly and shows me the right result.

    Then I tried to implement the fusion part as follows:

    public BigDecimal ODCIAggregateMerge (oracle.sql.STRUCT ctx2) throws SQLException {}

    BigDecimal Key2 = null;

    BigDecimal ctx_max = null;
    BigDecimal ctx_secmax = null;

    BigDecimal ctx2_max = null;
    BigDecimal ctx2_secmax = null;

    retrieve the context stored with the key
    StoredCtx_SecMax ctx = null;
    try {}
    CTX = (StoredCtx_SecMax) ContextManager.GetContext (Key.intValue ());
    } catch (Exception e) {}

    }

    Object [] impAttr = ctx2.getAttributes ();

    Key2 = (BigDecimal) impAttr [0];

    retrieve the second context stored using the key2
    StoredCtx_SecMax ctx_sec = null;
    try {}
    ctx_sec = (StoredCtx_SecMax) ContextManager.GetContext (key2.intValue ());
    } catch (Exception e) {}

    }

    ctx_max = ctx. LeseMax();
    ctx_secmax = ctx. LeseSecMax();

    ctx2_max = ctx_sec. LeseMax();
    ctx2_secmax = ctx_sec. LeseSecMax();

    If (ctx2_max.compareTo (ctx_max) == 1)
    {
    If (ctx2_secmax.compareTo (ctx_secmax) == 1)
    {
    CTX. SchreibeSecMax (ctx2_secmax);
    }
    on the other
    {
    CTX. SchreibeSecMax (ctx_max);
    }
    CTX. SchreibeMax (ctx2_max);
    }
    on the other
    {
    If (ctx2_max.compareTo (ctx_secmax) == 1)
    {
    CTX. SchreibeSecMax (ctx2_max);
    }
    }

    return a SUCCESS;
    }

    When I now try the function

    "Select / * + parallel (t 4) * / F_SECONDMAX_J (Columnname) of Tablename t;

    I always get a pointer NULL-error because the variable key2 is always 0 and therefore the functions LeseMax() and LeseSecMax()
    in the second context 'ctx_sec' produce this error NULL pointer.

    To me it seems that each parallel process is the construction of an additional class for himself, which is not available are my main process.

    My question is now how it is possible to access the context of stored of the parallel process, so that I can combine the results.

    Thank you very much

    Josef

    Hi Josef,

    just guess that I've never implemented with java user-defined aggregate functions or support parallel execution:

    Maybe you have to implement ODCIAggregateWrapContext?

    + Application of ODCIAggregateWrapContext is optional. It should be implemented only when the external memory is used to hold the aggregative, context and the user-defined aggregate is evaluated in parallel (which is, stated as PARALLEL_ENABLE). If the user-defined aggregate is not evaluated in parallel, ODCIAggregateWrapContext is not necessary. +
    [http://docs.oracle.com/cd/B12037_01/appdev.101/b10800/dciaggfns.htm#i1004974]

    Report it to progress and success.

    Good luck
    Rainer Stenzel

  • View criteria JDev 12.1.3 built invalid SQL

    Hello world

    It seems that in JDev 12.1.3 when a criterion for the view is created with a standard nested, generated when running query is not valid. It uses incorrectly alias upon accession of the two VO

    For example, I created two simple VO:

    ViewObj1 (SELECT 1 VO1_ID, "ViewObj1" DOUBLE TITLE):

    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ViewObj1"
      Version="12.1.3.10.8"
      InheritPersonalization="merge"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
      </DesignTime>
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="model.views.ViewObj1_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <SQLQuery><![CDATA[SELECT 1 VO1_ID, 'ViewObj1' TITLE FROM DUAL]]></SQLQuery>
      <ViewAttribute
        Name="Vo1Id"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.math.BigDecimal"
        ColumnType="NUMBER"
        AliasName="VO1_ID"
        Expression="VO1_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Title"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="8"
        Type="java.lang.String"
        ColumnType="CHAR"
        AliasName="TITLE"
        Expression="TITLE"
        SQLType="CHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="8"/>
        </DesignTime>
      </ViewAttribute>
      <ViewCriteria
        Name="ViewObj1Criteria"
        ViewObjectName="model.views.ViewObj1"
        Conjunction="AND">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="false"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="true"/>
            <Property
              Name="mode"
              Value="Basic"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="ViewObj1Criteria_row_0"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="ViewObj1Criteria_ViewObj1Criteria_row_0_Title"
            ViewAttribute="Title"
            Operator="STARTSWITH"
            Conjunction="AND"
            Value=""
            Required="Optional"/>
          <ViewCriteriaItem
            Name="ViewObj1Criteria_ViewObj1Criteria_row_0_ViewObj2"
            ViewAttribute="ViewObj2"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="ViewObj2NestedCriteria"
              ViewObjectName="model.views.ViewObj2"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="ViewObj2NestedCriteria_row_0"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Vo1Id"
                  ViewAttribute="Vo1Id"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
                <ViewCriteriaItem
                  Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Title"
                  ViewAttribute="Title"
                  Operator="STARTSWITH"
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
      <AttrArray Name="KeyAttributes">
        <Item Value="Vo1Id"/>
      </AttrArray>
      <ViewLinkAccessor
        Name="ViewObj2"
        ViewLink="model.views.ViewLink"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
      <ResourceBundle>
        <PropertiesBundle
          PropertiesFile="model.ModelBundle"/>
      </ResourceBundle>
    </ViewObject>
    
    
    


    ViewObj2 (SELECT 1 VO1_id, VO2_ID 2, "ViewObj2" DOUBLE TITLE):

    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ViewObj2"
      Version="12.1.3.10.8"
      InheritPersonalization="merge"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
      </DesignTime>
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="model.views.ViewObj2_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <SQLQuery><![CDATA[SELECT 1 VO1_id, 2 VO2_ID, 'ViewObj2' TITLE FROM DUAL]]></SQLQuery>
      <ViewAttribute
        Name="Vo1Id"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.math.BigDecimal"
        ColumnType="NUMBER"
        AliasName="VO1_ID"
        Expression="VO1_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Vo2Id"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.math.BigDecimal"
        ColumnType="NUMBER"
        AliasName="VO2_ID"
        Expression="VO2_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Title"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="8"
        Type="java.lang.String"
        ColumnType="CHAR"
        AliasName="TITLE"
        Expression="TITLE"
        SQLType="CHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="8"/>
        </DesignTime>
      </ViewAttribute>
      <AttrArray Name="KeyAttributes">
        <Item Value="Vo2Id"/>
      </AttrArray>
      <ResourceBundle>
        <PropertiesBundle
          PropertiesFile="model.ModelBundle"/>
      </ResourceBundle>
    </ViewObject>
    
    
    

    and created a link that joins the two on VO1_ID.

    Finally, I created a display criteria in ViewObj1:

    <ViewCriteria
        Name="ViewObj1Criteria"
        ViewObjectName="model.views.ViewObj1"
        Conjunction="AND">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="false"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="true"/>
            <Property
              Name="mode"
              Value="Basic"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="ViewObj1Criteria_row_0"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="ViewObj1Criteria_ViewObj1Criteria_row_0_Title"
            ViewAttribute="Title"
            Operator="STARTSWITH"
            Conjunction="AND"
            Value=""
            Required="Optional"/>
          <ViewCriteriaItem
            Name="ViewObj1Criteria_ViewObj1Criteria_row_0_ViewObj2"
            ViewAttribute="ViewObj2"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="ViewObj2NestedCriteria"
              ViewObjectName="model.views.ViewObj2"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="ViewObj2NestedCriteria_row_0"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Vo1Id"
                  ViewAttribute="Vo1Id"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
                <ViewCriteriaItem
                  Name="ViewObj2NestedCriteria_ViewObj2NestedCriteria_row_0_Title"
                  ViewAttribute="Title"
                  Operator="STARTSWITH"
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
    
    
    

    At run time, when searching on an attribute in the nested criteria (ViewObj2), I get: ORA-00904: "QRSLTSQ1." "' VO1_ID ': invalid identifier.

    The query that is executed is:

    SELECT *
    FROM
      (SELECT 1 VO1_ID,
        'ViewObj1' TITLE
      FROM DUAL
      ) QRSLT
    WHERE ( ( (EXISTS
      (SELECT *
      FROM
        (SELECT 1 VO1_id, 2 VO2_ID, 'ViewObj2' TITLE FROM DUAL
        ) QRSLTSQ2
      WHERE ( (VO1_ID      = :vc_temp_1 ) )
      AND (QRSLTSQ1.VO1_ID = QRSLTSQ2.VO1_ID)
      )) ) )
    
    
    

    As you can see on line 13, it's with the help of QRSLTSQ1. VO1_ID when he is recommended to use QRSLT. VO1_ID.

    I'm doing something wrong? If not, is there a fix or a workaround for this bug?

    Thank you

    Bill

    It seams to be a strange behavior in the 12.1.3 sql builder. In this post VC Jdeveloper application encapsulating a user has reported something similar. He found a work around (last post of the thread) that you can try.

    Anyway, if thre is a fix available for what you ha vet oask support.oracle.com (paid support contract). They are the only ones who can tell you if it's a bug, after all, and if a fix is available. If this isn't the case, you can request a.

    Timo

  • What is this java.lang.NumberFormatException: null

    Mr President.

    I'm trying to run a report with a button on a page jsff

    My button code is

    <af:button text="button 1" id="b1" destination="/printreportservlet?employeeId#{bindings.EmployeeId.inputValue}"/>
    

    My servlet code is

    package view;
    
    
    import java.io.IOException;
    import java.io.PrintWriter;
    
    
    import javax.servlet.*;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.*;
    import java.io.IOException;
    import java.io.InputStream;
    
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    
    
    import java.util.HashMap;
    import java.util.Locale;
    import java.util.Map;
    
    
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    
    
    
    import model.AppModuleImpl;
    
    
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperExportManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.engine.design.JasperDesign;
    import net.sf.jasperreports.engine.xml.JRXmlLoader;
    
    
    import oracle.jbo.client.Configuration;
    
    
    @WebServlet(name = "PrintReportServlet", urlPatterns = { "/printreportservlet" })
    public class PrintReport1Servlet extends HttpServlet {
        private static final String CONTENT_TYPE = "text/html; charset=UTF-8";
    
    
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
        }
        
        /**
                 * @return
                 */
                protected Connection getConnection() {
         
         
        //            System.out.println("getConnection--");
         
         
                    PreparedStatement st = null;
                    String amDef = "sa.gov.rgr.model.module.AppModuleAM";
                    String config = "AppModuleAMLocal";
                    AppModuleImpl am = (AppModuleImpl ) Configuration.createRootApplicationModule(amDef, config);
         
         
                    st = am.getDBTransaction().createPreparedStatement("select 1 from dual", 0);
                    Connection conn = null;
         
         
                    try {
                        conn = st.getConnection();
                        return conn;
                    } catch (SQLException e) {
                    }
         
         
                    return null;
                }
        /**
             * @param request
             * @param response
             * @throws ServletException
             * @throws IOException
             */    
    
    
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            response.setContentType(CONTENT_TYPE);
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head><title>PrintReportServlet</title></head>");
            out.println("<body>");
            out.println("<p>The servlet has received a GET. This is the reply.</p>");
            out.println("</body></html>");
            out.close();
            
            String var0 = "";
                    try {
                        var0 = request.getParameter("employeeId");
                       
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                   
                    response.setContentType(CONTENT_TYPE);
                   
                    Map parameters = new HashMap();
                    parameters.put("format", "pdf");
                    parameters.put("WEBDIR", getServletContext().getRealPath("/"));
                    parameters.put("REPORT_LOCALE", new Locale("ar"));
             
             
                    parameters.put("employeeId", new Long(var0));
                    Connection conn = null;
                    InputStream is = null;
                    try
                    {
                      conn = getConnection();
                      is = getServletContext().getResourceAsStream("/WEB-INF/reports/Report.jrxml");
             
             
                      response.setContentType("application/pdf");
                      response.addHeader("Content-Disposition", "attachment; filename=report.pdf");
                       
                      JasperDesign jasperDesign = JRXmlLoader.load(is);
                      JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
             
             
                      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
             
             
                      JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
                       
             
                      conn.close();
                    }
                    catch (Exception e) {
                      e.printStackTrace();
                    } finally {
                      closeConnection(conn);
                      try {
                          if(is !=null){
                              is.close();
                          }
                         
                         
                      } catch (Exception localException1)
                      {
                      }
                    }
                   
                }
        
        /**
             * @param conn
             */
            protected static void closeConnection(Connection conn) {
                try {
                    if(conn !=null){
                        conn.close();
                    }
                   
                } catch (Exception ex) {
                    //  System.out.println("Developer Msg : Exception in printReport1Servlet.closeConnection()");
                }
            }
        
    }
    

    The code of my report is

    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1100e657-82b6-466e-b6eb-58efd82952cb">
      <property name="ireport.zoom" value="1.0"/>
      <property name="ireport.x" value="0"/>
      <property name="ireport.y" value="0"/>
      <parameter name="employeeId" class="java.lang.String">
      <defaultValueExpression><![CDATA[]]></defaultValueExpression>
      </parameter>
      <queryString>
      <![CDATA[select * from employees
    WHERE EMPLOYEE_ID=to_number($P{employeeId})]]>
      </queryString>
      <field name="EMPLOYEE_ID" class="java.lang.Long"/>
      <field name="FIRST_NAME" class="java.lang.String"/>
      <field name="LAST_NAME" class="java.lang.String"/>
      <field name="EMAIL" class="java.lang.String"/>
      <field name="PHONE_NUMBER" class="java.lang.String"/>
      <field name="HIRE_DATE" class="java.sql.Timestamp"/>
      <field name="JOB_ID" class="java.lang.String"/>
      <field name="SALARY" class="java.math.BigDecimal"/>
      <field name="COMMISSION_PCT" class="java.math.BigDecimal"/>
      <field name="MANAGER_ID" class="java.math.BigDecimal"/>
      <field name="DEPARTMENT_ID" class="java.math.BigDecimal"/>
      <background>
      <band splitType="Stretch"/>
      </background>
      <title>
      <band height="79" splitType="Stretch"/>
      </title>
      <pageHeader>
      <band height="35" splitType="Stretch"/>
      </pageHeader>
      <columnHeader>
      <band height="61" splitType="Stretch">
      <staticText>
      <reportElement x="229" y="2" width="100" height="20" uuid="225ce4a1-d66e-4b64-bcb8-f35994d570ec"/>
      <text><![CDATA[EMPLOYEE_ID]]></text>
      </staticText>
      </band>
      </columnHeader>
      <detail>
      <band height="125" splitType="Stretch">
      <textField>
      <reportElement x="229" y="55" width="100" height="20" uuid="a8cd9d36-884a-4edf-8052-314b484e00c4"/>
      <textFieldExpression><![CDATA[$F{EMPLOYEE_ID}]]></textFieldExpression>
      </textField>
      </band>
      </detail>
      <columnFooter>
      <band height="45" splitType="Stretch"/>
      </columnFooter>
      <pageFooter>
      <band height="54" splitType="Stretch"/>
      </pageFooter>
      <summary>
      <band height="42" splitType="Stretch"/>
      </summary>
    </jasperReport>
    

    And my page jsff code is

    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                    xmlns:f="http://java.sun.com/jsf/core">
      
      <af:button text="button 1" id="b1" destination="/printreportservlet?employeeId#{bindings.EmployeeId.inputValue}"/>
      <af:table value="#{bindings.EmployeesView1.collectionModel}" var="row" rows="#{bindings.EmployeesView1.rangeSize}"
                emptyText="#{bindings.EmployeesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                rowBandingInterval="0" selectedRowKeys="#{bindings.EmployeesView1.collectionModel.selectedRow}"
                selectionListener="#{bindings.EmployeesView1.collectionModel.makeCurrent}" rowSelection="single"
                fetchSize="#{bindings.EmployeesView1.rangeSize}" id="t1">
        <af:column headerText="#{bindings.EmployeesView1.hints.EmployeeId.label}" id="c1">
          <af:outputText value="#{row.EmployeeId}" shortDesc="#{bindings.EmployeesView1.hints.EmployeeId.tooltip}" id="ot1">
            <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeesView1.hints.EmployeeId.format}"/>
          </af:outputText>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.FirstName.label}" id="c2">
          <af:outputText value="#{row.FirstName}" shortDesc="#{bindings.EmployeesView1.hints.FirstName.tooltip}" id="ot2"/>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.LastName.label}" id="c3">
          <af:outputText value="#{row.LastName}" shortDesc="#{bindings.EmployeesView1.hints.LastName.tooltip}" id="ot3"/>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.Email.label}" id="c4">
          <af:outputText value="#{row.Email}" shortDesc="#{bindings.EmployeesView1.hints.Email.tooltip}" id="ot4"/>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.PhoneNumber.label}" id="c5">
          <af:outputText value="#{row.PhoneNumber}" shortDesc="#{bindings.EmployeesView1.hints.PhoneNumber.tooltip}"
                         id="ot5"/>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.HireDate.label}" id="c6">
          <af:outputText value="#{row.HireDate}" shortDesc="#{bindings.EmployeesView1.hints.HireDate.tooltip}" id="ot6">
            <af:convertDateTime pattern="#{bindings.EmployeesView1.hints.HireDate.format}"/>
          </af:outputText>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.JobId.label}" id="c7">
          <af:outputText value="#{row.JobId}" shortDesc="#{bindings.EmployeesView1.hints.JobId.tooltip}" id="ot7"/>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.Salary.label}" id="c8">
          <af:outputText value="#{row.Salary}" shortDesc="#{bindings.EmployeesView1.hints.Salary.tooltip}" id="ot8">
            <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeesView1.hints.Salary.format}"/>
          </af:outputText>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.CommissionPct.label}" id="c9">
          <af:outputText value="#{row.CommissionPct}" shortDesc="#{bindings.EmployeesView1.hints.CommissionPct.tooltip}"
                         id="ot9">
            <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeesView1.hints.CommissionPct.format}"/>
          </af:outputText>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.ManagerId.label}" id="c10">
          <af:outputText value="#{row.ManagerId}" shortDesc="#{bindings.EmployeesView1.hints.ManagerId.tooltip}" id="ot10">
            <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeesView1.hints.ManagerId.format}"/>
          </af:outputText>
        </af:column>
        <af:column headerText="#{bindings.EmployeesView1.hints.DepartmentId.label}" id="c11">
          <af:outputText value="#{row.DepartmentId}" shortDesc="#{bindings.EmployeesView1.hints.DepartmentId.tooltip}"
                         id="ot11">
            <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeesView1.hints.DepartmentId.format}"/>
          </af:outputText>
        </af:column>
      </af:table>
    </ui:composition>
    

    The complete error code is

    java.lang.NumberFormatException: null
      at java.lang.Long.parseLong(Long.java:404)
      at java.lang.Long.<init>(Long.java:702)
      at view.PrintReport1Servlet.doGet(PrintReport1Servlet.java:113)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      Truncated. see log file for complete stacktrace
    > 
    <Mar 27, 2015 10:03:46 AM PKT> <Notice> <Diagnostics> <BEA-320068> <Watch "UncheckedException" in module "Module-FMWDFW" with severity "Notice" on server "DefaultServer" has triggered at Mar 27, 2015 10:03:46 AM PKT. Notification details: 
    WatchRuleType: Log 
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802')) 
    WatchData: DATE = Mar 27, 2015 10:03:46 AM PKT SERVER = DefaultServer MESSAGE = [ServletContext@1295794488[app:JasperServletTester module:JasperServletTester-ViewController-context-root path:null spec-version:3.0]] Servlet failed with an Exception
    java.lang.NumberFormatException: null
      at java.lang.Long.parseLong(Long.java:404)
      at java.lang.Long.<init>(Long.java:702)
      at view.PrintReport1Servlet.doGet(PrintReport1Servlet.java:113)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
     SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = TANVIR-PC TXID =  CONTEXTID = fd43f1ae-c573-4366-9924-18a1ab1a228f-0000008d TIMESTAMP = 1427432626062  
    WatchAlarmType: AutomaticReset 
    WatchAlarmResetPeriod: 30000 
    > 
    <oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl> <DiagnosticsDataExtractorImpl> <createADRIncident> <incident 16 created with problem key "DFW-99998 [java.lang.NumberFormatException][oracle.security.jps.ee.http.JpsAbsFilter$1.run][JasperServletTester]"> 
    <oracle.adf.common> <AdfDiagnosticsJarsVersionDumpImpl> <executeDump> <Path of the jars version dump :C:\Users\TANVIR\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\servers\DefaultServer\adr\diag\ofm\defaultdomain\defaultserver\incident\incdir_16/adf_DiagnosticsJarsVersionDump24_i16.txt> 
    

    For any help, I'll be very grateful

    Concerning

    Tender,

    As I mentioned in the other thread, the var0 comes null which causes this problem.

    Why var0 just null?

    You must change the property of destination as below:

    
    
    

    You must add "="

    See you soon

    AJ

  • Problem of composite key chain BigDecimal, pair

    JDeveloper 12.1.3

    I have OS based on a table that has the following PK

    Task_Id NUMBER

    Id_ressource Varchar2 (6)

    Using the EO above, I have a VO to view data in the user interface. I get the problem in the bean to support (test code below)

                DCBindingContainer dcbindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                DCIteratorBinding iterator = dcbindings.findIteratorBinding("TaskCalendarIterator");
                System.out.println(activity.getProvider().getId());
                //Key key = new Key(new Object[] { activity.getId(),activity.getProvider().getId() });
                java.math.BigDecimal key1= new BigDecimal(140080);
                String key2="ds1";
                Key key = new Key(new Object[] { key1,key2 });
                System.out.println(activity.getId());
                System.out.println(key);
                RowSetIterator rsi = iterator.getRowSetIterator();
                Row row = rsi.findByKey(key, 1)[0]; //!!!!!!!!!!!!!!!!!!!!!!!!!!!! Here is where exception is thrown
                rsi.setCurrentRow(row);
    

    Caused by: oracle.jbo.domain.DataCreationException: Houston-25009: failed to create an object of type: java.math.BigDecimal type: java.lang.String with value: ds1

    Recording with the key 140080, ds1 exists in the iterator.

    I thought that the key can be anything, including channels?

    OK, I got the problem solved. The order of the key attributes must be identical to the order of these attributes in the original Version, NOT in OT

    The order was therefore, in my case in OT, TaskId, ResourceId

    Vo to ResourceId, TaskId

    That's why in the bean to support code, it must be:

    java.math.BigDecimal key1= new BigDecimal(140080);  //This is TaskId
    String key2="ds1";  //This is ResourceId
    Key key = new Key(new Object[] { key2,key1 });
    
  • Compare SingleValueMetricSummaryn with BigDecimal

    Hello

    Sorry for bumping this thread, which is a 'double' in http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/f/4788/t/19551869

    I am trying to create a new rule. I want to compare a value to a threshold, which comes from a variable.

    I'm stuck with this issue:

    Can't compare com.quest.nitro.model.canonical.bean.SingleValueMetricSummary with the value "97.0 ' and Java.Math.BigDecimal with the value «95.0 '»»

    https://support.quest.com/SolutionDetail.aspx?ID=SOL90787 is not useful:

    With the help of getAvg() results in java.lang.NullPointerException.

    That's how I get my values:

    Val = ds.retrieveLatestValue(scope,_it).value

    Any ideas?

    This should work:

    Val = ds.retrieveLatestValue (datastore, "totalSpace")? value?. AVG

    Just a thought, however, is that retrieveLatestValue is not a good idea for a rule, because they should work on current values.

    retrieveLatestValue displays the last value collected, that would have made last week.

    Val = #totalSpace # would be more appropriate for a rule whose scope is VMWDatastore.

    Of course, would be replaced by metric topology to the scope name.

  • java load problem

    I have the following code segment of asktom.com that it can compile if I run it in the form of sql script, but when I compile and package the code in Eclipse and load it into db by sqldeveloper I get the following error

    java.sql.SQLException: ORA-29509: incorrect binary definition of class Java

    any help will be really appreciate it.


    CREATE OR REPLACE AND COMPILE

    JAVA SOURCE NAMED 'demo_passing_pkg '.

    AS

    import java. IO;

    import java.sql. *;

    java.math import. *;

    Oracle.sql import. *;

    Import oracle.jdbc.driver. *;

    public class demo_passing_pkg extends {object}

    public static void pass (java.lang.String p_in,

    java.lang.String [] p_out) {}

    /*

    * the simplest data types - the chain.  If you remember

    * version C with 6 formal parameters, null indicators,

    * strlen, of strcpy and so on - it is trivial in

    * Comparison

    */

    If (p_in! = null) {}

    System.out.println

    ("The first parameter is" + p_in.toString ());

    p_out [0] = p_in.toUpperCase ();

    System.out.println

    ("Parameter set to" + p_out [0] m:System.NET.SocketAddress.ToString ());

    }

    }

    Private Shared Sub show_array_info (oracle.sql.ARRAY p_in)

    throws SQLException {}

    System.out.println ("Table is of type" +)

    p_in.getSQLTypeName ());

    System.out.println ("Table type code is" +)

    p_in.getBaseType ());

    System.out.println ("Table length is" +)

    p_in.length ());

    }

    public static void

    pass_str_array (oracle.sql.ARRAY p_in, oracle.sql.ARRAY [] p_out)

    Bird {java.sql.SQLException, IOException}

    show_array_info (p_in);

    String [] values = (String []) p_in.getArray ();

    for (int i = 0; i < p_in.length (); i ++)

    System.out.println ("p_in [" + i + "] ="+ values [i] ");

    Connection conn = new OracleDriver () .defaultConnection ();

    Descriptor ArrayDescriptor =

    ArrayDescriptor.createDescriptor (p_in.getSQLTypeName (), conn);

    p_out [0] = new ARRAY (descriptor, conn, values);

    }

    public static String return_string() {}

    return "Hello World";

    }

    }

    If I do that online comand, it works. somehow my setting of the eclipse is not set on the parameter to JVM 1.5 oracle...

    javac-source 1.5 - target 1.5 artst2\demo_passing_pkg.java

  • BigDecimal rounded - no arrivez.5 round 1

    Why can't I pas.5 to round to 1 using BigDecimal.

    Here's the code;

    java.math.MathContext mc = new java.math.MathContext (1, java.math.RoundingMode.HALF_UP);

    Java.Math.BigDecimal obj_0 = new Java.Math.BigDecimal ("0.5");
    System.out.println ("value of obj_0:" + obj_0);
    System.out.println ("result generated method:" + obj_0.round (mc));

    Here is the result;
    obj_0 value: 0.5
    result of the generated method: 0.5

    This works as expected for greater than 1 decimals.

    What Miss me about BigDecimal mathematically?

    Thank you.

    >
    If you can use BigDecimal rounding to the nearest whole number (one or zero) when the value is less than 1 and greater than zero?
    >
    Just set the scale and the rounding mode when you use the value.

    System.out.println("method generated result : " + obj_0.setScale(0, java.math.RoundingMode.HALF_UP));
    
    method generated result : 1
    
  • ADF business components Type map Oracls vs Java

    What advantages and disadvantages of each one card

    I thank in advance

    Take a look at this link in the developer's guide:
    http://docs.Oracle.com/CD/E16162_01/Web.1112/e16182/bcintro.htm#sm0062

    The scope of Java to map Oracle and Oracle areas type plan manage numeric data differently. When you create a new application of the type mapping default Java extended for Oracle maps the digital data to the Java.Math.BigDecimal > class that inherits from java.math.Number. The default value of Java.Math.BigDecimal corresponds to the way that web view Fusion application layer, consisting of elements ADF Faces, retains the alignment of digital data (such as numeric values > posted by ADF Faces of fields on a web page). Whereas the areas of the Oracle type that maps digital data from the oracle.jbo.domain.Number class, may not display the data with alignment scheduled by some ADF Faces > components. Apart from this alignment problem, the plan of type Oracle areas remains a valid choice and applications without ADF Faces components will work without problem.

    Thank you
    Nini

Maybe you are looking for

  • With the help of uk buy Apple TV in the United States

    I brought our Apple TV on vacation in Orlando, but none of the applications are available at this time. Have reset and set up in the United States according to the market through but not yet available and also invisible to broadcast on airplay.

  • Freezes, accused on the internet

    Still no cure for this problem! iMac OSX El Capitan 10.11.6 version 2.7 GHz Intel Core i5. 8 GB 1600 MHz DDr3. If previously posted gel unresolved issue. While on the internet (Safari + Chrome) internet freezes for up to 2/3 minutes and then works no

  • Can I embed a YouTube video in a Pages document?

    Can I embed a YouTube video in a Pages document?

  • ATRIX HD: Unable to meet the guest of the meeting.

    When I get an invitation sent meeting of Microsoft Hotmail / Microsoft Windows Live Mail / Microsoft Outlook on my Google Gmail account, I am unable to accept or decline the invitation to the Android Gmail app 4.0.4. The Gmail application displays th

  • zero text file filter detection table 2d

    A drawing on that space.  I have a text file that represents a distance 2d array in column 1 and the voltage in column 2.  You will need to search for file and extract the crossing value of zero and the corresponding value to the distance.  Once comp