Impossible when setting header a Where Clause in ViewImpl.java

Hello

I have no application of the ADF with header lines Vo link display and association and developed a method in HeaderViewImpl.java and made the shuttle in the interface client view and I ask that when loading the page through the links page-> executable files, but it gives error

'Impossible '.

When the page runs, cannot understand why it gives an error? no idea please.

Kind regards

Peyrot

Peyrot,

What you are calling the same method inside. Who will end up in an infinite loop.

The code must be

public void setWhereClause(String InqNumber){
       super.setWhereClause("PERCOSTING_NUMBER =2 ");
}

I don't understand the use of this method.

Why must you this method? Where do you call it?

See you soon

AJ

Tags: Java

Similar Questions

  • Need a set or a where clause

    SELECT
    C.CUSTOMER_NUM,
    C.CUSTOMER_NAME,
    C.STREET,
    C.CITY,
    C.STATE,
    C.ZIP,
    C.BALANCE,
    C.CREDIT_LIMIT,
    C.REP_NUM,
    (CREDIT_LIMIT - BALANCE) AVAILABLE_BALANCE,
    (SELECT First_Name |) » '|| Last_name FROM PP_REP WHERE REP_NUM = C.REP_NUM) REP_NAME
    OF PP_CUSTOMER C
    WHERE C.REP_NUM =: P3_REP_NUM;

    I need to change the place where clause in the order so that if - 1 is received it displays all PP_CUSTOMER, but if it receives any other REP_NUM it displays PP_CUSTOMERS with this REP_NUM.

    I tried a lot of solutions to the frustrations.

    Hello

    Try this:

    SELECT
     C.CUSTOMER_NUM,
     C.CUSTOMER_NAME,
     C.STREET,
     C.CITY,
     C.STATE,
     C.ZIP,
     C.BALANCE,
     C.CREDIT_LIMIT,
     C.REP_NUM,
     (CREDIT_LIMIT - BALANCE) AVAILABLE_BALANCE,
     (SELECT First_Name||' '||Last_name FROM PP_REP WHERE REP_NUM = C.REP_NUM) REP_NAME
     FROM PP_CUSTOMER C
     WHERE C.REP_NUM = decode(:P3_REP_NUM, -1, C.REP_NUM, :P3_REP_NUM);
    

    Kind regards
    Dirk

  • Setting in the WHERE clause of the query

    Hi all

    I have 2 tables.

    TABLE_A contains 10 million documents.
    TABLE_B contains 100 records.

    I associate myself with these 2 tables

    Here's a.ID left
    SELECT A.*, B.*
    FROM TABLE_A a, TABLE_B b
    WHERE a.ID = b.ID;
    Here's b.ID left
    SELECT A.*, B.*
    FROM TABLE_A a, TABLE_B b
    WHERE b.ID = a.ID;
    My question is what query will give better performance? I thought that, if we put the column in the table with a lower number of lines on the left, then it will be faster than the other.

    In current versions of Oracle, it does not matter in what order you sum-up your predicates in the WHERE clause of a query: they will be optimized/executed in a way even.

  • Difference in WHERE clause VO and java class!

    Hello!

    I have VO:
    SELECT ADokumenti.A_DOKUMENTI_PK, 
           ADokumenti.APRAKSTS, 
           ADokumenti.DOKUMENTA_TIPS, 
           ADokumenti.DOKUMENTS, 
           ADokumenti.FAILA_VARDS, 
           ADokumenti.PASES_DATI_ID, 
           ADokumenti.PIEVIENOSANAS_DATUMS
    FROM A_DOKUMENTI ADokumenti
    WHERE ADokumenti.DOKUMENTA_TIPS = 'image/jpeg' or ADokumenti.DOKUMENTA_TIPS = 'image/gif' or ADokumenti.DOKUMENTA_TIPS = 'image/png'
    When I put the value of VO in java class
     vo.setWhereClause("A_DOKUMENTI_PK="+imageId); 
    WHAT result would be? Only java put where clause, or both?

    If one clause of java, and then how to add this: «A_DOKUMENTI_PK = "+ imageId vo?»

    Best regards, Debuger!

    Debuger,

    That's why I suggested that you create a view named criteria (with a variable binding) at design time. At runtime, you set the value of the variable binding and apply the criteria to view. The first link in the documentation I gave explains you quite well.

    You must use bind variables for five reasons:

    (1) performance
    (2) performance
    (3) performance
    (4) performance
    and
    (5) performance.

    Oh and

    (6) avoid errors of insufficient memory in the shared the database pool.

    John

  • Need help with CASE When statement in a Where Clause

    So I have a SQL (simplified for this forum)

    Select t1.*
    from table1, table2 t2 t1
    where t1.field1 = t2.field1
    and when t1.field2 is null then trunc (sysdate) < = trunc (t1.date1 + 17)
    of another trunc (sydate) > = end of trunc (t2.date2 + t2.date3)

    I end up getting an error ORA-00905: lack of keyword

    I'm sure that I just got something here involved.

    You can not make the comparison within the statement underlying case like this. Assuming you have appropriate data types, something like this should work

    Select t1.*
    from table1 t1, table2 t2
    where t1.field1 = t2.field1
      and ((t1.field2 is null and
            trunc(sysdate) <= trunc(t1.date1 + 17)) or
           trunc(sydate) > = trunc(t2.date2 + t2.date3))
    

    John

  • using case when statement or decode unfavorable in where clause

    Hi the gems...

    I have a problem in the following query...
    I try to use when case statement in where clause of a select query.


    Select cr.customer_name. ' - ' || CR.customer_number as cust_name,
    CR. Salary salary
    of customer_details cr
    where (case when ' > ' = ' > ' then ' cr.salary > 5000')
    When ' > ' = ' < ' then ' cr.salary < 5000'
    When ' > ' = '=' and then 'cr.salary = 5000'
    Another null
    (end);


    the expression in the when clause of the statement of the case, when comes from HQ and according to the choice I have to make the where clause.
    That is why, for the execution of the query, I put ' > ' in this place.

    If the original query will look like this (for reference):

    Select cr.customer_name. ' - ' || CR.customer_number as cust_name,
    CR. Salary salary
    of customer_details cr
    where (case when variable = ' > ' then ' cr.salary > 5000')
    When the variable = ' < ' then ' cr.salary < 5000'
    When the variable = '=' and then 'cr.salary = 5000'
    Another null
    (end);


    so, in a real case, if the user selects ' > ' then the filter will be ' where cr.salary > 5000.
    If the user selects ' < ' then the filter will be ' where cr.salary < 5000.
    If the user selects '=', then the filter will be 'where cr.salary = 5000 '.

    but I get the error "ORA 00920:invalid relational operator.

    Help, please... Thanks in advance...

    Hello

    select cr.customer_name || ' - ' ||cr.customer_number as cust_name,
           cr.salary                                      as salary
     from customer_details cr
    where (    v_variable = 'bigger'
           and cr.salary > 5000
          )
       or (    v_variable = 'less'
          and cr.salary < 5000
           )
       or (    v_variable = 'eq'
            and cr.salary = 5000
           )
    

    Published by: user6806750 on 22.12.2011 14:56
    For some reason that I can't write in sql "<', '="">", "=".

  • Where clause in the "default_where" of get_block_property is not cancelled...

    Hello

    I developed a form with two blocks.

    The first - block of non - database contains the criteria.

    Database of the other - block-displays the records according to the inserted.

    Also, there is a button that executes the query criteria.

    The code of the BUTTON WHEN PRESSED is as follows:

    declare

    v_where varchar2 (3000);

    Start

    v_where: = null;

    go_block ('EKKREMOTHTES_AIT_TSG');

    clear_block (no_validate);

    v_where: = get_block_property ('EKKREMOTHTES_AIT_TSG', default_where);

    If: blk_criteria.site_id is not null then

    v_where: = v_where |' and site_id = "'|: blk_criteria.site_id | ''';

    end if;

    If: blk_criteria.yphr_klimakio is not null then

    v_where: = v_where |' and yphr_klimakio = "'|: blk_criteria.yphr_klimakio | ''';

    end if;

    If: blk_criteria.send_date_from is not null and: blk_criteria.send_date_to is not null then

    v_where: = v_where |' and send_date between to_date('''|| to_char(:blk_criteria.send_date_from,'dd/mm/yyyy')||''',''dd/mm/yyyy'') and

    to_date('''|| to_char(:blk_criteria.send_date_to,'dd/mm/yyyy') | " (', "dd/mm/yyyy)";

    end if;

    If: blk_criteria.eq_group1 is not null then

    v_where: = v_where |' and eq_group1 = "' | : blk_criteria.eq_group1 | " ' ;

    end if;

    If: blk_criteria.eq_type1 is not null then

    v_where: = v_where |' and eq_type1 = "' | : blk_criteria.eq_type1 | " ' ;

    end if;

    If: blk_criteria.eq_group2 is not null then

    v_where: = v_where |' and eq_group2 = "' | : blk_criteria.eq_group2 | " ' ;

    end if;

    If: blk_criteria.eq_type2 is not null then

    v_where: = v_where |' and eq_type2 = "' | : blk_criteria.eq_type2 | " ' ;

    end if;

    blk_def_where ('EKKREMOTHTES_AIT_TSG', v_where);                                    / * a form routine that makes the set_block_property(<block>,default_where) * /.

    do_key ('execute_query');

    end;

    The above code works when the user inserts the criteria for the first time. Later when the user deletes certain criteria - clear criteria in the block of criteria-

    and he pushed the button of the query results are exactly the same...

    After have debugged the problem, clause v_where is not nullied (do not get the value zero) in order to get the new criteria.

    Can you identify the error?

    Note: I use Oracle Forms 10 g Db 11 g v.2

    Thank you very much

    SIM

    SIM,

    The procedure "blk_def_where" sets the block where clause by using the DEFAULT_WHERE or the ONETIME_WHERE constanct?  Gets it to the user that the same results as the DEFAULT_WHERE sets the property WHERE permanently so the second time through, the 'v_where' is NOT null.  Check your BLK_DEF_WHERE procedure and if it does not use the ONETIME_WHERE constanct, change isn't.  The alternative would be to put DEFAULT_WHERE = NULL after the call to the built-in EXECUTE_QUERY.

    Craig...

  • By using a WHERE clause in the tree APEX

    Hi all -

    I have a hierarchical SQL query that I display as a tree of the APEX.

    Here is my sample application:

    https://Apex.Oracle.com/pls/Apex/f?p=32581:29

    Login: guest

    PW: app_1000

    workspace: leppard

    I try to add a WHERE clause so that only nodes with the lowest-level children are displayed, i.e. something like "WHERE connect_by_isleaf = 0 OR level = 5'"

    The tree of query with where clause works very well in the SQL command window, but when I add the WHERE clause to my tree apex page no longer displays anything. Is this a problem with APEX or y at - it another way to filter my results?

    Thanks in advance for your suggestions,

    John

    Connect occurs in the first place, the where the provision is applied to these results, effectively cutting in the hierarchical structure. Since the apex has build a hierarchical structure of the query, it relies on the virtual level, which is butchered by applying the where clause. It's a miracle that you're not even receive errors because I expect almost an incorrect json array was built. With no top-level from and only level 5 or end nodes, there is no structure to present: the two apex cannot set a correct representation and not jstree neither. In your request, you will see your "root nodes", but it is not representable.

    I don't know why you want to present it in a tree? Levels both connect_by_is_leaf = 5 will give you everything just a list of nodes without any hierarchical structure.

    The best thing to do is to use a subquery to limit first your dataset and then use it for the basic tree query, this way you violate one of these vital columns.

    For example if you want only nodes and their immediate parent, you can opt for something like this (fast on some testdata model):

    with dataset as (
    select node_id, parent_id
       from treedata
      where connect_by_isleaf = 0
    connect by prior node_id = parent_id
      start with parent_id = 0
    ),
    dataset2 as (
    select node_id, parent_id
      from dataset
    union all
    select node_id, null parent_id
      from treedata
    where node_id in (select parent_id from dataset)
    )
    select level, node_id
       from dataset2
    connect by prior node_id = parent_id
      start with parent_id is null
    
  • Decode in where clause

    Thanks in advance

    I have table TAbleaa

    Input parameter when = 1 then my where clause is a > 1
    Input parameter when = 2 then my where clause is a < 1

    Select * from tableaa
    where (when case & 1 = 1 then a 1 >)
    When & 1 = 2 then a < 1)

    create table TABLEAA
    (
    A NUMBER,
    PLEASE THE NUMBER,
    NUMBER OF END,
    NUMBER OF TEACHER,
    AVERAGE NUMBER
    )
    ;

    Fast loading TABLEAA...
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (10, 1.5,.6,, 499, 500);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (1, 0,.1, 159, 159);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (2,.1,.2,, 159, 168);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (3,.2,.3, 179, 159);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (4,.1,.2, 250, 300);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (5,.2,.3, 320, 250);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (6,.3,.4,, 250, 380);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (7,.2,.3, 388, 379);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (8,.3,.4,, 379, 388);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (9,.4,.5, 388, 400);
    insert into TABLEAA (A, START, END, TEACHER, AVERAGE)
    values (11.5.6, 420, 448);
    commit;

    Published by: user1849 on August 26, 2009 14:32

    Select * from tableaa
    cases where when & 1 = 1 and a > 1 then 1
    When 1 = 2 & one< 1="" then="">
    end = 1

  • ViewObject where Clause SET based on logged in user roles

    Hello Experts

    I have a view object based on a custom query to get distinct values from a table. My requirement is to display the results as a listview. The listview is is filled without any problem. But I need to add a where clause clause the object view based on the user roles.

    I have a method that generates the where clause and returns one string something like "COUNTRIES ('USA', 'UK').

    I created a class of the view object Impl and put WhereClause as below: but where clause is not applied when I run the page. I see everywhere instead of just USA & UK.

    Can you let me know at what time should I set the where the clause?

    SerializableAttribute public class CountriesVOImpl extends ViewObjectImpl {}

    /**

    * This is the default constructor (do not remove).

    */

    public CountriesVOImpl () {}

    this.setWhereClause (getCountries ());

    }

    public String getCountries() {}

    return '('USA', 'UK') COUNTRIES. "

    }

    }

    In class ViewImpl try to replace "executeQueryForCollection" and setWhereClause in this function as:

        protected void executeQueryForCollection(Object object, Object[] object2, int i)
        {
            setWhereClause("COUNTRY in ('USA','UK')");
            super.executeQueryForCollection(object, object2, i);
        }
    
  • Cannot run a «BUSINESS...» WHEN ' with a date in a WHERE CLAUSE condition

    Hello

    I need to check for a condition and date according to the date, he would check a set of host names or the other game... so I thought I could write something like this in the WHERE clause:

    AND HOST_NAME IN

    (

    CASE

    WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN

    ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ON THE OTHER

    ("SERVERNAME1", "NAMESERVER2", "SERVERNAME3")

    END

    )

    I get the following:

    ORA-00907: lack of right parenthesis

    00907 00000 - "lack the right parenthesis.

    But there is no missing parentheses!

    If I take the case... when... end, and run the host_name in ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') (separately, they run fine)...

    I also tried:

    AND

    (

    CASE

    WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN

    HOST_NAME IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ELSE

    HOST_NAME IN ('SERVERNAME1","NAMESERVER2","SERVERNAME3")

    END

    )

    the error I get is:

    ORA-00905: lack of keyword

    00905 00000 - 'lack the key word'

    What keyword miss me?

    Post edited by: c75d2e42-06a0-4eb1-a576-5652edcbfbe8

    Hello

    c75d2e42-06a0-4eb1-A576-5652edcbfbe8 wrote:

    It was a typo when transferred to the Oracle forum... the version of Oracle is: PL/SQL version 10.2.0.3.0 (10 G)

    I also used IF the statement and that has not worked (in error "missing parenthesis") which I'm sure is a matter of "syntax"... I did not know that the CASE statement returns the value single only, so it's probably the problem.  Is it possible to re - write this?

    ...

    IF only works in PL/SQL.  It does not in SQL, even if that SQL is embedded in PL/SQL.

    There are many ways to re - write the condition.  And here's one:

    AND ((host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')

    AND TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")

    )

    OR (host_name IN ('servername1","Nameserver2","SERVERNAME3")

    AND TO_DATE (: StopDate, "MON-DD-YYYY")<  to_date="" ('dec-22-2015', ="">

    )

    )

    If: StopDate can be NULL, it must be a bit more complicated.

    You can also use nested, such as CASE expressions

    AND THE CASE

    WHEN TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")

    WHILE CASE

    WHEN host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')

    AND THEN 'OK '.

    END

    OTHER CASES

    WHEN host_name IN ('servername1","Nameserver2","SERVERNAME3")

    AND THEN 'OK '.

    END

    END = 'OK '.

    I wonder if this in your application is the best way, however.  If SERVERNAMEA was put into service on December 22, maybe that that fact should be recorded in a table.  If you have a table with 1 row per server, you can consider adding 2 columns DATE to show when the server was first and last used.  Then, rather than use a WHERE clause to test servers appropriate, you could do an inner join.

  • How to set a null column in a where clause clause involving a statement box

    In oracle APEX, I a (selection list) element called: P32_STATUS. It contains two values of interest (for this discussion): 'Available' and 'checked '. In my report, I have a column called vc_status that contains two values: "Checkbox" and NULL. In my application I want to use a case statement in my where clause similar to the lines of

    where

    .

    .

    .

    AND (vc_status = CASE WHEN: P32_STATUS = "Checkbox" THEN : P32_STATUS )

    WHEN : P32_STATUS = 'Available' THEN NULL END)

    The 'box' filtering works but the filtering to try to vc_status the NULL value does not work. Can someone help me? Thank you!

    (P.S. My intuition says that there because I can not put vc_status = NULL, but I must say that vc_status IS NULL... However, I don't know how to do execution IS ZERO inside a CASE statement)

    Hello

    Your intuition is right...

    In Oracle NULL is a bit special:

    NULL = NULL is false

    NULL <> NULL is false

    Thus, instead of the parameter a NULL value in the CASE WHERE there is just set a value on the other side:

    NVL (vc_statut, 'Available') =: P32_STATUS

    That's all! Simple, clean and functional

  • Execution of statement of UPDATE for the whole table even when the WHERE Clause is presentation

    Hi friends,

    I have a problem in a stored procedure where I wrote an update with a where clause clause statement. At some point only one line should be updated according to the unique identifier in where clause.

    But what is happening is that the Update statement is getting executed for all rows in the table to neglect the WHERE clause. I don't get any idea of why this is happening. Here is the stored procedure and the update statement is BOLD:-

    CREATE OR REPLACE PROCEDURE MDMADM.proc_MDM_InsertCntryDetails
    (
    CntryMasterCode IN VARCHAR2,
    CntryName IN VARCHAR2,
    MDMUser IN VARCHAR2,
    Exists IN ITS ENTIRETY,
    status in VARCHAR2,
    Inserted_By IN VARCHAR2 default NULL,
    Modified_By IN VARCHAR2 default NULL,
    Mdm_Code IN the DEFAULT NUMBER 0.
    Action in VARCHAR2 DEFAULT 'Add ',.
    XGenAttNames IN VARCHAR2 default NULL,
    XGenAttValues IN VARCHAR2 default NULL,
    MirusAttNames IN VARCHAR2 default NULL,
    MirusAttValues IN VARCHAR2 default NULL,
    GenisysAttNames IN VARCHAR2 default NULL,
    GenisysAttValues IN VARCHAR2 default NULL,
    XGenModify IN VARCHAR2 default NULL,
    MirusModify IN VARCHAR2 default NULL,
    GenisysModify IN VARCHAR2 default NULL
    )

    IS

    strSQLXGen VARCHAR (1000);
    strSQLMirus VARCHAR (1000);
    strSQLGenisys VARCHAR (1000);
    nMaxMDMCode INTEGER.
    ifExist INTEGER;

    /******************************************************************************
    NAME: proc_MDM_InsertCntryDetails
    PURPOSE:

    REVISIONS:
    Worm Date Description of the author
    --------- ---------- --------------- ------------------------------------
    1.0 03/07/2009 1. Created this procedure.

    NOTES:

    Keywords to replace automatically available Auto:
    Object name: proc_MDM_InsertCntryDetails
    SYSDATE: 03/07/2009
    Date and time: 03/07/2009, 19:11:20 and 03/07/2009-19:11:20
    User name: (put in TOAD Options, editor of the procedure)
    Name of the table: (defined in the dialog box "New PL/SQL object")

    ******************************************************************************/
    BEGIN

    COUNT (*) of SELECT INTO ifExist OF MDM_COUNTRY_MASTER;

    IfExist IF = 0 THEN
    SELECT 1 INTO nMaxMDMCode FROM DUAL;
    ON THE OTHER
    SELECT MAX (MDM_CODE) + 1 IN MDM_COUNTRY_MASTER nMaxMDMCode;
    END IF;


    IF Action = "add" THEN

    INSERT INTO MDM_COUNTRY_MASTER(MDM_CODE,MDM_MASTER_CODE,MDM_DESCRIPTION,MDM_USER,MDM_EXIST,MDM_STATUS,MDM_ACTION,DAT_INSERT_DATE,DAT_INSERTED_BY)
    VALUES(nMaxMDMCode,CntryMasterCode,CntryName,MDMUser,exist,Status,action,sysdate,Inserted_By);

    strSQLXGen: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) XGenAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    "VALUES (' |)" nMaxMDMCode | ',' || '''' || "XGen | '''' || ',1,' || XGenAttValues | ',' || '''' || Inserted_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLXGen;

    strSQLMirus: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) MirusAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    "VALUES (' |)" nMaxMDMCode | ',' || '''' || "Mirus | '''' || ',2,' || MirusAttValues | ',' || '''' || Inserted_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLMirus;

    strSQLGenisys: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) GenisysAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    "VALUES (' |)" nMaxMDMCode | ',' || '''' || "Genisys | '''' || ',3,' || GenisysAttValues | ',' || '''' || Inserted_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLGenisys;

    ON THE OTHER



    UPDATE MDM_COUNTRY_MASTER
    SET MDM_DESCRIPTION = CntryName, DAT_MODIFIED_BY = Modified_By, DAT_MODIFY_DATE = SYSDATE.
    MDM_USER = MDMUser, MDM_ACTION = Action, MDM_STATUS = status MDM_EXIST = exist WHERE MDM_CODE = Mdm_Code;




    COUNT (*) of SELECT INTO ifExist FROM MDM_COUNTRY_MAPPING WHERE SYSTEM_CODE = 1 AND MDM_CODE = Mdm_Code;

    IfExist IF = 0 THEN

    strSQLXGen: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) XGenAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    ' VALUES(' ||) Mdm_Code | ',' || '''' || "XGen | '''' || ',1,' || XGenAttValues | ',' || '''' || Modified_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLXGen;

    ON THE OTHER
    strSQLXGen: = "UPDATE MDM_COUNTRY_MAPPING SET | XGenModify | ', DAT_MODIFY_DATE = SYSDATE, DAT_MODIFIED_BY =' | '''' || Modified_By | '''' || "WHERE MDM_CODE =' | ' Mdm_Code | "and SYSTEM_CODE = 1';

    EXECUTE IMMEDIATE strSQLXGen;

    END IF;


    COUNT (*) of SELECT INTO ifExist FROM MDM_COUNTRY_MAPPING WHERE SYSTEM_CODE = 2 AND MDM_CODE = Mdm_Code;

    IfExist IF = 0 THEN

    strSQLMirus: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) MirusAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    ' VALUES(' ||) Mdm_Code | ',' || '''' || "Mirus | '''' || ',2,' || MirusAttValues | ',' || '''' || Modified_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLMirus;

    ON THE OTHER
    strSQLMirus: = "UPDATE MDM_COUNTRY_MAPPING SET | MirusModify | ', DAT_MODIFY_DATE = SYSDATE, DAT_MODIFIED_BY =' | '''' || Modified_By | '''' || "WHERE MDM_CODE =' | ' Mdm_Code | "and SYSTEM_CODE = 2';

    EXECUTE IMMEDIATE strSQLMirus;

    END IF;


    COUNT (*) of SELECT INTO ifExist FROM MDM_COUNTRY_MAPPING WHERE SYSTEM_CODE = 3 AND MDM_CODE = Mdm_Code;

    IfExist IF = 0 THEN

    strSQLGenisys: = ' INSERT IN MDM_COUNTRY_MAPPING (MDM_CODE, SYSTEM_NAME, SYSTEM_CODE,' |) GenisysAttNames | DAT_INSERTED_BY, DAT_INSERT_DATE) ' |
    ' VALUES(' ||) Mdm_Code | ',' || '''' || "Genisys | '''' || ',3,' || GenisysAttValues | ',' || '''' || Modified_By | '''' || SYSDATE)';

    EXECUTE IMMEDIATE strSQLGenisys;

    ON THE OTHER
    strSQLGenisys: = "UPDATE MDM_COUNTRY_MAPPING SET | GenisysModify | ', DAT_MODIFY_DATE = SYSDATE, DAT_MODIFIED_BY =' | '''' || Modified_By | '''' || "WHERE MDM_CODE =' | ' Mdm_Code | "and SYSTEM_CODE = 3';

    EXECUTE IMMEDIATE strSQLGenisys;

    END IF;



    END IF;



    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHILE OTHERS THEN
    -Consider recording the error and then re-raise
    LIFT;
    END proc_MDM_InsertCntryDetails;
    /


    Thank you

    >
    WHERE mdm_code = mdm_code
    >

    This will always be value true - similar to WHERE 1 = 1.

    You typed it wrong or is the same as the variable column name? If they are the same test rename one of them.

  • Question about the order of evaluation of the clause WHERE CLAUSE when the Oracle OF the syntax used to join tables

    Hello

    Oracle version: 11.1.0.7.0 - 64 bit

    I read the documentation online at joins. The page is avialable here: joins at

    My question is about the join order of evaluation of the conditions in clause and the conditions of those

    are not the join conditions and are placed in the WHERE clause.

    Consider the following pseudocode

    SELECT

    T1. Col1,

    T2.Col1

    Of

    Table1 t1 LEFT OUTER JOIN table2 t2

    WE

    (condition_expression1)

    WHERE

    (condition_expression2)

    Is it correct to say that if there is no column on the status of join (condition_expression1) in condition_expression2, then condition_expression2 is executed before condition_expression1? In other words, oracle always trying to filter based on the WHERE clause individually each table as much as possible before joining them based on the conditions on the article?

    Thanks in advance,

    Hello

    dariyoosh wrote:

    Hello

    Oracle version: 11.1.0.7.0 - 64 bit

    I read the documentation online at joins. The page is avialable here: joins at

    My question is about the join order of evaluation of the conditions in clause and the conditions of those

    are not the join conditions and are placed in the WHERE clause.

    Consider the following pseudocode

    SELECT

    T1. Col1,

    T2.Col1

    Of

    Table1 t1 LEFT OUTER JOIN table2 t2

    WE

    (condition_expression1)

    WHERE

    (condition_expression2)

    Is it correct to say that if there is no column on the status of join (condition_expression1) in condition_expression2, then condition_expression2 is executed before condition_expression1? In other words, oracle always trying to filter based on the WHERE clause individually each table as much as possible before joining them based on the conditions on the article? ...

    The reverse is actually closer to the truth, but we can't really make general statements like that.

    SQL is not a language of the proceedings.  Looking at the code SQL, we could say that the code does, but we cannot say much about how that code it.  In other words, SQL is a language that describes the results you get, not the way to get them.

    The optimizer will do everything what he thinks is faster if it does not change the results.  If any order in which they are applied (in outer joins or CONNECT BY queries, for example), then think of the join is done first, and the value of the WHERE clause is applied to the result of the join.

    Here is a query looks very much like you posted:

    SELECT d.deptno

    e.ename, e.sal

    OF scott.dept d

    LEFT OUTER JOIN scott.emp e ON e.deptno = d.deptno

    WHERE e.sal > = 3000

    ORDER BY d.deptno

    ;

    Output:

    DEPTNO ENAME SAL

    ---------- ---------- ----------

    10 KING 5000

    20 FORD 3000

    20 3000 SCOTT

    The scott.dept table contains deptnos 30 and 40; Why are they not in the result set?  The query behaves as if the outer join is made first (production 15 rows), then the WHERE clause has been applied.  All lines with deptno = 30 had sals down han 3000 and all single line with deptno = 40 was NULL in the sal column, then these lines are excluded (as well as other lines of deptnos 10 and 20), and only 3 lines above are left.

  • [ADF, JDev12.1.3] How to set a variable to bind a VO (where clause) in a managed bean?

    Hallo,

    I have a request based on VO.

    The query contains a where clause clause and a bindi variable.

    In a managed bean I would like to access the iterator of VO setting the value of the bind variable and read the result.

    I found this code it is good start, but I do not know how to set the variable binding.

    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("MyVO1Iterator");
    iter.execute();
    
    
    

    You kindly help me?

    Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.

    In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.

    Sorry if these questions may seem artificial, but I am a beginner, I have many doubts and so I would be happy to receive some tips regarding best practices.

    Thank you

    Federico

    You can use:

    iter.getViewObject().setNamedWhereClauseParam("yourBindVar", value);
    

    Note that this approach is used if you have bind variable in the where clause.

    To set variables bind to ViewCriteria, you must use VarableValueManager.

    This post may be useful for you: binary: how to set the Bind variable values at run time?

    Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.

    You must set "use VO directly.

    For example, from the point of architecture, is probably best to use the method in the model project which will set the bind variable and execute the query.

    Or you can use the ExecuteWithParams operation in your the view layer.

    In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.

    Not to complicate your life

    All VO lines are represented as ViewRowImpl class if you already have "custom class".

    Finally, you can generate your own ViewRowImpl class if it is necessary for this.

    Dario

Maybe you are looking for

  • Backups Time Machine EXTREMELY slow

    I have over 500 GB for backing up a Mac Book Pro 2.7 GHz, 16 GB of RAM. When I connect the HD 1 TB in a single day does about 40 GB means that it will take several days making the first backup. Not a problem if I do not need to use the computer. But

  • just want sections of pages

    I create a new presentation to use on my iPad.  I use old PDFs and inserting them in a page in the Pages.  In the end, I would like to create a single new PDF.  Is this possible?  I don't see the option to add a page, only items.  The insert options

  • Double layer burning fails every time - Tecra A9

    Hi all. My Tecra A9 is equipped with Teac DVW28ECT (Rev7.5A) I have no problem burning on a DVD single layer... but EVERY time I try to burn to a double layer process stops about 25% in the burning process. I can't find more recent updates of the dri

  • String to the Variable of the PSP?

    Hello I was hoping I could buid programmatically a variable path shared and then use the Reading Variable VI to read a value. Unfortunately, while I can convert a PSP Variable in a string, I can't do the reverse. The output of the string to the share

  • Card mother replecement HP2000-363NR

    I replace the motherboard of a computer 363NR HP2000 laptop i3 processor win7 (warranty 3 years old-not).  When I start it displays the following message: "invalid product information -following product information programmed into the system card is