bind variables using the values in the collection

Hi the gems... Good afternoon...

Can we not use plsql values in the collection in the USING clause to pass the bind variable values...

I wrote the procedure to kill all sessions that cross the parameter OPEN_CURSORS below. the query, I found only three sessions that exceed. But when I execute my procedure so those are not removed, execution gives me an error also. He simply executed but no session has been killed.

My part of the code is as below:
..........
..........
..........
OPEN rc FOR v_sql;
    FETCH rc BULK COLLECT
        INTO v_tt_sessions;
    LOOP
        EXIT WHEN v_tt_sessions.COUNT = 0;
        FOR idx IN 1 .. v_tt_sessions.COUNT
        LOOP
            EXECUTE IMMEDIATE 'alter system kill session '':a,:b'' immediate'
                USING v_tt_sessions(idx).sid, v_tt_sessions(idx).serial#;
        END LOOP;
    END LOOP;
CLOSE rc;
.........
.........
However, when I replace the bind variable with the values in the collection, then it works:
..........
..........
..........
OPEN rc FOR v_sql;
    FETCH rc BULK COLLECT
        INTO v_tt_sessions;
    LOOP
        EXIT WHEN v_tt_sessions.COUNT = 0;
        FOR idx IN 1 .. v_tt_sessions.COUNT
        LOOP
            EXECUTE IMMEDIATE 'alter system kill session '''||v_tt_sessions(idx).sid||','||v_tt_sessions(idx).serial#||''' immediate';
        END LOOP;
    END LOOP;
CLOSE rc;
..........
..........
Please suggest if there is something wrong in my code first. I tried, but could not get any inadequacy.

But the doubt is when I removed the variable of liaison with the values of the collection hard-coded (in my first post), then this process works very well. But I want to use bind variables.

You cannot use bind variables in this situation. You can use bind variables for the DML statements.
I'm surprised that you have no error, but I guess that this block of code explains everything:

EXCEPTION
    WHEN OTHERS THEN
        dbms_output.put_line(SQLCODE || ' : ' || SQLERRM);
  

You concatenate values to build a single command ALTER SYSTEM and run, just like your second attempt.
You don't need to have a dynamic cursor either.

for r in (
  select v.SID, u.serial#, count(v.sid)
  from v$open_cursor v, v$session u
  where v.CURSOR_TYPE='OPEN'
  and v.sid=u.sid group by v.sid, u.serial#
  having count(v.sid)>190
  order by count(*) desc
)
loop
  execute immediate 'alter system kill session '''||r.sid||','||r.serial#||''' immediate';
end loop;

And of course, I agree with the comments of Keith (assuming that this is not just an exercise).

Published by: odie_63 on October 16, 2012 14:03

Tags: Database

Similar Questions

  • How to swap two values without using the third variable using the procedure

    How to exchange the two values without using the third variable using the procedure?

    In a procedure using two mode we pass two values A = x and B = y, and let us pass parameters to receive the output has A = y and B = x without using the third variable

    Published by: Millar on August 19, 2012 11:23

    Your question doesn't seem wise. As written, there is no reason to a third variable, just

    CREATE OR REPLACE PROCEDURE(
      x IN number,
      y IN number,
      a OUT number,
      b OUT number
    )
    AS
    BEGIN
      a := y;
      b := x;
    END;
    

    If it's an interview question, I suspect that the intention was that you had two settings IN OUT and you wanted to swap the values without the help of a third variable.

    Justin

  • problem with bind variables in the SQL query view object

    Hi all

    I use JDev 11.1.2.4.0.

    I have a problem with bind variables in the SQL query view object.

    This is my original SQL

    SELECT sum(t.TIME) , t.legertype_id
    FROM LEDGER t
    WHERE t.nctuser_id = '20022' 
          AND to_char(t.insertdate,'YYYYMMDD') in ('20130930','20130929')
    group by t.legertype_id
    

    In my view .xml object query tab, I am writing this

    SELECT sum(t.TIME) , t.legertype_id
    FROM LEDGER t
    WHERE   t.nctuser_id = '20022'
        AND to_char(t.insertdate,'YYYYMMDD') in :dddd
    group by t.legertype_id
    

    Davis here is a variable of Type liaison: String, updatable and necessary.

    I try to deal with Davis as ('20130930 ', ' 20130929') hoping the view object, run as my original SQL.

    But failed. The view object retrieves 0 line after that I run.

    Why?

    Thank you! ('2original SQL0130930', '20130929') ('20130930 ', ' 20130929')

    A variable binding cannot be used as this is why you must use years table. Check decompilation binary ADF: using oracle.jbo.domain.Array with ViewCriteria to see a solution.

    Timo

  • How can insert quary in database by using the collection.

    Hi friends,


    My friend advice me to insert several point with collection for the use of multiple lines. But I don't know how to use the collection. How do I create the form to insert data using the collection.
    Please send me any link or example .au insert data into database by using the collection.



    My problem is:-

    I have a bill with several point for example. Grapes (25) with amount here and now I want to add these question with quantity in my database, Badam (145), banana (49), Apple (12)
    When I finally click on submit button.

    Actully I was used as a table but I am facing a problem when using tabular, tabular, I enter first item for example. Apple and there quantity for example. 12 in the textfield and after clicking on Add line enter Buttom went to the database. but I want that entry should not go the database. But only the new line should add when I click on the button Add a line.

    I want all these point 4 should enter into the database when I click on Submit Final.


    Maury

    Published by: Ed on September 6, 2009 02:22

    Hello

    I would do something like the code:

    BEGIN
     DECLARE
      vDATE DATE;
     BEGIN
      vDATE := TO_DATE(:P1_DATE1,'DD.MM.YYYY');
      WHILE vDATE <= TO_DATE(:P1_DATE2,'DD.MM.YYYY')
      LOOP
        INSERT INTO ABC (DTE, LEAVE)
        VALUES (vDATE, :P1_C);
        vDATE := vDATE + 1;
      END LOOP;
     END;
    END;
    

    You must ensure that the datepicker points both use the ' JJ. MM YYYY ' date format.

    Andy

  • The use of bind variables in the application process

    Bind variables refer to elements of session state supported in queries in an application request process?

    All the examples I see show how to pass client side values using the $v () function and the htmldb_get object addParam method and refer to them using the wwv_flow.g_xNN variables, but already available in session state values, I should be able to use them directly in the process, right?

    Thank you

    Yes, they are supported.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • pass the binding variable to the af:table using the menu drop-down

    I need to create an af:table to pull all employees belonging to a Department. I created the table based on a viewobject.

    The query in the view object has a variabe bind, for example:

    Select * from employee where deptname to (select deptname of Department where deptid =: deptid)

    My question is how to get the deptid selected in a drop-down list value passed to the query of the table of the adf?

    The user, what version jdev you use?

    Where is the location THAT LOV located on the page? Once you have the service ID, you can use the executeWithParams to run the query and display the result in the table.

    If this isn't what you want to elaborate on the use case.

    Timo

  • Procedure of the ODI - Bind Variables in the conditional statements

    In an ODI procedure, is it possible to add a conditional statement around bind variable?  For example, if I use OdiOutFile as the command on the target and Oracle as the command on the Source, I can use bind variables to fill the data in this table (we are in fact using OdiInvokeWebService and passing a XML structure very complex, but it's easier for testing):

    OdiOutFile-FILE = C: / TEST. TXT

    < person >

    < first > #FIRSTNAME < / first >

    < Middle > #MIDDLENAME < / Middle >

    < last > #LASTNAME < / last >

    < / person >

    It is a way to add a conditional statement using one of these bind variables?  For example, if I wanted to test #MIDDLENAME null and null value, produced this portion of XML, such as:

    OdiOutFile-FILE = C: / TEST. TXT

    < person >

    < first > #FIRSTNAME < / first >

    < % if (#MIDDLENAME! = null) {% >}

    < Middle > #MIDDLENAME < / Middle >

    < %} % >

    < last > #LASTNAME < / last >

    < / person >

    This type of scriptlet syntax seems to work fine, as long as the binding variable is not in the mix (if I put "true is true" or "true == false" in the case, it shows or does not show this line in the XML file, as expected).  I use ODI 11.1.1.7.0

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

    Post edited by: KevinPratt

    Thanks for the reply!  As suggested, in what follows, I changed the command and it works as you want

    OdiOutFile-FILE = C: / TEST. TXT-APPEND

    < person >

    < first > #FIRSTNAME < / first >

    < @ if (!) (("#MIDDLENAME".equals(""))) {@ >}

    < Middle > #MIDDLENAME < / Middle >

    {< @} @ >

    < last > #LASTNAME < / last >

    < / person >

    Using the syntax <@ ...="" @="">serve your purpose. Also, I think you might want to include the variable binding in the quotation to avoid syntax errors.

  • Why use the collections?

    Please help me to better understand and to right the next point

    to move from a PPT available in internet, I read a sentence under the heading "Why use collections?" Please find here

    Use of complex data sets information to host non-PL/SQL environments using table functions

    I think I understand: it means that complex data sets can be collected from oracle using only a single sql statement by using the installation, called Oracle Pipelined Table functions. http://www.akadia.com/services/ora_pipe_functions.html]

    Is any other installation in oracle to the serveup of complex datasets of the information to the host non-PL/SQL environments?

    Published by: o Manjusha Muraleedas, error corrected spelling.

    I watched the presentation and here's how I read it (although you might be better to ask the author):

    Manjusha Muraleedas wrote:
    My question is, why the statement "Serve up complex data sets of information to host non-PL/SQL environments using table functions" came under the title "Why use collections?". Just because there's an installation? or any other really good news?

    There is a hypothesis that is unwritten in the presentation: "complex" data is data that must be handled in PL/SQL, because only SQL does not work.

    Nowhere the author says that a pure SQL solution should be changed into a solution of PL/SQL.

    Once you decide that you must use the PL/SQL, you might want to put your data in collections in scalar variables.

    I understand, complex data, works of art (suppose a structure with 3 columns of tables joing 5) can be meet non-pl/sql envirormment like Java, the use of the ref Cursor or xml. Collection using to do the same thing, this is not a good option.

    Again, I think that the author uses "complex" as a shortcut for 'need to PL/SQL in the first place'. If the data must be processed in PL/SQL, there is no need to use PL/SQL scalar variables or collections.
    I would say "use of the ref Cursor. Providing relational data in format XML should be the exception, not the rule. It has a cost of additional performance.

    Now lets talk about pipeline table functions.
    ...
    functions table pipeline reached the performance of parallel processing. so even if binding commodity of time and memory is there, it will be performs better than refcursors or xml?

    Pipeline table functions perform no better than the ref Cursor. There are two processes running, one to SELECT and the other for the function, there will be more work on the server. With a ref cursor, there is a fair process to return the data.

    Parallel processing is not a problem. If you can make it work in plain SQL, you can do in parallel in SQL simple.

    Published by: Ashton stew on January 22, 2013 16:44

  • Bind variables in the SQL causes slow

    We have a strange problem in our PeopleSoft system that I traced to a SELECT statement using bind variables, if hardcode us them values in SQL, it runs very fast.
    but using bindings (what the application does) a problem of efficiency. I'm going to re - write the code that is based on a view of three tables joined to go against
    the base tables and I don't think I'll have a problem. However, I would like to know why the problem exists in the first place. Here is what info I have:
    Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    It's the 'good' application without links:
    SELECT COUNT(*)
    FROM sysadm.PS_ERN_PROG_DESCR A
    WHERE A.ERN_PROGRAM = 'VT'
    AND A.ERNCD         = '01'
    AND EFFDT           =
      (SELECT MAX(B.EFFDT)
      FROM sysadm.PS_ERN_PROG_DESCR B
      WHERE B.ERN_PROGRAM = 'VT'
      AND B.EFFDT        <= TO_DATE('2009-10-10','YYYY-MM-DD')
      );
    And the 'good' explains the plan:
     Plan hash value: 3344976101
    
    -------------------------------------------------------------------------------------------------------------
    | Id  | Operation                              | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                       |                    |     1 |    33 |    58  (23)| 00:00:01 |
    |   1 |  SORT AGGREGATE                        |                    |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                         |                    |     1 |    33 |     3   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                        |                    |     1 |    22 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX UNIQUE SCAN                  | PS_ERN_PROGRAM_DEF |     1 |    12 |     1   (0)| 00:00:01 |
    |   5 |      SORT AGGREGATE                    |                    |     1 |     9 |            |          |
    |   6 |       VIEW                             |                    |    23 |   207 |    51  (26)| 00:00:01 |
    |*  7 |        FILTER                          |                    |       |       |            |          |
    |   8 |         SORT GROUP BY                  |                    |    23 |  1748 |    51  (26)| 00:00:01 |
    |*  9 |          HASH JOIN                     |                    |  2995 |   222K|    49  (23)| 00:00:01 |
    |* 10 |           TABLE ACCESS FULL            | PS_EARNINGS_TBL    |  1913 | 24869 |    15   (7)| 00:00:01 |
    |* 11 |           HASH JOIN                    |                    | 13621 |   838K|    30  (20)| 00:00:01 |
    |  12 |            TABLE ACCESS FULL           | PS_EARNINGS_TBL    |  1913 | 42086 |    14   (0)| 00:00:01 |
    |* 13 |            HASH JOIN                   |                    |  3097 |   124K|    14  (29)| 00:00:01 |
    |* 14 |             TABLE ACCESS BY INDEX ROWID| PS_ERN_PROGRAM_TBL |     9 |   207 |     2   (0)| 00:00:01 |
    |* 15 |              INDEX RANGE SCAN          | PS_ERN_PROGRAM_TBL |    18 |       |     1   (0)| 00:00:01 |
    |* 16 |             TABLE ACCESS FULL          | PS_ERN_PROGRAM_DEF | 12035 |   211K|    10  (20)| 00:00:01 |
    |* 17 |     INDEX RANGE SCAN                   | PS_EARNINGS_TBL    |     1 |    10 |     1   (0)| 00:00:01 |
    |  18 |      SORT AGGREGATE                    |                    |     1 |    10 |            |          |
    |* 19 |       INDEX RANGE SCAN                 | PS_EARNINGS_TBL    |     1 |    10 |     2   (0)| 00:00:01 |
    |* 20 |    TABLE ACCESS BY INDEX ROWID         | PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 21 |     INDEX UNIQUE SCAN                  | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    -------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"= (SELECT MAX("$vm_col_2") FROM  (SELECT /*+ */
                  "EFFDT" "$vm_col_1","A"."EFFDT" "$vm_col_2" FROM SYSADM."PS_EARNINGS_TBL"
                  "C",SYSADM."PS_ERN_PROGRAM_TBL" "B",SYSADM."PS_ERN_PROGRAM_DEF" "A",SYSADM."PS_EARNINGS_TBL" "D"
                  WHERE "D"."EFFDT"<="A"."EFFDT" AND "D"."ERNCD"="C"."ERNCD" AND "D"."EFFDT"<=TO_DATE(' 2009-10-10
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "A"."EFFDT"="B"."EFFDT" AND
                  "A"."ERN_PROGRAM"="B"."ERN_PROGRAM" AND "A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(' 2009-10-10
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "B"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "B"."ERN_PROGRAM"='VT' AND "B"."EFF_STATUS"='A' AND "C"."ERNCD"="A"."ERNCD" GROUP
                  BY "D"."ERNCD",ROWID,ROWID,ROWID,ROWID,"A"."EFFDT","EFFDT" HAVING "EFFDT"=MAX("D"."EFFDT"))
                  "$vm_view") AND "A"."ERNCD"='01')
       7 - filter("EFFDT"=MAX("D"."EFFDT"))
       9 - access("D"."ERNCD"="C"."ERNCD")
           filter("D"."EFFDT"<="A"."EFFDT")
      10 - filter("D"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
      11 - access("C"."ERNCD"="A"."ERNCD")
      13 - access("A"."ERN_PROGRAM"="B"."ERN_PROGRAM" AND "A"."EFFDT"="B"."EFFDT")
      14 - filter("B"."EFF_STATUS"='A')
      15 - access("B"."ERN_PROGRAM"='VT' AND "B"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))
      16 - filter("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))
      17 - access("C"."ERNCD"='01')
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))= (SELECT
                  MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) FROM SYSADM."PS_EARNINGS_TBL" "D" WHERE
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B1) AND
                  "D"."ERNCD"=:B2 AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B3))
      19 - access("D"."ERNCD"=:B1 AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B2) AND
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B1)
      20 - filter("B"."EFF_STATUS"='A')
      21 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
    Here is the 'good' autotrace:
    SQL> variable ppe_date varchar2(10)
    SQL> variable erncd varchar2(3)
    SQL> exec :ppe_date := '2009-10-10'
    SQL> exec :erncd := '01'
    SQL> SELECT COUNT(*)
      2  FROM PS_ERN_PROG_DESCR A
      3  WHERE A.ERN_PROGRAM = 'VT'
      4  AND A.ERNCD         = '01'
      5  AND EFFDT           =
      6    (SELECT MAX(B.EFFDT)
      7    FROM PS_ERN_PROG_DESCR B
      8    WHERE B.ERN_PROGRAM = 'VT'
      9    AND B.EFFDT        <= TO_DATE('2009-10-10','YYYY-MM-DD')
     10    );
    
      COUNT(*)
    ----------
             1
    
    Elapsed: 00:00:01.23
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=59 Card=1 Bytes=33)
       1    0   SORT (AGGREGATE)
       2    1     NESTED LOOPS (Cost=3 Card=1 Bytes=33)
       3    2       NESTED LOOPS (Cost=2 Card=1 Bytes=22)
       4    3         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=12)
       5    4           SORT (AGGREGATE)
       6    5             VIEW (Cost=52 Card=24 Bytes=216)
       7    6               FILTER
       8    7                 SORT (GROUP BY) (Cost=52 Card=24 Bytes=1824)
       9    8                   HASH JOIN (Cost=50 Card=3177 Bytes=241452)
      10    9                     TABLE ACCESS (FULL) OF 'PS_EARNINGS_TBL' (TABLE) (Cost=15 Card=1921 Bytes=24973)
      11    9                     HASH JOIN (Cost=31 Card=14488 Bytes=912744)
      12   11                       TABLE ACCESS (FULL) OF 'PS_EARNINGS_TBL' (TABLE) (Cost=14 Card=1921 Bytes=42262)
      13   11                       HASH JOIN (Cost=15 Card=3303 Bytes=135423)
      14   13                         TABLE ACCESS (FULL) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=2 Card=9 Bytes=207)
      15   13                         TABLE ACCESS (FULL) OF 'PS_ERN_PROGRAM_DEF' (TABLE) (Cost=12 Card=12856 Bytes=231408)
      16    3         INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=10)
      17   16           SORT (AGGREGATE)
      18   17             INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=10)
      19    2       TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      20   19         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
    
    
    
    
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
            182  consistent gets
              0  physical reads
              0  redo size
            232  bytes sent via SQL*Net to client
            278  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              1  rows processed
    
    SQL> spool off
    ===================================
    This is the 'bad' query using bindings:
    ===================================
    SELECT COUNT(*)
    FROM sysadm.PS_ERN_PROG_DESCR A
    WHERE A.ERN_PROGRAM = 'VT'
    AND A.ERNCD         = :erncd
    AND EFFDT           =
      (SELECT MAX(B.EFFDT)
      FROM sysadm.PS_ERN_PROG_DESCR B
      WHERE B.ERN_PROGRAM = 'VT'
      AND B.EFFDT        <= TO_DATE(:ppe_date,'YYYY-MM-DD')
      );
    The 'bad' explain plan
    explain plan succeeded.
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 337039962
    
    --------------------------------------------------------------------------------------------------------
    | Id  | Operation                         | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                  |                    |     1 |    33 |    20  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE                   |                    |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                    |                    |     1 |    33 |     3   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                   |                    |     1 |    22 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX UNIQUE SCAN             | PS_ERN_PROGRAM_DEF |     1 |    12 |     1   (0)| 00:00:01 |
    |   5 |      SORT AGGREGATE               |                    |     1 |    63 |            |          |
    |   6 |       NESTED LOOPS                |                    |     1 |    63 |    13  (39)| 00:00:01 |
    |   7 |        NESTED LOOPS               |                    |     1 |    52 |    12  (42)| 00:00:01 |
    |*  8 |         HASH JOIN                 |                    |     4 |   168 |    12  (42)| 00:00:01 |
    |   9 |          VIEW                     | VW_SQ_1            |    88 |  2112 |     9  (45)| 00:00:01 |
    |  10 |           SORT GROUP BY           |                    |    88 |  2728 |     9  (45)| 00:00:01 |
    |  11 |            MERGE JOIN             |                    |  3087 | 95697 |     7  (29)| 00:00:01 |
    |  12 |             SORT JOIN             |                    |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 13 |              INDEX RANGE SCAN     | PS_ERN_PROGRAM_DEF |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 14 |             SORT JOIN             |                    |    96 |  1248 |     5  (40)| 00:00:01 |
    |* 15 |              INDEX FAST FULL SCAN | PS_EARNINGS_TBL    |    96 |  1248 |     4  (25)| 00:00:01 |
    |* 16 |          INDEX RANGE SCAN         | PS_ERN_PROGRAM_DEF |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 17 |         INDEX UNIQUE SCAN         | PS_EARNINGS_TBL    |     1 |    10 |     0   (0)| 00:00:01 |
    |* 18 |        TABLE ACCESS BY INDEX ROWID| PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 19 |         INDEX UNIQUE SCAN         | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    |* 20 |     INDEX RANGE SCAN              | PS_EARNINGS_TBL    |     1 |    10 |     1   (0)| 00:00:01 |
    |  21 |      SORT AGGREGATE               |                    |     1 |    10 |            |          |
    |* 22 |       INDEX RANGE SCAN            | PS_EARNINGS_TBL    |     1 |    10 |     2   (0)| 00:00:01 |
    |* 23 |    TABLE ACCESS BY INDEX ROWID    | PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 24 |     INDEX UNIQUE SCAN             | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"= (SELECT MAX("A"."EFFDT") FROM
                  SYSADM."PS_EARNINGS_TBL" "C",SYSADM."PS_ERN_PROGRAM_TBL" "B",SYSADM."PS_ERN_PROGRAM_DEF" "A",
                  (SELECT MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) "VW_COL_1","D"."ERNCD" "ERNCD",ROWID
                  "ROWID" FROM SYSADM."PS_EARNINGS_TBL" "D","PS_ERN_PROGRAM_DEF" "A" WHERE
                  "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND "A"."ERN_PROGRAM"='VT' AND
                  SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT") AND
                  SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') GROUP BY
                  "D"."ERNCD",ROWID) "VW_SQ_1" WHERE "ROWID"=ROWID AND
                  "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND "A"."ERN_PROGRAM"='VT' AND
                  "A"."EFFDT"="B"."EFFDT" AND "B"."ERN_PROGRAM"='VT' AND "B"."EFF_STATUS"='A' AND
                  "B"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND
                  SYS_OP_DESCEND("EFFDT")=SYS_OP_DESCEND("VW_COL_1") AND "ERNCD"="C"."ERNCD" AND
                  "C"."ERNCD"="A"."ERNCD" AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))="VW_COL_1") AND
                  "A"."ERNCD"=:ERNCD)
       8 - access("ROWID"=ROWID)
      13 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      14 - access(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT"))
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT"))
      15 - filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      16 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      17 - access("ERNCD"="C"."ERNCD" AND SYS_OP_DESCEND("EFFDT")=SYS_OP_DESCEND("VW_COL_1"))
           filter("C"."ERNCD"="A"."ERNCD" AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))="VW_COL_1")
      18 - filter("B"."EFF_STATUS"='A')
      19 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
           filter("B"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      20 - access("C"."ERNCD"=:ERNCD)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))= (SELECT
                  MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) FROM SYSADM."PS_EARNINGS_TBL" "D" WHERE
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B1) AND
                  "D"."ERNCD"=:B2 AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B3))
      22 - access("D"."ERNCD"=:B1 AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B2) AND
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B1)
      23 - filter("B"."EFF_STATUS"='A')
      24 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
    Here's the bad autotrace:
    SQL> variable ppe_date varchar2(10)
    SQL> variable erncd varchar2(3)
    SQL> exec :ppe_date := '2009-10-10'
    SQL> exec :erncd := '01'
    SQL> SELECT COUNT(*)
      2  FROM PS_ERN_PROG_DESCR A
      3  WHERE A.ERN_PROGRAM = 'VT'
      4  AND A.ERNCD         = :erncd
      5  AND EFFDT           =
      6    (SELECT MAX(B.EFFDT)
      7    FROM PS_ERN_PROG_DESCR B
      8    WHERE B.ERN_PROGRAM = 'VT'
      9    AND B.EFFDT        <= TO_DATE(:ppe_date,'YYYY-MM-DD')
     10    );
    
      COUNT(*)
    ----------
             1
    
    Elapsed: 00:04:07.40
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=20 Card=1 Bytes=33)
       1    0   SORT (AGGREGATE)
       2    1     NESTED LOOPS (Cost=3 Card=1 Bytes=33)
       3    2       NESTED LOOPS (Cost=2 Card=1 Bytes=22)
       4    3         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=12)
       5    4           SORT (AGGREGATE)
       6    5             NESTED LOOPS (Cost=13 Card=1 Bytes=63)
       7    6               NESTED LOOPS (Cost=12 Card=1 Bytes=52)
       8    7                 HASH JOIN (Cost=12 Card=4 Bytes=168)
       9    8                   VIEW OF 'VW_SQ_1' (VIEW) (Cost=9 Card=88 Bytes=2112)
      10    9                     SORT (GROUP BY) (Cost=9 Card=88 Bytes=2728)
      11   10                       MERGE JOIN (Cost=7 Card=3087 Bytes=95697)
      12   11                         SORT (JOIN) (Cost=2 Card=643 Bytes=11574)
      13   12                           INDEX (RANGE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=2 Card=643 Bytes=11574)
      14   11                         SORT (JOIN) (Cost=5 Card=96 Bytes=1248)
      15   14                           INDEX (FAST FULL SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=4 Card=96 Bytes=1248)
      16    8                   INDEX (RANGE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=2 Card=643 Bytes=11574)
      17    7                 INDEX (UNIQUE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=10)
      18    6               TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      19   18                 INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
      20    3         INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=10)
      21   20           SORT (AGGREGATE)
      22   21             INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=10)
      23    2       TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      24   23         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
    
    Statistics
    ----------------------------------------------------------
           3820  recursive calls
             66  db block gets
        4677728  consistent gets
          80608  physical reads
              0  redo size
            232  bytes sent via SQL*Net to client
            278  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              2  sorts (memory)
              1  sorts (disk)
              1  rows processed
    
    SQL> spool off

    I think you have to hit some sort of bug in the optimizer. Do you have the histograms on the EFFDT column.

  • Update Bind variable during the click on chart?

    New to ADF, so getting started is a little rough right now.

    I created a couple of display objects, trained in my JSF page and created the graphics bar out of them. I can click on the series in the bar chart and update a table ADF without problem. What I would do, is to take the result of the click (I know how to find the value of the Group since the click) and past this value in another view to display a new table.

    So the question is how can I update a binding for a display object variable and display the results in a table of the ADF?

    I have a query: "select user_name, user_role from users where user_id =: userId" with a variable named liaison: userId. It took the form of the ADF on my page and rendering: false and display: false. What I would do, is updated ": userId" variable with a value of the graph and display of the form.

    Any help?

    Thank you!

    Hello

    I think that the blog post from this Shay can be useful for you:
    http://blogs.Oracle.com/Shay/2009/01/setting_parameter_for_before_p.html

    Kind regards

    Branislav

  • Bind Variables on the view objects child definition

    JDeveloper 12 c

    I have an interesting question.  I have a view (AisWebModulePrivsVO) object that uses a bindvariable hardcoded in the view object.

    SELECT * FROM SYS. DBA_ROLE_PRIVS where DEALER =: bvUserName

    If I put this in the request module I can programmatically set the variable binding (view object contains the getter/setter for the binding variable).

    AisWebModulePrivsVOImpl voTest = am.getAisWebModulePrivsVI ();

    voTest.setbvUserName ("ARAWLS");

    voTest.executeQuery ();

    System.out.println ("test reports:" + voTest.getRowCount ());

    and get the correct number of records based on return on the user and database roles. If it works.

    What does NOT work, it is when this display object is a recording of 'the child' to another display object (as specified by a link between the two and by setting the object from a point of view as one child of the other in the module of the application).

    AppModule looks like this:

    CgRefCodesVO

    AisWebModulePrivsVO

    In this case, I have a view called cgRefCodeVO parent object.  There is a link between this and the AisWebModulePrivsVO. The relationship works.

    AISMenuAppModuleImpl m = ADFUtils.getApplicationModuleForDataControl (appMod) (AISMenuAppModuleImpl);

    CgRefCodesVOImpl cgRefVO = am.getCgRefCodes1 ();

    AisWebModulePrivsVOImpl modsVO = am.getAisWebModulePrivs1 ();

    modsVO.setbvDBUserName ("ARAWLS");  This doesn't seem to work here...

    cgRefVO.executeQuery ();

    All lines rs = cgRefVO.getRowSet ();

    RS. Reset();

    While (rs.hasNext ()) {}

    CgRefCodesVORowImpl CgRefRow = rs.next ((CgRefCodesVORowImpl));

    System.out.println ("RvLowValue:" + CgRefRow.getAttribute ("RvLowValue"));

    RowIterator aisModulesRowIter = CgRefRow.getAisWebModulePrivs ();

    System.out.println ("number of children:" + aisModulesRowIter.getRowCount ());

    }

    The code compiles and runs.  She translates: "County of the child: 0" for each row returned by the

    I also tried:

    VM VariableValueManager = modsVO.ensureVariableManager ();

    vm.setVariableValue ("bvDBUserName", "ARAWLS");

    And:

    modsVO.setNamedWhereClauseParam ("bvDBUserName", "ARAWLS");

    and (of https://community.oracle.com/message/2746551#2746551 ( )

    @Override

    protected void executeQueryForCollection (Object, object, Object [] object2, int i) {}

    I coded everything hard to see if it would work.

    setNamedWhereClauseParam ("bvDBUserName", "ARAWLS");

    super.executeQueryForCollection (object, object2, i);

    }

    and from there, I changed around the order to execute the objects in view.    https://community.oracle.com/message/10632314#10632314

    How can I set the variable binding in the object view child?

    Thank you

    Stuart

    It is an interesting example how ADF works up to a certain point... then you need to start to make cuts to modify its behavior as you wish.

    I decided that it was just easier to delete 'the child' parent (in the app module) and create a view of criteria on this subject for what would basically query the records to get the same results, like a child.

    Perhaps not as elegant, but so much easier.

    Thanks for your help.

    Stuart

  • Oracle.ManagedDataAccess gives ORA-01006 if there is bind variables in the comments, but only on the lines.

    When I go from ODP.NET to the ODP.NET managed some of my questions begins to throw errors missing bind variable.

    I reproduced with a simple example that uses a variable called liaison: unitName

    It's the example SQL:

    SELECT

    : unitName

    Of

    DOUBLE

    Now, if I add a comment at the beginning of the SQL like this:

    -Text with: unitName

    SELECT

    : unitName

    Of

    DOUBLE

    It works, but if I have a variable binding in a comment that is located on a number of the 'same' line, I get ORA-01006:

    This causes the error:

    -First line comment

    -Text with: unitName

    SELECT

    : unitName

    Of

    DOUBLE

    Kind regards

    -Tommy

    I was able to reproduce this problem. I filed Bug 19433348 on your behalf.

    The circumstances in which the bug occurs are fairly easy to get around.

    (1) remove the colon in the second commented line.

    (2) add a space between the '\n' and ' - '.

    If you are one of those things, you won't encounter the bug behavior.

  • Reference SQL Loader Bind Variables in the when Clause

    Support for SQL: SQL * Loader: version 8.0.6.3.0 (don't ask, it runs on Oracle EBS 11i...)

    I have a case where my sample data looks like:
    HD00100001002
    SM00100002CHAPS   99999999999                     20120906GBP0000000000001000000000001
    and another file
    HD00100001001
    SM00100002GBP0000000000001000000000001
    Essentially, I need to apply another "IN" clause for each record of SM depends on the ack_type (char 13 on HD recording), either 1 or 2

    I tried setting up the ack_type with a variable binding but find how to reference.

    Example of control file:
    --  $Header: test.ctl
    --
    
    LOAD DATA
    REPLACE
    
    -- Record Type HD : File Header
    INTO TABLE  test_table
    WHEN rec_id_no = 'HD'
    TRAILING NULLCOLS
    (rec_no                 RECNUM,
     hdr_line               CONSTANT 'H',
     rec_id_no              POSITION(1:2)   CHAR,
     file_number            POSITION(3:5)   CHAR,
     sequence_number        POSITION(6:10)  CHAR,
     status                 POSITION(11:12) CHAR,
     ack_type               POSITION(13:13) ":ack_type",
     co_id                  POSITION(14:21) CHAR,
     dept_id                POSITION(22:24) CHAR,
     btch_no                POSITION(25:36) CHAR,
     trans_id               POSITION(37:42) CHAR)
    
    -- Record Type SM : File Summary
    INTO TABLE test_table
    WHEN rec_id_no = 'SM' and :ack_type = '1'
    TRAILING NULLCOLS
    (rec_no                 RECNUM,
     hdr_line               CONSTANT 'L',
     rec_id_no              POSITION(1:2)   CHAR,
     file_number            POSITION(3:5)   CHAR,
     sequence_number        POSITION(6:10)  CHAR,
     ccy_code               POSITION(11:13) CHAR,
     amount                 POSITION(14:26) CHAR,
     number_trans_ok        POSITION(27:40) CHAR)
    The code above does not work, it is said that: ack_type is not recognized. Is there a way to do it, given the former character of the SQL Load version?

    What is the database version 11i is running on? If 11 GR 2, this doc can help you in the use of the features that Dan mentions

    How to use the 9i or 10g features in SQL * Loader for Apps? [423035.1 ID]

    HTH
    Srini

  • In a table by using the Collection update of nulls

    I use collections to create a form in a table. However, I can't get the code to work. Could you please look at my logic and let me know what I am doing wrong?
    Apex version: 4.1
    1 process name: load Collection
    a. process Point: On Load - before the header
    Condition (b) process:
    i. the condition Type: PL/SQL expression
    + ii.     Expression:
     not apex_collection.collection_exists(p_collection_name => 'STAKEHOLDERS_COL')
    +
    c. code:
    if apex_collection.collection_exists('STAKEHOLDERS_COL') = TRUE then
       apex_collection.delete_collection(
             p_collection_name =>'STAKEHOLDERS_COL');
    end if;
    apex_collection.create_collection_from_query(
        p_collection_name => 'STAKEHOLDERS_COL',
        p_query => 'select id
                   , stakeholder_name
                   , stakeholder_role_id
                   , primary_contact_yn
                   , receive_notification_yn
                   , ''O'' original_flag
                   , wwv_flow_item.md5(stakeholder_name, stakeholder_role_id, 
                     primary_contact_yn, receive_notification_yn) 
                   from eba_prjv_proj_stakeholders,
       p_generate_md5 => 'YES'
    );
    * 2.     Report on the collection:
    a. query:
    select 
    apex_item.hidden(1,c001) id,
    apex_item.popupkey_from_query(2,c002,'select user_name d, user_name r from eba_prjv_app_users order by 1', 10) name,
    apex_item.select_list_from_query(4,c003,'select role_description d, id r from eba_prjv_stkhlder_roles order by role_code', 10) role,
    apex_ITEM.SELECT_LIST(5,c004,'N','Yes;Y,No;N') primary_contact_yn,
    apex_ITEM.SELECT_LIST(6,c005,'N','Yes;Y,No;N') receive_notifications_yn,
    apex_item.hidden(7, c006) status,
    apex_item.checkbox(8, seq_id) chkbx,
    apex_item.hidden(9, seq_id) seq_id
    from apex_collections
    where collection_name = 'STAKEHOLDERS_COL'
    AND c006 IN ('O','N','U')
    * 3.     I have a button 'Add a line' add a blank line for inserts. The button "submit page" REQUEST As "ADD". *
    * 4.     The process of adding new line: *.
    a. process Point: after submit - by the calculation and Validation
    b. process of Condition: what key - add row
    c. code:
    begin
    apex_collection.add_member(
    p_collection_name => 'STAKEHOLDERS_COL',
    p_c006 => 'N',
    p_generate_md5 => 'YES' );
    end;
    * 5. I have a button Delete who submits the request page = 'DELETE '. *
    * 6.     Collection update process:
    a. process Point: after submit - by the calculation and Validation
    + b.     Condition of process:
    REQUEST != 'ADD'
    +
    c. code:
    DECLARE
    l_status VARCHAR2(1);
    l_seq_id NUMBER;
    l_original_md5 VARCHAR2(4000);
    l_array_md5 VARCHAR2(4000);
    
    BEGIN
    
    FOR i IN 1..apex_application.g_f01.count LOOP
    
    -- Check previous status of Collection Member
      
       SELECT c006, c007 INTO l_status, l_original_md5
       FROM apex_collections
       WHERE 
       collection_name = 'STAKEHOLDERS_COL'
       AND seq_id = apex_application.g_f09(i);
    
    IF l_status = 'N' THEN
       l_status := 'N';
       
    ELSE
       SELECT wwv_flow_item.md5(apex_application.g_f02(i)
       , apex_application.g_f04(i)
       , apex_application.g_f05(i)
       , apex_application.g_f06(i))
       INTO l_array_md5
       FROM DUAL;
       
       IF l_original_md5 != l_array_md5 THEN
          l_status := 'U';
       END IF;
    END IF;
    
    
    IF l_status IN ('N','U') THEN
       
       apex_collection.update_member(
       p_collection_name => 'STAKEHOLDERS_COL'
       , p_seq => apex_application.g_f09(i)
       , p_c001 => apex_application.g_f01(i)
       , p_c002 => apex_application.g_f02(i)
       , p_c003 => apex_application.g_f04(i)
       , p_c004 => apex_application.g_f05(i)
       , p_c005 => apex_application.g_f06(i)
       , p_c006 => l_status
       , p_c007 => l_original_md5
     );
    END IF;
    END LOOP;
    IF :REQUEST = 'DELETE' THEN
       FOR i IN 1..apex_application.g_f08.count LOOP
       -- Check previous status of Collection Member
     
      SELECT seq_id, c006 INTO l_seq_id, l_status
      FROM apex_collections
      WHERE collection_name = 'STAKEHOLDERS_COL'
      AND seq_id = apex_application.g_f08(i);
    
      IF l_status = 'N' THEN
         apex_collection.delete_member(
         p_collection_name => 'STAKEHOLDERS_COL'
         , p_seq => l_seq_id
        );
      ELSE
        apex_collection.update_member_attribute(
        p_collection_name => 'STAKEHOLDERS_COL'
        , p_seq => l_seq_id
        , p_attr_number => '6'
        , p_attr_value => 'D'
       );
      END IF;
     END LOOP;
    END IF;
    
    end;
    * 7.     Update the collection table
    a. process Point: present - according to calculation and Validation
    b. process of Condition: If the key (APPLY_CHANGES)
    c. code
    DECLARE
    l_table_md5 VARCHAR2(4000);
    l_collection_md5 VARCHAR2(4000);
    BEGIN
    
    FOR c1 IN (SELECT c001, c002, c003, c004, c005, c006, c007,seq_id
    FROM apex_collections
    WHERE collection_name = 'STAKEHOLDERS_COL'
    ) LOOP
    
    IF c1.c006 = 'N' THEN
       insert into eba_prjv_proj_stakeholders
                ( STAKEHOLDER_NAME,
                 STAKEHOLDER_ROLE_ID,
                 PRIMARY_CONTACT_YN,
                 RECEIVE_NOTIFICATION_YN
                 )
                values
                (c1.c002,
                 c1.c003,
                 c1.c004,
                 c1.c005            
                );
    ELSIF c1.c006 = 'D' THEN
       DELETE FROM eba_prjv_proj_stakeholders
       WHERE id = c1.c001;
    ELSIF c1.c006 = 'U' THEN
       -- Check the record hasn't been updated since the query
       -- Get MD5 checksum from the Table
      
     SELECT wwv_flow_item.md5(STAKEHOLDER_NAME, STAKEHOLDER_ROLE_ID, PRIMARY_CONTACT_YN, RECEIVE_NOTIFICATION_YN)
       INTO l_table_md5
       FROM eba_prjv_proj_stakeholders
       WHERE id = c1.c001;
       -- Compare the checksum values and if they are different, raise an error.
       IF l_table_md5 != c1.c007 THEN
          raise_application_error( -20001
          , 'Current version of data in database has changed '||
            'since user initiated update process.');
         return;
      END IF;
    
      UPDATE eba_prjv_proj_stakeholders set
      STAKEHOLDER_NAME = c1.c002,
      STAKEHOLDER_ROLE_ID = c1.c003,
      PRIMARY_CONTACT_YN = c1.c004,
      RECEIVE_NOTIFICATION_YN = c1.c005
      where id = c1.c001;
    end if;
    end loop;
    apex_collection.delete_collection( p_collection_name => 'STAKEHOLDERS_COL' );
    END;
    At the end of the process, I see null values inserted in my table. The report also displays null values.

    Published by: jaouad khalifi on August 17, 2012 04:26

    Published by: jaouad khalifi on August 17, 2012 04:42

    Published by: jaouad khalifi on August 17, 2012 04:46

    Published by: jaouad khalifi on August 18, 2012 02:03

    Hello

    I changed and then brought back to the State that you had.

    The problem here is that you have status and Seq_id returned with APEX_ITEM. HIDDEN, but you have not selected the Show check box for those columns attribute report tab.

    Thus there is no f06 and f09 only named elements in your HTML DOM and therefore no APEX_APPLICATION. G_F06 and G_F09. If your processes

    FOR correct here is what you do

    1. mark the status and Seq_id as indicated in the report attribute tab columns
    2. change the ACE status display hidden to report column Standard. Change display of the Seq_id also report Standard column

    Note that when a column is not marked to show in the report he becomes any and you don't see the associated items in the DOM HTML.

    See you soon,.

  • JDev 11.1.2.1 method Execute (with bind variable) before the page is displayed

    Hi all

    I have a view object with a query that uses a variable binding. I drag the data on my .jsf page control to create a table. I create a query method on a bean in sight. The query method uses the content of one of the attributes of the bean to set the link for the query variable:

    vo.setNamedWhereClauseParam ("CraIdBindVar", sessionBean.getCraId ());

    I put a button on the page that calls the method of the request and it fills the table. That's fine, but I don't want the user to have to click the "query" button when browsing this page. I found forums dealing with create an AMImpl.jave method, create a link on the page, create an executable file for the link. It works that the method is executed until the page appears. However, the AMImpl method cannot call sessionBean.getCraid () to obtain the data required to complete the binding variable.

    Is it possible to run my method of view range bean before the page is displayed? Or maybe a way for the AMImpl.java method to access the range of view variable?

    Thank you, Steve

    Steve,
    You can drag a call method on the workflow activity. Select the new method call activity, and open the property inspector. Here you choose your bean method in the method property. Now, first of all, you go to this activity of method call, then the page.

    Timo

Maybe you are looking for