Expert Mode of View Objects

Hi!
Whenever I try to execute my query in expert mode,
I'll receive an "INVALID COLUMN" exception.
FYI: I add a regular, valid expression to my where-clause in a public method of my view object implementation (using setWhereClause or addWhereClause).
Looking at the debug output I realized that BC4J constructs the following invalid statement at runtime:
SELECT * FROM (SELECT ....)
This is really strange, because within the view object wizard everything works fine.
Does anyone have any idea how to solve this (using JDev 9.0.3.3)?

Two questions.
1. Do you get a "valid query" response when you check the query in the view object dialog?
2. Can you post the .addWhereClause() statement you are using in addition to the query itself?
I have gotten the "invalid column" message before when I was adding a where clause programatically due to the naming of the column. More specifically, in my case, I was providing the column name I set up in the view object but it needed a specific format. I believe it was "getColumnNameForQuery()" function of an attribute iterate object in JSP but I'm sure the format is the same.
The format ended up being the table alias defined in the query and the column name uppercase. EG.
SELECT THISCOLUMN
FROM THIS_TABLE THISTABLE
the query format was THISTABLE.THISCOLUMN
Hope this helps!
~Rob Lundeen

Similar Messages

  • How to Set Distinct SQL Clause on View Object without using Expert Mode.

    Hi to all Actually i have a View Object usign 3 entities
    if i use expert mode in my VO, it generate
    QRSLT WHERE
    instruction and force to include all columns on my dynamic where clause on select statement i can't include columns because get me duplicate rows
    How i can include disctinct clause without usign expert mode or any other solution?
    Note that in normal mode without expert mode QRSLT WHERE is not generate and all work fine
    For example
    select * ( select id , name from table) QRSLT WHERE loc = ..
    if i use expert mode it generate QRSLT WHERE and if loc is not predicated colums get me and error :
    ( ORA-00904: invalid identifier )
    in simple mode of View Object all work fine..
    Any suggestion on It will be appreciate.....
    Tnx

    My problem is that when use expert mode
    it's change simple select statement for a select that use
    select * from (select column....)
    qrslt WHERE (column=somevalue)
    this kind of select force me to include all where conditions of qrslt on my select columns and this get duplicate rows
    thats beacuse i need include distinct without use expert mode
    Anny Help on this?

  • Some questions about cretion ORg structure in Expert Mode

    Hai,
       Request to kindly clarify my queries
      1.  How to give relationship between positions& also between org unit in Expert mode?
      2.  what exactly should i select from job catalouge inorder to define the relation.
      3.where can i check my specified relation?
      4. Is there any  difference between Reporting & Relationship?
      regards
      Dileep

    Hi,
    1. Go to Expert mode, po13, enter the Position id and click the Object infotype, then click the button change, then you can change the name of the Position.
    2. Under the Expert Mode.
    3. Yes, ofcourse, then only the corresponding position will inherit the task.
    4. Select the Job from the Expert Mode, select the relationship infotype and select the task.
    5. under the Expert mode to add the task to the catalog.
    6. Object Description is IT1002. Maintain that through Expert mode for your object.
    <b>Reward</b> points are always appreciated and will motivate to contribute.
    Good Luck
    Om

  • Expert mode query in View objects and appended where clause

    My company is Oracle Member Partner and we are developing enterprise web applications using Oracle database and BC4J.
    I have the following problem...
    When I enable EXPERT MODE option in View Object I have trouble appending to query statement in my client code.
    I need expert mode because I must use "SELECT DISTINCT" insted of "SELECT" in my query.
    It looks something like this:
    viewObject.setWhereClause("CLA_ID = " + claId);
    viewObject.executeQuery();
    SQL query from View Object becomes sub-query and fails to execute:
    select * from (original view object query) where (... appended where clause)
    Order by part of the query causes sql errors because original query is now sub-query.
    Is there any way around this?

    I tried creating an expert mode SQL query:
    SELECT DISTINCT EMPNO, ENAME FROM EMP.
    Then at runtime I do:
    vo.setWhereClause("ENAME LIKE '%'||?||'%');
    vo.setWhereClauseParam(0,'A');.
    and this works fine. The trick is that since expert-mode view objects get wrapped as inline views (to allow runtime appending of WHERE clause, actually), you need to select any column in the select statement to which you want to later refer in a dynamically-appended where clause.
    If you want to prevent the inline-view wrapping, you can write the following code in your view object's ViewObjectImpl subclass to force the VO to NOT be treated as an expert-mode SQL VO.
      // Goes in your view object impl subclass
      public void create() {
         // Force this VO to NOT be treated as an expert-mode SQL, so that
         // its query does not get wrapped as an inline view.
         getViewDef().setFullSql(false);
      }I used this trick above to create an expert mode query like:
    SELECT DISTINCT deptno FROM empand then at runtime I add a dynamic where clause that refers to a column
    in EMP that is not in the select list like this:
        ViewObject vo = am.findViewObject("View1");
        vo.setWhereClause("ename like '%A%'");
        vo.executeQuery();
        System.out.println(vo.first().getAttribute(0));and this causes the query to come out as:
    SELECT DISTINCT deptno FROM emp WHERE ename like '%A%'.
    instead of:
    SELECT * FROM (SELECT DISTINCT deptno FROM emp) QRSLT WHERE ename like '%A%'which would cause an error due to the fact that ename is not in the select list of the original (wrapped, inline) query.

  • ER: JDev 10.1.3 needs a different method to verify expert mode view objects

    I am attempting to use ADF against Firebird 1.5. So far I am having great luck, especially in comparison to JDev 10.1.2. However, one thing that does not work is expert mode view objects. The problem is that JDev attempts to validate my query by creating a statement like this...
    SELECT * from (my expert mode query) QRSLT where 1=2
    ...and such a statement is not valid in Firebird. I would recommend that a new method of validation is required when the connection type is "Third Party JDBC Driver."
    Thanks.

    I've filed bug# 5074332 to track getting this looked into. thanks for reporting it.

  • Extending View Object expert mode greyed out

    Hi,
    I am trying to extend the View Oject oracle.apps.irc.offers.server.IrcOfferSearchVO. While extending the expert mode check box is greyed out and I can't change the SQL. I wanted to add a table in the from list and add an extra where condition using the added table.
    Can you please help me how can I extend the view object if the expert mode is greyed out.
    Thanks,
    HC

    Hi Pratap,
    When I select Edit the seeded VO IrcOfferSearchVO, I received the below message.
    Warning: There are java errors for this object. The wizard will be read-only until they are corrected.
    file:/C:/..../myprojects/oracle/apps/irc/offers/server/IrcOfferSearchVORowImpl.java
    file:/C:/..../myprojects/oracle/apps/irc/offers/server/IrcOfferSearchVOImpl.java
    Its not allowing me to set the expert mode for the seeded VO.
    Thanks,
    HC

  • View Link with destination VO in expert mode

    I have view link with the destination View Object in expert mode for applying a custom query.
    The view link doesn't run nicely because it seems to never find the right table.
    Does anyone manage to create this kind of view link based on a custom query in the destination VO?
    Thanks
    Olivier.

    Hi,
    I had also the same problem, I needed to query two tables which are in a Master-Detail relationship, the only way to do this is to write a new bean, extendind the FindForm bean to make a query like this:
    select * from mastertable where condition4mt and pk_mastertable in ( select fk_pk_mastertable from detailtable where condition4dt)
    So after this you get a pointer in the master table, but your condition to the detailtable is not considered from the ViewCurrentRecord Bean. I didn't go further to extend the ViewcurrentRecord bean, because this solved my problem, besides I think it would be also very difficult.
    JDevTEAM !!! are you planing to solve this king of problem ???
    I know that I can force the VO.setWhereClause() to force some condition on the detail, but are you planing to extend the ViewCurrentRecord bean to have also a master-detail view with a restriction also on the detail table ???
    TIA,
    Seb.

  • View Object is invalid due to SYSTEM.MODE is not recognized inside SQL

    Hi All,
    I tried recreating a Oracle form 9i to ADF BC using Jheadstart 10.1.3.3.81, JHS converted the form(converted .xml) generating the Entity and View Objects.
    But among the generated View Objects few are invalid due to which the generated .jspx page is partial in result compared to Original form.
    I have pasted the SQL generated from one of the View Object which is invalid. I tried fixing this SQL from SQL Navigator but I get Invalid function error for SYSTEM.MODE and Not an Object or REF for :INSHST.FACILITY_ID. Can anyone help me out in fixing this Issue?
    SELECT VSLHST.LAST_UPDATE_LOGIN,
    VSLHST.LAST_UPDATE_DATE,
    VSLHST.LAST_UPDATED_BY,
    VSLHST.CREATION_DATE,
    VSLHST.CREATED_BY,
    VSLHST.POST_VOLUME,
    VSLHST.POST_LEVEL_PERCENT,
    VSLHST.POST_TEMPERATURE,
    VSLHST.POST_GAS_PRESSURE,
    VSLHST.POST_LEVEL,
    VSLHST.EQUIPMENT_ID,
    VSLHST.EQUIPMENT_INSTALLATION_ID,
    VSLHST.EQUIPMENT_FACILITY_ID,
    VSLHST.INSTALLATION_HISTORY_ID,
    VSLHST.INSTALLATION_ID,
    VSLHST.FACILITY_ID,
    VSLHST.VESSEL_HISTORY_ID,
    (select DSP_DI_WATER_VOLUME
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_DI_WATER_VOLUME,
    (select DSP_UNIT_OF_MEASURE
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_UNIT_OF_MEASURE,
    (select DSP_CAPACITY_QUANTITY
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_CAPACITY_QUANTITY,
    (select DSP_DI_FULL_LEVEL
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_DI_FULL_LEVEL,
    (select DSP_DESCRIPTION
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_DESCRIPTION,
    (select DSP_DI_VESSEL_NUMBER
    from (SELECT EQU.EQUIPMENT_CODE L_EQUIPMENT_CODE,
    EQU.DESCRIPTION DSP_DESCRIPTION,
    EQ.FACILITY_ID L_FACILITY_ID,
    EQ.INSTALLATION_ID L_INSTALLATION_ID,
    EQ.EQUIPMENT_ID L_EQUIPMENT_ID,
    EQ.DI_VESSEL_NUMBER DSP_DI_VESSEL_NUMBER,
    EQ.EQUIPMENT_CODE DSP_EQUIPMENT_CODE,
    EQ.DI_FULL_LEVEL DSP_DI_FULL_LEVEL,
    EQ.CAPACITY_QUANTITY DSP_CAPACITY_QUANTITY,
    EQ.UNIT_OF_MEASURE DSP_UNIT_OF_MEASURE,
    EQ.DI_WATER_VOLUME DSP_DI_WATER_VOLUME
    FROM CP_EQUIPMENTS EQ, CP_X_EQUIPMENT_TYPES EQU
    WHERE (((:SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_QWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_QWC_END VSLHST.EQ */
    )) OR ((NOT :SYSTEM.MODE = 'ENTER-QUERY') AND
    ( /* CG$MDTU_VWC_START VSLHST.EQ */
    (EQ.facility_id = :INSHST.FACILITY_ID and
    EQ.installation_id = :INSHST.INSTALLATION_ID and
    (EQ.installed_date <= sysdate and
    (EQ.removal_date is null or
    EQ.removal_date >= sysdate) and
    (EQ.stop_fill_date is null or
    EQ.stop_fill_date >= sysdate))) /* CG$MDTU_VWC_END VSLHST.EQ */
    AND EQ.EQUIPMENT_CODE = EQU.EQUIPMENT_CODE
    ORDER BY L_EQUIPMENT_CODE) LOVQUERY
    where 1 = 1
    and LOVQUERY.L_FACILITY_ID = VSLHST.EQUIPMENT_FACILITY_ID
    and LOVQUERY.L_INSTALLATION_ID = VSLHST.EQUIPMENT_INSTALLATION_ID
    and LOVQUERY.L_EQUIPMENT_ID = VSLHST.EQUIPMENT_ID) AS DSP_DI_VESSEL_NUMBER
    FROM DI_VESSEL_HISTORIES VSLHST
    WHERE exists
    (select 1
    from CP_EQUIPMENTS EQ
    where (VSLHST.EQUIPMENT_FACILITY_ID = EQ.FACILITY_ID)
    and (VSLHST.EQUIPMENT_ID = EQ.EQUIPMENT_ID)
    and (VSLHST.EQUIPMENT_INSTALLATION_ID = EQ.INSTALLATION_ID)
    and EQ.FACILITY_ID = :b_INSHST_FACILITY_ID
    and EQ.INSTALLATION_ID = :b_INSHST_INSTALLATION_ID
    and (EQ.INSTALLED_DATE <= sysdate and
    (EQ.REMOVAL_DATE is null or EQ.REMOVAL_DATE >= sysdate) and
    (EQ.STOP_FILL_DATE is null or EQ.STOP_FILL_DATE >= sysdate)))
    Thanks In Advance,
    --Muniraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

    Muniraj,
    System.mode is forms specific, the Forms2ADFGenerator should convert this part of the SQL statement and put it between brackets.
    For references to block.item, it creates bind variables. Apparently, that did not happen. Can you send the <form_name>_
    extracted.xml file that is located in the root Java source direvtory of the model project to [email protected]?
    Thanks,
    Steven Davelaar,
    JHeadstart Team.

  • View in expert mode shows following on the bottom PHOTO BIN, TOOL OPTIONS, UNDO, REDO, ROTATE, LAYOUT ORGANIZER how do i remove this?

    Adobe Photoshop Elements 11. When in EXPERT MODE i get the following  on the bottom PHOTO BIN, TOOL OPTIONS, UNDO, REDO, ROTATE, LAYOUT ORGANIZER how do i remove this?

    Sorry, but you don't. That's part of the way adobe changed PSE starting with PSE 11. If you don't like it, you can leave feedback here:
    Photoshop Family Customer Community

  • Refreshing the screen using a View Object

    Hi Experts,
    Here is my requirement.
    I have a View Object which queries the database and displays the results.
    So I want to my VO to be executed when I click on Refresh button.
    How can I achieve this?
    Is there any example for this?
    Thanks in advance

    I think the mistake u did is populating the collection/entity of your custom view in some other place rather than on_new_focus method of the context class. So when u first time come to the view, it is calling your custom code and populating your custom view. But when u click new, it is not executing that method and it is not refreshing. on_new_focus is called everytime
    you change to new or open in edit mode..that method should be declared as event handler method..
    Move your code to the on_new_focus method of the particular context node. see standard codes how that is created and used...
    e.g. you can see the component/view BT112H_SC/Details, context node BTPARTNERSET and method CREATE_BTPARTNERSET of CL_BT112H_S_DETAILS_CTXT of how it is used.

  • Error in Creation of a New View Object from Existing Entites

    I define a Complex JOIN in the expert mode of the View Object Creation Mode. On trying to access the VO, the system returns an error, unable to creat View Objecy.
    THe SQL Statement begins with
    SELECT * from ( select ...My actual Query)
    Is it possible to define ur own view objects with the same flexibility as the Data Tables

    Hi Saket,
    Following will be required for created a custom business object.
    1. Object Type - ZTEST (Internal Techincal Key)
    2. Object Name - ZTESTNAME (Technical Key Name)
    3. Name - TEST (Name of BO, it is used while selecting the object type)
    4. Description - (Short Description of BO)
    5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
    6. Application - A or B.. etc (Area to which your BO is related)
    Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
    Regards,
    Gautham Paspala

  • Decode statement in Select line of a View Object Query

    I attempted to create a view object in expert mode with a customized query.
    The query had a decode statement in the select line of the query. The view
    object compiled correctly but gave an error when run.
    ex: select .... decode(CrpSchools.SCHOOLS_ID,null,CrpCustSchools.SCHOOL_NAME,CrpSchools.SCHOOL_NAME) SCHOOL_VALUE, ...
    from ....
    where ....
    The error was that school_value does not exist in the statement. I got the error when
    doing a vo.executeQuery().
    When I removed the decode statement everything worked correctly. Does anyone know if
    the decode statement cannont be used in the select line of a query in a view object?
    Or maybe I was linking the query column (SCHOOLS_ID) up to the view attribute (SCHOOL_VALUE) incorrectly in the
    Attribute Mappings tab of the VO wizard?

    There should be no problem using a DECODE() statement, provided that you've aliases the column as you have done.
    At design time, if you click on the (Test) button, does your query test ok?
    Are you by chance applying a custom where clause at runtime?
    If so, are you saying:
    setWhereClause("yourtable.column_alias = ?";
    or are you doing:
    setWhereClause("column_alias = ?";
    for an expert-mode query, you'll need to use the latter syntax.

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

  • Changing the query on a view object

    I have a view object right now, based on an entity. It is the default view object, so that means the query in the view object is straight forward, it grabs all of the attributes from the table. And there is no WHERE clause.
    In reality I only want to show a finite set of rows from my table. Every time a record is changed/edited in this entity and committed, a new row in the database is created with the same information (I'm using CreateWithParams) except for a few columns.
    I actually don't really have update on this table, just creation of new rows. But to the user, I want it to 'look' like they are editing something in the table.
    Example:
    12, 11:32,Thompson, 60 (the user edits this information in an adf table, and a new row is created in the db)
    12, 11:55, Thompson, 75
    I have a timestamp (see above) field in the database that is used as part of my primary key, so that I know which record is the latest.
    When the VO query is run, I want the user to only see the latest row from the db.
    12, 11:55, Thompson, 75
    So...
    I went to my VO, and I changed the WHERE query to add this:
    where t1.TimeStamp = (Select MAX(t2.TimeStamp) FROM rcl.x t2 where t1.uid = t2.uid);
    Now, this isn't a mysql/sql question. There's actually a better query that I'd rather run, but the VO editor doesn't allow me to change the query itself....
    When I save the new WHERE to my VO, run my page again, I get the expected result (showing me only the latest records).
    However, when I try and sort on the table in which my data is displayed, I am now getting ORDER BY errors.
    I don't want my VO to be read-only sql based. I want to be able to update my table, so I have my VO running off of the entity.
    Why doesn't the VO allow me to change the query itself? (Like do a subquery, instead of having my where clause do the work)
    Why are order by errors being thrown when I sort on my adf table after changing the where clause in my view?
    Hopefully I wasn't too convoluted in the explanation of my problem..
    Thanks in advance,
    Joel

    HI Joe,
    Regarding your problem you can do one of the following tasks:
    1- easily to tuning on your view object, I mean in the tuning page of the view you can set that only return 1 record or 2-3 record fetch not all the record.
    in the order by you will order by the timestamp field and descending.
    2- you can order by the timestamp descending and in the where clause only set the rownum<2 (will return the last record) you can also set rownum<5 and get the 4 last record etc.
    3-editing the view query in the expert mode is not advised at all because of many consequences that you will face.
    4- maybe it is not bat that you add a readonly view for the table you mentioned and every time you unpdate the entity just re-execute the read-only view.( this method maybe is good maybe is not it depends on your business logic)
    Regards.
    Edited by: Amir Khanof on Sep 3, 2010 11:11 PM

  • Normal Mode vs Expert Mode

    Today I have found something really weird, that I would like to know if anyone knows the reason.
    I have a programmatic View Object with a transient attribute rendered as an InputListOfValues. This attribute has a related read-only View Obect which displays the LOV content. A few days ago I disabled the Application Module's pool in order to test the passivation, and since then everytime I opened the LOV, selected a row and clicked on the OK button I got this error:
    SQL error during statement preparation. Statement: SELECT SupVendors.VENDOR_CODE, SupVendors.VENDOR_NAME, SupVendorsPerDonorCenter.DONOR_CENTER_ID, SupVendorsPerDonorCenter.ROWID, SupVendorsPerDonorCenter.VENDOR_CODE AS VENDOR_CODE1 FROM SUP_VENDORS SupVendors, SUP_VENDORS_PER_DONOR_CENTER SupVendorsPerDonorCenter WHERE (SupVendors.VENDOR_CODE = :fbkKy__0)
    For an unkown reason, when copying the selected row's values to the programmatic VO, ADF replaced the original name of the bind variable in the query for this "fbkKy__0". Plus, the where clause has another condition before the bind variable's one, which does not appear in the error message. I wasn't able to understand why this happened so I checked everything in both programmatic and LOV ViewObjects, but everything was fine. Today I have noticed that the LOV VO had the query in Normal mode (which is OK, or at least it should) and I have switched it to Expert Mode, just to try something different. Well, the fact is that this has automatically solved the problem and now the LOV is working fine again! And if I set it back to Normal Mode, it crashes again.
    How can the query's editing mode can have any effect in runtime? I have to suppose this has some relation to the disabled pool and the passivation I am testing, but I cannot figure out why. Does anyone know what's happening?
    Thank you in advance!

    I have been doing some testing in a dummy application, and I can say this happens with any kind of View Object (it does not need to be programmatic, and the LOV attribute can be entity based) in both forms and tables. The only conditions are to disable the Application Module's pool and that the LOV's query includes a bind variable. Oh, and I forgot to say that I am working with JDeveloper 11.1.1.2.

Maybe you are looking for