Calculate timestamp filed using sql default value

I am using jdeveloper 11.1.2
I have entity with two Date fields in it and one number field called PERIOD
first field is "PLAN_APPROVED_DATE"
second is "WORK_DUE_DATE"
workDueDate value is PLAN_APPROVED_DATE+ PERIOD
in the workDueDate field I defined the default value as "SQL" and this is my sql
SELECT TO_TIMESTAMP(add_months(PLAN_APPROVED_DATE,TA_SCI.PERIOD), 'DD-Mon-RR HH24:MI:SS.FF') from TA_SCI
when I run my application module tester i hae this error
oracle.jbo.AttributeLoadException: JBO-27021: Failed to load custom data type value at index 56 with java object of type oracle.jbo.domain.Number due to java.sql.SQLException.
Caused by: java.sql.SQLException: Invalid column index

You may some additional details here: Is this a bug in Jdeveloper 11g (11.1.2.1.0)

Similar Messages

  • Msql and o8i - using a default value in an insert

    1. In an Oracle 8i Enterprise DB I have a primary key in table FOO called FOO_ID, it's SQL description is:
    FOO_ID NUMBER DEFAULT TO_CHAR(sysdate, 'HH24MMSSMMDDYY') NOT NULL
    1.5 I test via TOAD inserting a record into the DB without specifying FOO_ID, but specifying other values in the table row. I commit the data. When I commit the table correctly fills in FOO_ID with a time/date stamp per the above definition.
    2. I run wtgpack and create an application which uses this table. I check the SQL code to make sure the column definition is copied to the snapshot which will be the basis for Oracle 9i Lite mobile DB on my laptop.
    3. I run msync.exe and get the DB.
    4. I run msql to make sure the data replicated ok. It did.
    5. I run an INSERT statement not specifying a primary key hoping that the default will be used. For example,
    "INSERT INTO FOO (FOO_TYPE) VALUES ('Test Type')";
    I get the following error from msql:
    [POL-3221] null key in primary index
    The questions is, why isn't the O9iLite DB using the default value when creating the new record/row?
    Thanks,
    Z

    Danny is spot on, but a little elaboration for the beginner:
    childValue == "yes" asks whether these two are the exact same String object. There are times when that's true, but it's unlikely. Instead, use String equals() ( childValue.equals("yes") ) to ask whether the two have the same value.
    With the simple class Danny suggests:
    class Vessel {
       private boolean assessed;
       private int stenosis;
       public boolean isAssessed() { return assessed; }
    }All you need in the loop is
    Iterator vessels = vesselAssessed.values().iterator();
    while (vessels.hasNext()) {
       Vessel vessel = (Vessel) vessels.next();
       if (vessel.isAssessed()) {
    }

  • How to make a subscription use the default value for a parameter

    Hi everyone,
    I need to use the CreateSubscription method and have this new subscription use a default value for certain parameter. How can I do this?

    Hi Marianne,
    I have to create the subscription programatically, which is different from what you mention. To further clarify my challenge:
    I have three parameters in a report: date-interval (string), start-date (date), end-date (date). If the user selects for example "last week" as the date-interval, the DEFAULT values for the other two are as follows:
    Code Snippet
    start-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-6)
    end-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-1)
    The user can then select intervals like "today", "yestarday", "this month" etc, and the other two parameters are calculated based on that date-interval parameter. Now, If I programatically create a subscription to a report that contains these three parameters and set a value of "last week" for the date-interval parameter, the subscription stores the fixed days (say september 10 to september 16) producing a report of the same week every time the subscription is run and not updating the correct interval to LAST-WEEK!. What should I put as the value for start-date and end-date when I create the subscription to have these two params get the DEFAULT calculated value based on the third param date-interval?
    Hope to have been more clear now.

  • How to use copy default values for material from vendor master in Account Group

    Dear all:
       In define AccountGroup for vendor ,there is a field named DURAS which means default values,who can tell me how to use it?
       Any informations are appreciated!

    Hi Katherine,
    I have tried using default value as B in the customizing
    If i maintain default values in the vendor master record, it will automatically adopt in the purchase info record.
    Here i tried using sales person & telephone no field in vendor master record & it automatically adopts to purchase info record.
    Region sales person and telephone no i have maintained in vendor master record, it automatically fetches to info record for the particular account group. I am not sure if there is any relation between vendor master and material master record.
    Regards
    Subbu.

  • NO ONE KNOWs??? EJB3.0: how to use column default value in the database??

    hi,
    This seems to be easy but I didn't find good answers... pls help...
    I have a table XYZ with a column:
    FriendlyName VARCHAR(30) NOT NULL DEFAULT 'my home'
    When I want to persist an entity object XYZ, I don't want to specify its field FriendlyName---in my program, l leave the field value to be null and I want to rely on the database to default its value to 'my home'
    however, i can't seem to do that because every time, i got the error msg saying the field "FriendlyName" can NOT be null.
    Is there a way for me to rely on the database to give the field its default value without specifying it in my entity class? (I am using ejb3.0 persistence+hibernate+mysql)
    thanks for ur input....

    That looks nice, when you don't include columns in
    inserts statements the dbms takes the default
    The question is: does hibernate understand and works
    with that?
    Let us knowWell, probably not. I did try that, somehow I got the following error msg. I did go through the log carefully, nothing really meaningful is there:
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3708)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3481)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1271)
         at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
         at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
         at $Proxy66.saveControlPoint(Unknown Source)
         at com.mycompany.struts.action.CustomerActivateControlPointAction.execute(CustomerActivateControlPointAction.java:102)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:413)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:225)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:249)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
         at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:220)
         at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:74)
         at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:162)
         at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:140)
         at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:79)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)

  • Using SQL Query Values as Report Parameters

    Why can I not use a page item to pass a value to a report when that page item is populated by a SQL query? If the item is populated as a database item, it can be passed, but not otherwise. Is there a way to work around this problem so that I can pass parameters to a report?

    Hi, Jeff
    Thanks for asking about this problem. This issue involves two tables mainly and others peripherally. I have a person table with borrower names and addresses, and each record in this table has an identifier in a column called IDENT. There is also a loan table with essential data on the loan, e.g.., loan identifier (DKTNR), the amount, interest rate, maturity date, etc., and also the IDENT linking to the person table. The borrower can be identified from any table that has the DKTNR in it by querying the borrower's name from the person table via the IDENT in the loan table. E.g., select borrower's name from loan_table, person_table where loan_table.ident = person_table.ident and the dktnr here equals the dktnr in the loan table.
    I put the borrower's name on each APEX page using this query. I have one table, for example, which stores default accountings (i.e., accountings on loans that have defaulted and, generally, on which the lender has had to expend money to maintain the loan's maritine collateral). The records in this table are identified by the DKTNR. So on the reports page which shows this accounting, there is a non-database_column field (page item) populated via this query. If I want to use the value of this page item on an Oracle report that can be printed, I cannot do so. I place it into a variable (I forgot the name of the variable type, but it is the &PX_ITEM_NAME. type) in the URL which calls the report, but it will not be placed in the report. It is as if I have put a null value into the variable.
    Ideas?

  • Can we use sql default data base for deploying lync monitoring

    Hi,
    I just want to know whether i can install monitoring server using lync server default instance of sql server.
    because i got an error stating "Cannot access LcsCDR or QoEMetrics on Monitoring back-end database. Verify that these databases have been deployed, and that access to the Monitoring back-end database is not blocked by the firewall".
    But when i use the named instance then it is working fine. can any body tell me why it is happening.
    Regards,
    Aslam  

    Hi,
    You can use default instance as describe in the following link:
    http://blogs.technet.com/b/nexthop/archive/2011/06/27/deployment-details-for-lync-monitoring-reports.aspx
    Please refer to Installation section.
    Please make sure the account you used to deploy Monitoring Server reporting service has the required permission of your Monitoring Database.
    In addition, please double check the following limits of databases for Lync Server:
    You can collocate each of the following databases on the same database server:
    Back-end database
    Monitoring database
    Archiving database
    You can collocate any or any or all of these databases in a single SQL instance or use a separate SQL instances for each, with the following limitations:
    Each SQL instance can contain only a single back-end database, single Monitoring database, and single Archiving database.
    The database server cannot support more than one Front End pool, one Archiving Server, and one monitoring Server, but it can support one of each, regardless of whether the databases use the same SQL instance or separate SQL instances.
    Kent Huang
    TechNet Community Support

  • Can i use the default value in TNSNAMES.ora file

    Hai , i connect the Vb to oralcle using Oracle data access component , and i have read the documentation for ora file.
    Most documentation show to connect oracle with vb.net , the ora file must be modified.
    My questions is , can i directly connect to Oracle without modify the ora file ?
    Thank You

    Thank you for the reply. I will read the documentation first.
    I install the oracle 10g express edition . Hence , i have two user , the sys an the other is hd.
    How the TNSNAMES.ora known i want connect to which username ?
    Thank you

  • View Object transient attributes with SQL default value

    Dear All
    I am working on JDeveloper 12.1.2
    In my scenario i have application module A in my main application. I created another data model with Application module B. I imported AM B into my main project.
    The problem is that when i have a transient attribute based on SQL statment in AM B, it gives me error in runtime on the interface but when i run the application module it works fine ... i do not know why
    Regards

    Hi,
    what sqlstatement you worte? what error?
    thanks

  • Ben, I am using the default value. (Terminal is unwired)

    Terminal is unwired.

    I believe the unwired is defaulting to true which says that visa will look for the termination character and pull it out of the data stream. If you want to see CR-LF's you will have to turn this off.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to load a default value in to a column when using sql loader

    Im trying to load from a flat file using sql loader.
    for 1 column i need to update using a default value
    how to go about this?

    Hi!
    try this code --
    LOAD DATA
       INFILE 'sample.dat'
       REPLACE
       INTO TABLE emp
       empno   POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
       ename   POSITION(06:15)  CHAR,
       job         POSITION(17:25)  CHAR,
       mgr       POSITION(27:30)  INTEGER EXTERNAL NULLIF mgr=BLANKS,
       sal        POSITION(32:39)  DECIMAL EXTERNAL NULLIF sal=BLANKS,
       comm   POSITION(41:48)  DECIMAL EXTERNAL DEFAULTIF comm = 100,
       deptno  POSITION(50:51)  INTEGER EXTERNAL NULLIF deptno=BLANKS,
       hiredate POSITION(52:62) CONSTANT SYSDATE
      )-hope this will solve ur purpose.
    Regards.
    Satyaki De.

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

  • Problem using default value of report parameter 1 to validate parameter 2 passed in to report

    I am having a problem with an SSRS report using the default value of report parameter 1 to validate parameter 2 passed in to report (via C#) instead of using the value of parameter 1 that is also passed into the report.  Here are the
    simplified details:
    Using SSDT, SQL Server 2008 R2
    SSRS report has 2 parameters:
    P1 -- text, hidden, default value 'R1', ... front-end C# code can pass 'R2' or 'R1'
    P2 -- text, allows multiple values, list of available values provided by stored procedure (sproc_list) that takes P1 value as a parameter.  Hence, sproc_list either provides a list for P1 = 'R1' or P1 = 'R2'.
    List for P1 = 'R1' is 'A', 'B', 'C'
    List for P1 = 'R2' is 'A', 'B', 'D'
    Values for P1 and P2 can be passed in via C# to the report.
    The C# front-end displays 2 report choices to the user, R1 and R2, where both choices call the same RDL; but choice R1 passes in 'R1' for P1, and the choice R2 passes in 'R2' for P1.
    Upon a users 1st time use of the report no parameters are passed in.  Then when the user exits the report, the parameter value for P2 that was chosen is saved off to a file for R1 or R2, and used the next time the user selects the report.
    Everything always works fine for report R1 since the default value for P1 is 'R1'.
    When R2 is chosen and the user selects 'D' as the value for P2, runs the report, then exits, the P2 value of 'D' for R2 is saved to a file.  When the user returns the next day to run report R2, 'R2' is passed for P1, and 'D' is passed for P2.
    This is when the problem occurs.  The value of 'D' for P2 is validated against a list generated for P2 based on the default value of 'R1' for parameter P1.  Hence, SSRS considers 'D' an invalid value for P2 and blanks out the P2 parameter. 
    The user can then use the drop down list for P2 and choose 'D', but this defeats the purpose of saving the parameter values to be used the next time.
    Why is the stored procedure that provides a list of available values for parameter P2 using the default value of 'R1' for parameter P1 instead of using the value of 'R2' passed into the report for parameter P1?

    Hi Tom,
    Sorry for my delay.
    If I understand correctly, you have two parameter in your report. It is a couple of cascading parameter. If we have choose ‘R1’ of P1, the P2 values is A, B, C. ‘R2’ of P1, corresponding P2 values is A, B, D. What your requirement is to save the end use
    select option of these two parameters.
    In SSRS, if we have configure the parameter with default value. When we run the report, the parameter will fill with the default value to filter data. If we want to save the last status we are render the report, we need to update the default value of P1.
    If we are query the default value from database, if possible, we can
    update the database try to resolve the issue.  Alternatively, we can set the dynamic default value for the parameter.
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Deafaul Value using SQL query

    Hi
    I'm trying to make a default value using Computations;
    when I create computation,
    I select
    Computation item: PXX_TEST
    computation type: SQL query
    computation Point: I tried all
    Computation: select X FROM Y WHERE X= '1'
    This is the way to get Default Value ??
    I need to display the value when the page is open
    Thanks
    MM

    MM,
    You can use the default value attribute of the item to set a value if the item's source produces a null. A computation (before/after header) can work too, but it's possible that the item source and Source Used attribute (Always/Only) are interfering with your computation so you might want to try setting Source Used to 'Only...' if you have a computation setting the item.
    Scott

  • Setting default value for form field assoc with a table column

    On a "Create Record" situation I was trying to set the default values of some form fields using a page level "Process". These form fields have Source Type = Database Column. It wasn't working, I could only set non-db assoc form field values no matter when the "Process" was set to exec. From some other posts it seems that this is by design, ie. not being able to programatically set the initial values of form fields that are sourced to db columns. I was hoping to have just one "Process" that would exec to set these initial values in one place rather than scattered about for each field that needed a default value. These particular default values come from ref tables and may be different for each user.
    So, it looks like I have to use a "Default Value" plsql chunk for each field on the form itself or else set their value on the calling form's Redirect in the "Set these Items" area.
    Is this correct?

    You could define a database function which accepts the name of the item and the user ID of the user running the application. Based on the item name and the user ID have the function return the appropriate initial value. Invoke this function in a "Default Value" PL/SQL block.
    Does that help in centralizing your initial values? You could have one function per page or one function per application. I would do one function per application.

Maybe you are looking for