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

Similar Messages

  • View Object Transient attribute, refresh problem.

    I have a VO which contains 3 entities joined. I added it a transient attribute with Groovy expression. My expression is : ReplyView.count("ReplyId"); , it counts two VO relationship. it counts normally but, when i insert a new reply, it doesnt refresh/update/recalculate the value. Whats the problem?

    The dependency values referred to are accessed when you edit the transient attribute in the view object. On the left hand panel select dependencies and shuttle the columns that the transient is dependent on. I don't think this matters for non-entity based views since the SQL is fixed but for entity based views this assures the dependent columns are added to the query even if they are not needed by the page.
    http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcentities.htm#ADFFD20177

  • View Object transient attribute (Calculate sum) using groovy problem

    Hi
    I have a read only view object named "ConnectionVVO". And it has database field name "points"(type is number).
    Now I need to take the sum of points.
    For this I did the following.
    Self view object added to the same view object as a view accessor named "ConnectionVVO1".
    Created a transient attribute named "TotalPoints".
    Added following groovy as the value expression of the above transient attribute.
    adf.object.ConnectionVVO1.getRowSet().sum("points")after that when I run the application module and run the view object it was extremely slow. Actually nothing was appeared. There after I modified the sql statement and added a where clouse to select few rows.
    Then it was appeared without slowness.
    The table has around 11 million records.
    Could you please provide a hint or any alternate way for doing this(getting the sum of points).
    Please help.
    Edited by: deshan on Mar 9, 2011 2:56 PM

    Hi Timo,
    Thank you very much for the explanation and direction. I will do that way. I have found that implementing view object and view row class I could do the similar kind of thing for the transient attribute.
    public Number getTotalPoints() {   
    RowIterator con= getConnectionViewImpl();
       Number sum = new Number(0);
       while (con.hasNext()) {     
          sum = sum.add( (Number)con.next().getAttribute("Points"));
        }    return sum;
      } took form
    http://technology.amis.nl/blog/1295/creating-a-dynamic-ajax-column-footer-summary-in-a-table-component-using-adf-faces
    But it also slow as 1 st method
    I am wonder whether both ways behave as similarly or they are totally different implementation?

  • Object would have more then one attribute with the tag :VALUE

    I'm creating a new component in Ultiboard - a 100 pin connector.  This connector (Hirose) has 4 rows of 25 pins. Alternate rows are staggered. I'm trying to name each pin with it's appropiate name: A1, A2, A3 ....A50. Then B1, B2, B3 .....B50.
    When I change the VALUE or NUMBER attribute, I get the DRC error  message:
    This action cannot be completed because the resulting Object would have more then one attribute with the tag :VALUE
    Please remove one of the attributes and try again.
    Okay, so I've tried deleting the tag and now I can't name the pin at all. 
    What am I missing?

    You should be in the footprint editor to edit the pin name.  Select tools>>Database>>Database Manager, highlight the component in your database and click on the Edit icon.  In the footprint editor, double click on the pad and a SMT or THT pin Properties dialog appears, select the Attributes tab and highlight the Number row, press the change button and you should be able to change the pin name.   
    Tien P.
    National Instruments

  • XML FORM  -  How to save read-only controls with a default value

    Hello everybody,
    I have a 3 xml forms, each one to create one type of news. I need to use 3 because each of this forms has their own controls. But the control which indicates the type of news (asociated with a KM Predefined Property) must be common in the 3 forms, in order to use it on searches.
    The question is, how can I include in this forms a control:
      - Visible for the user
      - With a default value defined in the control properties (each form has a different value, corresponding with the type of news)
      - Read-only mode
      - The value showed in the control must be saved in the associated KM Predefined Property when the user clicks the Save button. 
    Anyone knows how to do this?
    What control can I use?
    I was thinking of trying with text boxes, but I don't find the way to make them unwritable (Read only mode).
    It is posible using labels?
    Thanks.
    Kind regards

    Hello Jose,
    I know you responded with a question... I see it in the email, but I don't see it here!  Very odd... but in response:
    The first thing I do when I open the Edit.xsl file is do a 'find' for the name of the text field that I want to be read-only (in my test case, it's 'location').  Repeat the find until you see something like:
    [code]<!--
    field location
    -->[/code]
    Below there is where I put the new code.  Mine looks like this:
    [code]- <xsl:choose>
    - <xsl:when test="location='' and ($editmode='create')">
    - <xsl:choose>
    - <xsl:when test="./xf:ValidationError/@tagname='location'">
    - <input name="location" size="30" type="text" class="urEdfiTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="tabindex">
    - <xsl:choose>
      <xsl:when test="$accessibilitymode='true'">21</xsl:when>
      <xsl:otherwise>3792</xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:when>
    - <xsl:otherwise>
    - <input name="location" size="30" type="text" tabindex="3792" class="urEdfTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:otherwise>
      </xsl:choose>[/code]
    I put the <xsl:attribute name="readonly"> in both places (when test, and when not test).  I'm not entirely sure if that's necessary, but that worked for me.
    Hope this helps,
    Fallon

  • JDeveloper 12.c - Entity Object Transient Attribute Behavior

    Hi
    Just wondering if the following behaviour is the expected one for a new attribute in an Entity Object;
    The only way to be allowed to write an expression as default value is if the attribute itself is persistent. If transient is selected, the only available option for default value is SQL. So I need to put as persistent momentarily while writing my expression and then change it to transient.
    Regards

    Hi,
    no, this is not intended. If you have a support contract or internal access to the bug database, please file a bug
    Frank

  • View Object transient query object question

    One of the view object attribute is based upon a sql query as follows:
    Select count(*) from TABLE where TABLE.customer_id=<The customerId in each column returned>
    How do I configure this transient attribute?
    Thanks.

    Not sure what the exact requirement of this functionality is, but you can also get the size of the result by coding up something similar to the following:
    Build a generic read only vo with the sql like:
    select * from Employee
    Now use either ViewCriteria based search, bind variable or findByKey() method to filter for targeted match. for example using the programmatic bind variable method:
    ViewObject employeeVo= findViewObject("EmployeeVo");
    employeeVo.setWhereClause("ID=:id");
    employeeVo.defineNamedWhereClauseParam("id", null, null);
    employeeVo.setNamedWhereClauseParam("id", someid);
    employeeVo.executeQuery();
    long numberOfMatches = employeeVo.getEstimatedRowCount();
    Hope that helps.
    -Z

  • Runtime error with column default value settings

    I have one SP2010 (enterprise) document library which gives me a runtime error if I click on "column default value settings" in the settings. Other document libraries' column default value settings are working fine. I use managed metadata
    and created libraries from templates. I deleted all custom columns from the site, only title is left over (content types are document and link to a document) but runtime error still shows up. How can I fix this?
    Server Error in '/' Application.
    Description:
    An application error occurred on the server. The current custom error
    settings for this application prevent the details of the application error from
    being viewed remotely (for security reasons). It could, however, be viewed by
    browsers running on the local server machine.
    Details: To enable
    the details of this specific error message to be viewable on remote machines,
    please create a <customErrors> tag within a "web.config" configuration
    file located in the root directory of the current web application. This
    <customErrors> tag should then have its "mode" attribute set to
    "Off".
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
    Notes:
    The current error page you are seeing can be replaced by a custom error page by
    modifying the "defaultRedirect" attribute of the application's
    <customErrors> configuration tag to point to a custom error page
    URL.
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
    Runtime Error

    Thanks for your suggestions. I found the log but don't know what it means. Can anybody help?
    System.ArgumentOutOfRangeException:   startIndex cannot be larger than length of string. Parameter name: startIndex  
      at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length,   Boolean fAlwaysCopy)
      at   Microsoft.Office.DocumentManagement.MetadataNavigation.PerLocationViewManager.HumanReadablePath(SPList   list, Guid fieldId, String uniqueNodeId, String pathDelimiter)
      at   Microsoft.Office.Server.WebControls.MetaDataNavTree.TreeViewDataBound(Object   sender, EventArgs e)
      at System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e)
      at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect()
      at   Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationContext.OnTreeViewLoad(SPTreeView   spTreeView)
      at Microsoft.Office.Server.WebControls.MetaDataNavTree.PerLocationPageLoad()
      at   Microsoft.Office.DocumentManagement.Pages.ColumnDefaultsPage.OnLoad(EventArgs   e)
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Page.ProcessRequestMain(Boolean   includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

  • 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)

  • View Object New Attribute Setting Expression

    I am trying to create a new attribute in a View Object. I wish to have the attribute contain some strings and fields (like dashes between other fields).
    Simple concatenation works fine:
    YEAR||SEQ||TYPE -- this works!
    When I try to add the dash using the wizard like this:
    YEAR||'-'||SEQ
    I get an error in the SQL query and the following appears in the view.xml file:
    YEAR||#39;-#39;||SEQ -- left out & so the #39 would post
    I am considering creating an new table in Oracle, but this would be easier if it is possible.
    I am using JDeveloper 9.0.3 and Oracle 9iAS on Windows 2000.
    I have tried several ways to get the dash in the new attribute like "-", but the wizard will not cooperate and editing the file directly didn't work either.
    Any ideas would be appreciated.

    Hi Timo,
    Thank you very much for the explanation and direction. I will do that way. I have found that implementing view object and view row class I could do the similar kind of thing for the transient attribute.
    public Number getTotalPoints() {   
    RowIterator con= getConnectionViewImpl();
       Number sum = new Number(0);
       while (con.hasNext()) {     
          sum = sum.add( (Number)con.next().getAttribute("Points"));
        }    return sum;
      } took form
    http://technology.amis.nl/blog/1295/creating-a-dynamic-ajax-column-footer-summary-in-a-table-component-using-adf-faces
    But it also slow as 1 st method
    I am wonder whether both ways behave as similarly or they are totally different implementation?

  • Apex_item select list to be displayed with multiple default values

    I am using APEX 4.2.
    For one of our requirements , we are displaying a report which uses "apex_item.select_list_from_query" multiselect field.
    The above function accepts a parameter, 'p_value' using which we can specify the default value to be highlighted.
    Is there any way to highlight multiple values on the select list by default, when the page is loaded, based on a sql output.
    Sample Scenario:
    Say colour is a multiselect field. Full list of values available : R, B, G, Y, O
    On day1, for record1 i am choosing R and B. which I am saving in the backend when the page is submitted.
    On day2 : I login again to see the report. When the report is loaded, I should see the values 'R' and 'B' highlighted or in a different font format , differentiated from the rest.
    Thanks in advance for your replies.
    Regards,
    Raasi
    Edited by: 878815 on Mar 11, 2013 10:23 PM

    878815 wrote:
    I am using apex_item.select_list_from query. and then a piece of javascript to concatenate as a colon delimited string. This is the function I am using in the report sql,
    apex_item.hidden(20,null)||apex_item.select_list_from_query(6,null,'<sql>','multiple size = "6" onChange="Multi(this)"','NO' ) as col_1I think 'multiple size' is a custom attribute and APEX have no clue about it.
    javascript code:
    function Multi(p_this)
    var l_selected=html_SelectValue(p_this);
    if (l_selected.constructor == Array) l_selected=l_selected.join(':');
    p_this.parentNode.firstChild.value = l_selected;
    return l_selected;
    };What is this apex_item.hidden used for.. placeholder?
    May be populate the hidden item with default value as colon delimited string and on page load use some JavaScript to read that string and set/highlight the select list.
    It would be easy if you can replicate the issue on apex.oracle.com

  • Getting a View Object Total Attributes

    Hi, Is there any way to retrieve the Attribute count (DataBase Columns) of a View Object in its own java implementation?
    I'm using this:
    JDev 11.1.1.6
    System.out.println("this.getEntityDef(0).getAttributeCount() " + this.getEntityDef(0).getAttributeCount());
    System.out.println("Column count1 " + this.getAttributeCount());
    System.out.println("Column count2 " + this.getAttributeDefs().length);
    System.out.println("Column count3 " + this.getProperties().size());
    but none of them works the best way:
    the first one gives me 6 more than the actual columns that excist in the entity object
    the second and third are gives me more than the attributes of that object
    the forth gives me 200 and more
    which way gives me the count of the database table columns, and how can I access it in by index?
    thanks

    - Here is modified code, which prints attribute name along with database column name the attribute represents:
    public int getCountOfPersistentAttrs() {
            int result = 0;
            for (AttributeDef attr : getAttributeDefs()) {
                if (attr.getAttributeKind() == AttributeDef.ATTR_PERSISTENT) {
                     System.out.println("Name of persistent attribute : " + attr.getName());
                     System.out.println("Name of the database column the attribute represents : " + attr.getColumnName());
                     result++;
            return result;
        }

  • Prompts with dynamic default values

    I have a request from my client to modify several reports so that two date prompts will have default values populated with the first and last day of the previous month.  All of the reports are currently using custom sql so I have to be able get the dynamic default value in the extended @prompt syntax.  However, I am not able to use any of the sql functions since the functions merely appear as plain text as the default value itself. 
    I have found a few work arounds to achieve the functionality of the dynamic prompts, but I cannot get the actual default value displayed to the user to be dynamic.  Is it possible to achieve this by using only the custom sql?

    Hi Sandeep ,
    Below blog may answer your query .
    Dave&amp;#8217;s Adventures in Business Intelligence &amp;raquo; Dynamic Dates Part III: Monthly Date Ranges
    Search for And for Last Month?

  • How to create a view object and attach with extended AM

    Hi,
    I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one).
    Now i want to know how to create a view object similar like seeded one but with one additional condition in the where clause.
    It is possible though extension, but i want to create two view object similar like seeded one, one with some other condition in the where clause
    and another one with some other condition.
    So for my requirement, i'll extend one VO and i'll add my condition but how to do it for second condition.
    But i want same seeded VO with two different condition.
    Any suggestions please,
    SAN

    SAN,
    There is no need to attach the newly created VO with extended AM. You need to attach the same with the standard AM.
    Regards,
    Gyan

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

Maybe you are looking for