vs 10g 11g: VO bind variable values stale on jbo.ampool.doampooling = false

Hi gang

(JDev 11g Build 5188)

I'm currently such tests recommended by the merger of 11g Guide to test the management of State ADF BC with jbo.ampool.doampooling = false (see paragraphs 36 and 37). I see different behaviors under 11 g vs 10 g.

I have a single VO updateable with a query that is limited by a single binding variable. I have a JSF page with the link as command inputText variable, executeWithParams one operating control commandButton, and a table showing the results of the VO.

Less than 10g, I can:

(1) open the page
(2) enter a value (say X) to the variable binding, click the executeWithParams button and correctly to see results in the table corresponding to the value of the bind variable X.
(3) enter a different value for the binding variable (say Y), click on the executeWithParams button and correctly to see results in the table corresponding to the value of the value of the bind variable Y.

Less than 11g I get different behaviors for # 3. Instead when I press the button executeWithParams with the value defined on, the table always show results for the previous value of the variable X bind?

It should be noted that if I set jbo.ampool.doampooling = true, the problem goes away, but probably the error reappears in a system of production under load, so I need to find what is happening here.

Maybe I see a bug, but given the large amount of changes 11 g and large amount of documents that I read on the management of the State, it could just be that I missed something vital to 11 g.

Does anyone have any opinions, what is happening here?

Thank you for your help in advance.

CM.

Thanks Chris - I took possession of the SR.

Kind regards

Didier.

Tags: Java

Similar Questions

  • Trace files showing the bind variable value =""

    10g on solaris

    Hi all

    We have a problem with an informatica workflow brings an update statement in Oracle in trems of performace.

    I started using DBMS_SUPPORT tracing with lie the TRUE value. He captured the trace files accordingly against a controlled set of data. Trace TWOT files were produced.

    Trace files first shows the SELECT statement are questions that identifies the records that will be updated.

    The 2nd trace file shows the actual UPDATE statement published as a PL/SQL loop to do the update.

    There are 20 records that users have rigged last updated and the update statement lists 20 cases where updates taking place. All updates occurred successfully after reviewing the results of the post. However my question is why the trace files are showing the values of bind as the value ""?... any ideas appreciated!

    an excerpt of the file trace...
    PARSING IN CURSOR #1 len = 123 dep = uid 0 = 1482 oct = 6 lid = tim 1482 = 994827916280 = ad 3649357857 hv = "8b5b98f0."
    UPDATE / * + index (FCT_TASK IDX_FCT_TASK_CASE_SBL_ROW_ID) * / FCT_TASK SET DWH_LAST_UPD_DT = SYSDATE WHERE CASE_SBL_ROW_ID =: 1
    END OF STMT
    # 1 ANALYSIS: c = 10000, e = 980, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 0, og = 1, tim = 994827916264
    =====================
    PARSING IN CURSOR #5 len = 227 dep = 1 uid = 0 oct = cover 3 = 0 tim = hv 994827919231 = ad 2190775527 = "8e622670".
    Select obj$ o, user$ u u.name, o.name, t.update$, t.insert$, t.delete$, t.enabled, trigger$ t where t.baseobject =: 1 and t.obj #= o.obj # and o.owner # u.user = # and bitand (property, 16) = 0 and bitand (property, 8
    ) = 0 order by o.obj #.
    END OF STMT
    ANALYSIS #5:c = 0, e = 1310, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 1, og = 1, tim = 994827919223
    LINKS FOR #5:
    bind 0: dty = 2 mxl = 22 (22) bad = 00 scl = 00 pre = 00 = 00 = 0001 size = 24 offset = 0 oacfl2 oacflg
    BFP = bln ffffffff7c058d98 = 22 avl = flg 04 = 05
    value = 425212
    EXEC #5:c = 10000, e = 9476, p = 0, cr = 0, cu = 0, put = 1, r = 0, dep = 1, og = 4, tim = 994827928883
    FETCH #5:c = 0, e = 104, p = 0, cr = 1, cu = 0, set = 0, r = 0, dep = 1, og = 4, tim = 994827929051
    "STAT id #5 = 1 cnt = 0 pid = 0 pos = 1 obj = 0 op =' SORT ORDER BY (cr = 1 pr = 0 pw = time 0 = 172 en)"
    "STAT id #5 = 2 cnt = 0 pid = 1 pos = 1 obj = 0 op ='NESTED LOOPS (cr = 1 pr = 0 pw = time 0 = 110 US)"
    "STAT id #5 = 3 cnt = 0 pid = 2 pos = 1 obj = 0 op ='NESTED LOOPS (cr = 1 pr = 0 pw = time 0 = 105 en)"
    STAT id #5 = 4 cnt = 0 pid = 3 pos = 1 obj = op 79 ='$ TABLE ACCESS BY INDEX ROWID TRIGGER (cr = 1 pr = 0 pw = time 0 = 103 US)'
    "STAT id #5 = 5 cnt = 0 pid = 4 pos = 1 obj = 123 op ='INDEX RANGE SCAN I_TRIGGER1 (cr = 1 pr = 0 pw = time 0 = 78 US)"
    "STAT id #5 = 6 cnt = 0 pid = 3 pos = 2 obj = op 18 ='TABLE ACCESS BY INDEX ROWID OBJ$ (pr = 0 pw = time cr = 0 0 = 0 US)"
    "STAT id #5 = 7 cnt = 0 pid = 6 pos = 1 obj = op 36 ='INDEX SCAN SINGLE I_OBJ1 (cr = 0 pr = 0 pw = time 0 = 0 US)"
    "STAT id #5 = 8 cnt = 0 pid = 2 pos = 2 obj = op 22 =' CLUSTER ACCESS USER TABLE $ (pr = 0 pw = time cr = 0 0 = 0 US)"
    "STAT id #5 = 9 cnt = 0 pid = 8 pos = 1 obj = op 11 ='INDEX UNIQUE SCAN I_USER # (pr = 0 pw = time cr = 0 0 = 0 US)"
    LINKS FOR #1:
    bind 0: dty = 1 mxl = 32 (30) bad = 00 scl = 00 pre = 00 oacflg = 01 oacfl2 = 800000 size = 32 offset = 0
    BFP = bln ffffffff7c17b0a0 = 32 avl = flg 04 = 05
    value =""
    # 1 EXEC: c = 8390000, e = 8740989, p = 55593, cr = 55610, cu = 3, put = 1, r = 1, dep = 0, og = 1, tim = 994836657483
    LINKS FOR #1:
    bind 0: dty = 1 mxl = 32 (30) bad = 00 scl = 00 pre = 00 oacflg = 01 oacfl2 = 800000 size = 32 offset = 0
    BFP = bln ffffffff7c17b0a0 = 32 avl = flg 04 = 05
    value =""
    # 1 EXEC: c = 7980000, e = 7962369, p = 55591, cr = 55608, cu = 1, SIG = 0, r = 1, dep = 0, og = 1, tim = 994844621479
    LINKS FOR #1:
    bind 0: dty = 1 mxl = 32 (30) bad = 00 scl = 00 pre = 00 oacflg = 01 oacfl2 = 800000 size = 32 offset = 0
    BFP = bln ffffffff7c17b0a0 = 32 avl = flg 04 = 05
    value =""


    ect ect ect...



    Concerning
    Satnam
    BINDS #1:
    bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=01 oacfl2=800000 size=32 offset=0
    bfp=ffffffff7c17b0a0 bln=32 avl=04 flg=05
    value=""
    

    'dty = 1' indicates that the data type is VARCHAR or NVARCHAR. As the timestamp data types data types BLOB, and various other, bind variables defined as NVARCHAR will not have their values dumped in a 10046 trace file. I suspect that the: 1 binding variable is passed as an a NVARCHAR2.

    Charles Hooper
    Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
    http://hoopercharles.WordPress.com/
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • How do I see the bind variable values in the output of statspack

    Hi all.

    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64 bit Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE Production 9.2.0.3.0
    AMT for Solaris: release 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production

    Run sprepsql.sql to get full sql and explain the plan of the hash value.
    SQL returns with bind variable: 1: 2: 3, etc.
    How can I know what are the values for bind variables in order to connect and run them in test db?

    Thanks for your help.

    You can't get the values to bind to StatsPack (AFAIK).

    You have to draw a session that is running this / these SQLs (s) to capture the lie.
    Or query V$ SQL_BIND_CAPTURE for the SQL when it runs.

    Hemant K Collette

  • programmatically set the bind view variable value of object that showed to the query Panel

    Hello

    I have a case in 11.1.1.7 Jdev, I deploy my application on BPM 11.1.1.7.

    I have a VO that three attributes of it was put in a viewcriteria... Let's attribute A1, A2, and A3. the view criteria is any condition "AND".

    and then I create a variable binding in the VO named b. my vo also query using this variable B.

    in the jspx, I create a query panel based on the viewcriteria. then in the A1, A2, A3 and B query pane shows.

    I can reset the Panel request programmatically using this tutorial http://www.jobinesh.com/2011/04/programmatically-resetting-and-search.html

    but unfortunately he didn't succeed for A1, A2, A3 because they are in the display criteria, but B can't reset.

    I tried to put the value programmatically using queryModel, queryDescriptor, setNamedWhereClauseParam, but this failed and it starts to makes me crazy...

    anyone here seen cases like me? and found the workaround? pls throw some light.

    Thank you

    Have you tried with VariableValueManager? http://www.jobinesh.com/2010/10/how-to-set-bind-variable-values-at.html

    Dario

  • 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

  • Refcursor bind variables

    Hi all

    I have a variable refcursor, to which I will assign running queries.

    All are defined (union) queries, with 5 or 6 selects the union, each select returns the same variable where clause. Value of the variable will be known at run time.

    For example: (just an example)

    {code}

    Start

    v_sql: = ' select col1, col2

    of the Department

    where dept_no =: 1

    Union

    Select col1, col2

    of eur_dept

    where dept_no =: 1

    Union

    Select col1, col2

    of us_dept

    where dept_no =: 1 ';

    Open the v_ref_cur for v_sql using 20, 20, 20;

    -rest of the logic

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

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

    end;

    {code}

    Question is how to avoid the bind variable value repeat (in the open statement). Is there a way I can mention value 20 only once when the cursor is opened.

    Thank you!

    DS says:

    Question is how to avoid the bind variable value repeat (in the open statement). Is there a way I can mention value 20 only once when the cursor is opened.

    Yes - can be done using a dynamic anonymous block to create the refcursor (containing the SQL text), as oppose to the creation of the refcursor directly from the SQL text.

    Not an approach I consider myself - unless there is absolutely no better way to address this particular issue.

    SQL > var refcursor c.

    SQL >

    SQL > declare

    News 2 sys_refcursor;

    3. start

    4 immediate execution

    5 ' declare

    6 varchar2 (4000) var1: =: 1;  -/ / simple definition var - used several times

    7. start

    open 8: news for

    9 select * from emp where mgr = var1

    10 the union all the

    11. Select * from emp where empno = var1;

    12 end; »

    13 using 7698-past the variable once

    14 in the news; -getting refcursor as answer

    15

    16: c: = cur;

    end 17;

    18.

    PL/SQL procedure successfully completed.

    SQL >

    SQL > print c

    EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR

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

    7499 ALLEN SALESMAN 7698 1981/02/20 00:00:00 1600 300 30

    7521 WARD SALESMAN 7698 1981/02/22 00:00:00 1250 500 30

    7654 MARTIN SALESMAN 7698 1981/09/28 00:00:00 1250 1400 30

    7844 TURNER SALESMAN 7698 1981-09-08 00:00:00 1500 0 30

    7900 JAMES CLERK 7698 1981/12/03 00:00:00 950 30

    7698 BLAKE MANAGER 7839 1981/05/01 00:00:00 2850 30

    6 selected lines.

    SQL >

  • Histograms and bind variables

    Hi guys,.
    When a SQL using bind variables histograms afftect the excution plan how?

    For example
    There is a table 'TEST' a column a number, varchar2 (100) b, c. tank (100).
    100000 rows in this table and the 90000 column rows a value is 1, the other value is 2-10 by 100rows.

    Now this column a histogram and a btree index only has on a;

    Here is sample code
    number of a_v var;
    exec: a_v: = 10;

    Select * from test where a =: a_v.

    The plan of the excution is full table scan.

    If I don't use of variable binding. It will scan the index.


    I remember that a document mentioned that "do not use histograms using bind variables.

    But why?

    I disabled same bind variable peeking?


    Thank you guys. Looking forward to your response.

    Longfei Wei says:
    Thanks Centinul this article is useful for me, but it is not explained why histograms do not work well with bind variables.

    Thanks again.

    Longfei,

    Jonathan Lewis article is very good - another look at this article. Histograms peuvent work with bind variable, but the end result is usually not the desired result. Bind variables are used to reduce the number of different execution plans. The histograms are used to find what is supposed to be the best execution plan for the predicates provided and in the case of the bind variables, those are peeked from the bind variable values. Thus, if you have a histogram on a column and for hard analysis of a SQL statement and the most common value in this column is presented in the binding variable - this execution plan is considered by the optimizer to be the 'best' execution plan for the bind variable values provided. Suppose now that instead the less popular value in the column is specified - the optimizer peut produce a very different for the same SQL statement execution plan, which is optimized for the less popular value (this can be a scan of the index systematic range, rather than a full table scan). Now suppose the execution plan may not change when change of variable values bind - if you have a single popular value and many unpopular values, if the analysis lasts is performed with the popular single value, you might find that all subsequent runs of this SQL statement to perform full table scans, even if only a few rows in the table are selected.

    Here's a quick test on the Oracle 11.2.0.2 database to demonstrate:

    CREATE TABLE T1 (
      C1 NUMBER,
      C2 NUMBER,
      C3 VARCHAR2(300));
    
    INSERT INTO
      T1
    SELECT
      *
    FROM
      (SELECT
        ROWNUM C1,
        DECODE(MOD(ROWNUM,100),99,99,1) C2,
        RPAD('A',300,'A') C3
      FROM
        DUAL
      CONNECT BY
        LEVEL <= 1000000)
    ORDER BY
      C2;
    
    CREATE INDEX IND_T1_C2 ON T1(C2);
    
    EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE,METHOD_OPT=>'FOR ALL INDEXED COLUMNS SIZE 254')
    

    The foregoing has created a table with 1 000 000 lines where 99% of the lines have a value of 1 in C2 and 1% have a value of 99, and lines are inserted with a perfect setting in cluster factor because of the ORDER BY clause. A histogram has been created on the indexed column.

    Let's try a test, we'll search a unpopular value 2 for the connection variable:

    VARIABLE N1 NUMBER
    EXEC :N1:=2
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    no rows selected
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 0
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ------------------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    ------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |      0 |00:00:00.01 |       3 |      1 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |      0 |00:00:00.01 |       3 |      1 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |      0 |00:00:00.01 |       3 |      1 |
    ------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    Thus, there is no selected row, the optimizer predicts that 5 957 lines would be returned and a path to the index has been selected. Path of this index would also be appropriate for the value of the bind variable 1? We will continue the trial, this time by choosing the 99 for the binding variable value:

    EXEC :N1:=99
    SET TIMING ON
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    ...
    10000 rows selected.
    
    Elapsed: 00:00:05.35
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 0
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |  10000 |00:00:00.02 |    1783 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |  10000 |00:00:00.02 |    1783 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |  10000 |00:00:00.01 |     690 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    Once more, the optimizer predicts 5 957 lines could be found even if 10,000 rows have been retrieved. Note also that the number of children is always 0. We will continue the trial, this time with the bind variable value of 1:

    EXEC :N1:=1
    
    SET AUTOTRACE TRACEONLY STATISTICS
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    990000 rows selected.
    
    Elapsed: 00:00:18.78
    
    Statistics
    ---------------------------------------------------
              1  recursive calls
              1  db block gets
         108571  consistent gets
              0  physical reads
             96  redo size
       21958348  bytes sent via SQL*Net to client
         726508  bytes received via SQL*Net from client
          66001  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         990000  rows processed
    
    SET AUTOTRACE OFF
    

    Because I used AUTOTRACE to prevent 990 000 lines scrolling on the screen, I have to specify the SQL_ID and CHILD_NUMBER to retrieve the execution plan:

    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',0,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 0
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |  10000 |00:00:00.02 |    1783 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |  10000 |00:00:00.02 |    1783 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |  10000 |00:00:00.01 |     690 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    Who can be the execution plan that was used because it shows that 10,000 rows have been retrieved. We will try again, this time with CHILD_NUMBER 1:

    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',1,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 1
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 3617692013
    
    ------------------------------------------------------------------------------------
    | Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |      1 |        |    990K|00:00:00.83 |     108K|
    |*  1 |  TABLE ACCESS FULL| T1   |      1 |    988K|    990K|00:00:00.83 |     108K|
    ------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter("C2"=:N1)
    

    The foregoing shows the actual plan that has been used. Sharing the adjustment slider (first available with Oracle Database 11.1) is reached and forced to re-evaluate the execution plan to avoid a very slow recovery through the index - which won't happen before 11.1 database Oracle.

    Just to illustrate:

    ALTER SESSION SET OPTIMIZER_FEATURES_ENABLE='10.2.0.4';
    
    VARIABLE N1 NUMBER
    EXEC :N1:=2
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    no rows selected
    
    Elapsed: 00:00:00.00
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 2
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |      0 |00:00:00.01 |       3 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |      0 |00:00:00.01 |       3 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |      0 |00:00:00.01 |       3 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    Note in the above that the CHILD_NUMBER is now 2.

    Continues:

    EXEC :N1:=99
    SET TIMING ON
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    10000 rows selected.
    
    Elapsed: 00:00:05.31
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 2
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |  10000 |00:00:00.02 |    1783 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |  10000 |00:00:00.02 |    1783 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |  10000 |00:00:00.01 |     690 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    The CHILD_NUMBER is always 2.

    Continues:

    EXEC :N1:=1
    
    SET AUTOTRACE TRACEONLY STATISTICS
    
    SELECT /*+ GATHER_PLAN_STATISTICS */
      C1,
      C2
    FROM
      T1
    WHERE
      C2 = :N1;
    
    990000 rows selected.
    
    Elapsed: 00:00:16.91
    
    Statistics
    ---------------------------------------------------
              0  recursive calls
              0  db block gets
         175927  consistent gets
              0  physical reads
              0  redo size
       21958348  bytes sent via SQL*Net to client
         726508  bytes received via SQL*Net from client
          66001  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         990000  rows processed
    
    SET AUTOTRACE OFF
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',2,'ALLSTATS LAST'));
    
    SQL_ID  c7su63uw7nch6, child number 2
    -------------------------------------
    SELECT /*+ GATHER_PLAN_STATISTICS */   C1,   C2 FROM   T1 WHERE   C2 =
    :N1
    
    Plan hash value: 236868917
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |      1 |        |    990K|00:00:01.63 |     175K|
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |      1 |   5957 |    990K|00:00:01.63 |     175K|
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C2 |      1 |   5957 |    990K|00:00:00.68 |   67932 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C2"=:N1)
    

    The foregoing is the execution plan for CHILD_NUMBER 2 - notice that this time he reports 990 000 recovered lines, it's the execution that was used - adaptive cursor sharing plan do not have take effect and force the re-evaluation of the implementation plan - implementation plan has NOT been changed for a full table scan. That's the risk you take if you allow histograms on columns that have an uneven distribution of values and bind variables are used in the WHERE clause that refers to the column.

    Charles Hooper
    Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
    http://hoopercharles.WordPress.com/
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • default values for VO bind variable

    Hi all

    I have a VO with bind variable year and month

    These variables have values as:


    year:

    cannot import

    DF = new SimpleDateFormat("yyyy")

    DF.format (ADF. CurrentDate)

    month:

    cannot import

    DF = new SimpleDateFormat ("MM")

    DF.format (ADF. CurrentDate)

    I have a table in my application this VO-based. I added these two variables as a counter entry number and a command button (ExecuteWithParams)

    The table is delivered with these variables dafult (2014 & 2). That's ok. Problem is that default values are not in the number of counters during the loading of the page.

    When I enter the new values (2014 & 1) and click the button, the new values to come and there is no problem...

    JDev version is 11.1.2.4

    Thank you...

    I find the solution as:

    In the pageDefinition file > binaries > ExecuteWithParams1_p_year > DefaultValue value as value: #{MyBean.year}

  • Get the value of the bind variable in backing bean class VO Impl

    Hello

    I have a VO that includes a bind "pOrgId" variable, the VO has a java VO Impl class that includes:

    /**
    * Returns the value of the variable to pOrgId.
    value of the variable * @return for pOrgId
    */
    public {getpOrgId() number
    return (Number) ensureVariableManager () .getVariableValue ("pOrgId");
    }

    So it is possible to obtain the value is concluded by the binding variable using this class in a backing bean? (I tried to import the VOImpl class in the bean to support, but getpOrgId is not available?).

    (JDEV 11.1.2.3.0)

    Concerning
    Carl

    Hello

    When you create a ViewObjectImpl class, none of these options is to generate the getter/setter for bind variable. Create a client class interface and expose the get method for the variable binding. Now, you can reference the method since a binding method in the ADF, which you then access a managed bean by calling

      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      OperationBinding oper = (OperationBinding) bindings.get("name of the method binding");
      Object returnVal = oper.execute();
    

    Frank

  • MB of Pass value to bind variable Groove

    Hello world. my version is 11.1.2.2

    I have a bean managed on the basis that contains two components of input (ex: name of user, pswd)
    I'm moving the input value to a query of VO that have variables bind with Groove. as adf.context.current...
    If it is possible, what is the expression to access the value of the bean components managed?

    THX

    Just follow this
    (1) for the vo, generate the VOImpl and when you create, select the variable bind method also
    (2) has the VOimpl who take a parameter, set the varialbe bind using the method and run the query method
    (3) expose this method as a customer interface
    (4) in the pagedefinition file, create an action method and select this method and have a binding method
    (5) of the managed bean, use the following code to execute the method

    OperationBinding operation = bindings.getOperationBinding("operation_name");
             operation.getParamsMap().put("parameter_name", parameterValue); /// this will be u r bind variable parameter
             operation.execute();
             if (operation.getResult() != null) {
                      Boolean result = (Boolean) operation.getResult(); // cast to the expected result type
            }
    
  • Comma Separated Values in Bind Variable

    Hello

    I'm on Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production.I use in query
    select * from employees where first_name in ('Ajay','Ajay5')
    It gives me two rows as it should. Now, I want to pass these values as a bind variable.
    select * from employees where first_name in :1
    Now when I run the query and make its contribution as a ('Ajay', 'Ajay5'). It gives me no line.

    Is their any way to do this. Let me know if you have any questions

    Thank you
    AJ

    Check out this link: the Blog of Tom Kyte: varying in lists...

  • Bind a value to a HTTPService to a variable

    Hi, I'm looking to bind a value to a HTTPService to a string variable. Here my HTTPService:

    "" < mx:HTTPService id = "GetVin" url = " http://127.0.0.1/vin.php" resultFormat = "e4x" useProxy = "false" result = "BindData (); "/ >

    [Bindable]
    private var description_var:String;

    private void BindData (): void {}
    description_var = GetVin.lastResult.vinlist.vin.description;
    }

    And my HTTPService result:

    <? XML version = "1.0" encoding = "ISO-8859-1? >
    < vinlist >
    < id wine = '1' description = 'test' > < / wine >
    < / vinlist >

    I can't find the way to have everything simply: description_var = 'test '.

    Thanks for your help!
    Mika

    Maybe try to change the XML to something like:



    1
    test

    HTH

  • Value data named to bind variables of Type table

    Hello

    I have a display object with a query that has a where clause, clause which use 'en' (e.g. Select projTitle PROJECT where PROJID in: projIds)

    'projIds' is a variable of type table of liaison.

    I'm moving in that variable binding expects (an array of projIds that can be used by the sql statement), and I did not. I'm calling a method in the bean to support the named child tag data from the action tag in the pageDef file links section.

    Can you give me the proper syntax and object Array as this variable binding will accept, please? Maybe I used the wrong NDType? I found a couple of different options, but none that I can make it work.

    The page definition file:

    < action IterBinding = "ProjPendingApprovalByApproverVO1Iterator" id = "loadPendingApproval".

    InstanceName = "SystemAMDataControl.RooProjIdArrayt.ApprovalAM1.ProjPendingApprovalByApproverVO1"

    DataControl = "SystemAMDataControl" RequiresUpdateModel = "true" Action = "executeWithParams" >

    < NamedData NDName = 'PROJID"NDValue =" #{dashboard.projIdArray} "NDType="oracle.jbo.domain.Array"/ >"

    < / action >

    Application of VO:

    SELECT ProjectEO.PROJ_ID,

    ProjUtnDtlEO.UTN_TYPE,

    ProjectEO.PROJ_SHORT_DESC,

    ProjUtnDtlEO.PROJ_DTL_ID,

    ProjectEO.PROJ_OWNER,

    VEmployeeInfoEO.FIRST_NAME,

    VEmployeeInfoEO.EMPLOYEE_ID,

    VEmployeeInfoEO.FIRSTNAMELASTNAME,

    VEmployeeInfoEO.LAST_NAME,

    VEmployeeInfoEO.LASTNAMEFIRSTNAME,

    ProjApprovalDecisionDtlEO.PROJ_APPROVAL_DECISION_DTL_ID,

    ProjApproverEO.PROJ_APPROVER_ID,

    ProjApproverEO.APPROVER_LEVEL,

    ProjApproverEO.APPROVER_NUMBER,

    ProjApproverEO.APPROVER_ROLE,

    ProjApprovalDecisionDtlEO.COMMENTS,

    ProjApprovalDecisionDtlEO.PROJ_APPROVAL_DECISION_ID,

    ProjApprovalDecisionDtlEO.LASTUPDATEDBY,

    ProjApprovalDecisionDtlEO.APPROVEDDATE,

    ProjectEO.SYS_STATUS,

    ProjApproverEO.LASTUPDATEDBY AS LASTUPDATEDBY1,

    ProjApprovalDecisionDtlEO.PROJ_APPROVAL_TYPE_ID,

    ProjStatusLkpEO.STATUS_DESC,

    ProjStatusLkpEO.PROJ_STATUS_ID,

    ProjectEO.PROJ_CATEGORY_ID,

    STRING. APPROVAL_DESC

    OF PTS. ProjectEO PROJECT,

    PTS. PROJ_UTN_DTL ProjUtnDtlEO,

    PTS. V_EMPLOYEE_INFO VEmployeeInfoEO,

    PTS. PROJ_APPROVAL_DECISION_DTL ProjApprovalDecisionDtlEO,

    PTS. PROJ_APPROVER ProjApproverEO,

    PTS. PROJ_STATUS_LKP ProjStatusLkpEO,

    PTS. Channel PROJ_APPROVAL_CHAIN_LKP

    WHERE ((ProjectEO.PROJ_ID = ProjUtnDtlEO.PROJ_ID (+))

    AND (ProjectEO.PROJ_ID = ProjApprovalDecisionDtlEO.PROJ_ID))

    AND (ProjectEO.PROJ_ID = ProjApproverEO.PROJ_ID)

    AND (ProjectEO.SYS_STATUS = ProjStatusLkpEO.SYS_STATUS)

    AND (ProjectEO.PROJ_OWNER = VEmployeeInfoEO.EMPLOYEE_ID)

    AND (ProjApprovalDecisionDtlEO.PROJ_APPROVER_ID = ProjApproverEO.PROJ_APPROVER_ID)

    and PROJAPPROVEREO. PROJ_APPROVAL_CHAIN_ID = STRING. PROJ_APPROVAL_CHAIN_ID

    AND (ProjApprovalDecisionDtlEO.PROJ_APPROVAL_DECISION_ID = 0)

    and PROJAPPROVEREO. APPROVER_LEVEL <>2

    and PROJAPPROVEREO. PROJ_ID in: PROJID

    Thank you!


    Please refer to http://www.jobinesh.com/2010/09/using-bind-variable-for-sql-statements.html?m=1 for an example of this.

    Timo

  • IN construction in the clause WHERE of VO with bind variable

    Hello
    With the help of JDev 11.1.1.3.0.
    I have a SQL according to VO following where clause ' WHERE some_nbr IN: inSomeNbrStr'
    -l' some_nbr attribute is of type oracle.jbo.domain.Number.
    -variable binding inSomeNbrStr is of type String.
    I'm assuming that this variable linking parameter to for example. "101, 102' or '(101, 102) ' before the execution of the query might work.
    "However, I get ' ORA-01722: invalid number." Other than the substitution of executeQueryForCollection() and manipulate by program the
    query is - anyone know a more declarative way to achieve this?
    Thank you
    Kenneth

    Hello

    You "MOUNT" the binding variable to get the values separated by commas.

    See this article (Search Using Comma-Separated bind string for the Variable in the list) on how to achieve this.

    It has been developed over 10g. But I think it will hold good for 11g as well.

    Arun-

  • Bind variables and dates

    I am writing a process to delete records based on dates.

    Here is the chart:

    Column name Data type Nullable Default Primary key
    IDNUMBERNO.-1
    CT_NAMEVARCHAR2 (100)Yes--
    CT_CATEGORYVARCHAR2 (100)Yes--
    BASE_PTSNUMBERYes--
    PROD_PTSNUMBERYes--
    REF_PTSNUMBERYes--
    START_DATEDATEYes--
    END_DATEDATEYes--
    CREATED_ONDATEYes--
    CREATED_BYVARCHAR2 (50)Yes--
    UPDATED_ONDATEYes--
    UPDATED_BYVARCHAR2 (50)Yes--

    start_date and end_date are the fields of date key.

    The query will remove the dates with specific start and end dates.  The question I have, is that I get a ORA-01858: a non-digit character was found here where was waiting for a digital error while the query is running.

    remove from ct_point_values

    where start_date =: P4_START_DATE_V

    and end_date =: P4_END_DATE_V

    If I run the query in the sql window, no problem:

    remove from ct_point_values

    where start_date =' 01 / 01/2014 '

    and end_date = 31 December 2014"

    Find the query with the works of values hard-coded.  Links to fail.  I tried casting and to_char to_date variations with no luck.

    One thing that I notice, is that when I go to enter my bind variables in the sql workshop, the fields are pre-populated with this:

    1 & amp; #x2F 1 & amp; #x2F; 2014

    12 & amp; #x2F 31 & amp; #x2F; 2014

    01/01/2014 and 31/12/2014.  I found that the only element relates to this suggests that this is a possible bug:

    SQL Bind Variables workshop - Date issues

    Any thoughts on how to address this issue, or is it really a bug?

    I run on Apex 4.2, 11g.

    Thank you!

    Hello

    I guess that these dates come from elements on the page to which the user can select a range of dates.

    These fields have a custom format mask?

    What seems to be the case for me, is that these fields have an explicit format mask (for example: DD/MM/YYYY) but the default database/session format mask is something different (e.g. DD-MON-YYYY).

    I suppose also that the issue in the SQL workshop isn't something related.

Maybe you are looking for

  • It cannot display the task - Virus bar/Manager?

    HelloThanks to toshiba for giving me the opportunity to speak with computernautes.Here's my question: I am running microsoft windows xp home edition with service PAC 2. until recently, I could access the Manager of tasks by the various today methods.

  • Replace T420s with a new SSD HARD drive

    Hello I wonderd if it is possible to replace with a new SSD HARD drive, while putting the HARD drive in the Bay of Ultra-slot. And if so, what SSD model should I buy, and how do I transfer the operating system and the data for the SSD? This SSD model

  • I can do something that would cause all the new sequence files to have the same local variables?

    I would like to add local or drop some variables global to all the new sequence files I create. I was hoping that I could simply add the variable to the process template and make it appear whenever I created a new sequence or in any order who have us

  • Call cold Microsoft TechnicalSupport

    A call center, which would have been the Support technique Microsoft, called me repeatedly telling me that my computer is infected with a virus that none of the antivirus software can detect.  The phone number on my caller ID was a few random digit -

  • HPc7250 printer all in one

    All the lights on the departure of C7250 blinking when turned off.  In this State, it's operational.  I have to unplug it and plug it in again.  This happens sometimes when the power is on.  In this case no buttons are operational, including the off