BC4J: Question on bind variables and DML in view objects

Hello,
I have a view object with a bind variable in the WHERE clause of the underlying query. I'm curious about how the state of this bind variable affects the use of the view object for inserting, updating, etc., at various stages of the commit cycle (before posting changes, after posting changes, after commit).
Specifically, what happens in the following scenarios?
1. The bind variable is not bound (and the query has not been executed) and a row is inserted into the VO
2. The bind variable is set to some value and an inserted or updated row in the VO does not meet the criteria specified by the bind variable; the transaction is then committed
If there is a weblog entry, help file, or HOWTO somewhere, I'd welcome a link to it.
Thanks,
Alan

The variable would only come into play when the VO's query is executed. It can be executed implicitly -- for example, accessing the first() row if the query hasn't been executed yet -- or explicitly by a call to executeQuery().
By setting setMaxFetchSize(0) on your VO, no rows will be fetched and you can use the VO for insert only.

Similar Messages

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

  • Question about session variables and binding

    Hi All,
    I'm a newbie with Application Express. I've gone through several tutorials and a book, and now I'm actually getting started with apex. My first adventure is a tiny little form, where all you do is fill it out and it sends an email. Pretty simple.
    And, i have it working just fine - but I have a question about something I don't quite understand. Basically, I am generating the email text in a page process. And some of the form fields work fine if i reference them as *:ACCT_NAME*, but some give me the dreaded "not all variables bound" error. For the ones that give me the error, I can reference them like V('ACCT_NAME').
    So, as a newbie, I'm a little confused. When is it appropriate to use the V function, and when it is appropriate to use binding? Why would one of the fields work with binding but not another from the same form?
    Thanks for any clarification you can offer,
    Lisa

    Lisa,
    A bind variable is a place holder variable available in an environment.It is used quite frequently(outside Apex Context) in SQL and PLSQL scripts and especially in Dynamic SQL statements.Many times using a bind variable gives better performance. In the Apex environment,page items and many other variables related to the session are available as bind variables and hence their value can be referred in SQL,PLSQL contexts as :VARIABLE_NAME.
    Now V() function is an apex specific function which returns the value of an apex session variable outside the apex environment. So as Machaan pointed out, it is used in
    procedures and triggers that gets called from within an apex session. This is required since the bind variables themselves are not directly available in the SQL environment but their values from the corresponding session can be accessed by this apex built-in function.
    The length of any Bind variable name is limited to 30 characters, this is a limitation inherited from Oracle SQL itself and hence session variables(page or application items) whose name has a length which exceeds 30 characters cannot be used as the :ITEM_NAME format. In such cases you would have to use the v() method again. This might be happening in your case.

  • Query With Bind Variables and %

    Hi,
    Quick question. I am using ADF BC on Jdev 11 with a MySQL Database.
    I've used Bind Variables in the past (I have to use a Question Mark [?]) and have had no problem.
    Now I want to do something like this in my where clause:
    SELECT TempTable.ABC FROM TempTable
    WHERE ABC LIKE ?%
    When I try and create the View Object with that query it is complaining about the %.
    Am I required to append the % in my bind variable? Any examples I have seen of this, people are doing something like :p_id = 'Jo%'

    Try
    like ? || '%'

  • View with Bind Variable and ADF table

    Hi all,
    Please note what i have noticed. I created a view with a bind parameter, overriden the prepareSession of my Application Module to set the bind parameter and execute the query. I then created a simple jsf page and included the view as an adf read-only table. When i run the page, the prepareSession is called, sets the bind parameter, however the selected record of the table is always the second record (Not the first record).
    This behaviour can be reproduced with the HR schema. Please follow the below instructions for reproducing the problem.
    1. Create a Fusion Web Application (ADF).
    2. Create business components from tables.
    3. Create a new connection with the HR schema.
    4. Import the Departments table as an entity and then click finish.
    5. Create a view based on the Departments entity.
    6. Modify the Query to include a where clause (where DDepartmentsEO.DEPARTMENT_NAME LIKE :BindParam)
    7. Provide an order by clause (DepartmentsEO.DEPARTMENT_ID DESC)
    8. Creata a bind variable named "BindParam" of type string.
    9. Create an Application Module and include the view object.
    10. Open the Application Module Class and override the prepareSession method
    11. include the following code after super.prepareSession(session):
    ViewObject myView = this.getDepartments1();
    myView.setNamedWhereClauseParam("BindParam", "%");
    myView.executeQuery();
    12. Create a jsf page
    13. Drag the view object on the page as an adf read-only table, selecting the Row Selection, Sorting and Filtering
    14. Run the page.
    You will see that instead of the first record being selected, the second record in the table is selected.
    Can anyone please help me?
    Thank you

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

  • Bind Variables and Shared Component Report Query

    I have a query in a region report which I have replicated to a shared component report query.
    Both queries reference page items as bind variables in the where clause.
    The report region on screen shows the correct results but the report query shows "no data". This is the case when running "Test Query" and "Download XML data" from the shared component report query definition. If I hardcode the variable names I get rows returned, If I use bind variables - and specify the values for these variables I get no data. THe XML file contains the tags for each bind variable I have specified but has no data between the tags. I have Ticked the box to include application and session state but it appears that the bind variables are not being used.
    When I use my report query in the application (URL tied to a button) I get the same problem, the binds are not being passed to the report query.
    Can someone please clarify if this is a bug or not? And if not, how can I get it to work.
    I am using Apex 4.0.2
    Thanks
    Kathryn

    Hi
    To confirm, yes I selected the bind variables. I used these in the report layout, but the xml file has them as empty i.e.
    <P0_START_DATE><P0_START_DATE/> with nothing in between.
    IN the Test Query section, if I put real values in the boxes for the bind variables, I get no data found. If I hardcode the values into the query, I get the data.
    I've repeated the create report query many times and have created a report layout in RTF. I can use the layout with my region - in the print attributes and the layout works with the query but I need to create a PDF using 2 queries - ROWSET1 and ROWSET2. I can generate the XML but the values in the rows are all empty. When I use the layout with a report query instead of the region, I get no data even though I have used the same sql and have selected the bind variables. I was using variables from page items on page zero but have also tried using page items on the current page, the result is the same.
    I need to use a report query and a report layout as I need data from 2 queries in the PDF.
    I looked at your demo - what happens if you add a second sql query to the report query - is there any chance I can look at the back end (developer access?)
    Thanks for your input
    Kathryn

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • BC4J bug with "bind variables" JBO-27122 ORA-01008

    I think we are found a BUG using BC4J with bind variables in a view object.
    If the bind variable appear in the WHERE condition two or more times at
    the beginning of the query the above error occur.
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
    SELECT Emp.EMPNO,Emp.ENAME,Emp.JOB,Emp.MGR,Emp.HIREDATE,Emp.SAL,Emp.COMM, Emp.DEPTNO
    FROM SCOTT.EMP Emp
    WHERE :1 <=10000 and :1 <= sal and :2=20
    java.sql.SQLException: ORA-01008: not all variables bound
    Otherwise if bind variable apper two or more times, but not together
    like this sample:
    WHERE :1 <=10000 and :2=20 and :1 <= sal
    the error not occur.
    We prove this with:
    JDeveloper 9.0.5.2 (build 1618)Business Components Version 9.0.5.16.0
    JDeveloper 9.0.5.0 (build 1375)Business Components Version 9.0.5.13.52
    I looking for a patch! or acceptable workaround.
    Tx for your help!
    diego.
    /* the cliente app */
    ApplicationModule am = Configuration.createRootApplicationModule("business_tier.AppModule","AppModuleLocal");
    ViewObject vo = am.findViewObject("EmpView");
    vo.setWhereClauseParam(0,"100");
    vo.setWhereClauseParam(1,"20");
    Row emp = vo.first();

    This is a known bug (1326006). The workaround is to use:
    vo.setWhereClauseParam(0,"100");
    vo.setWhereClauseParam(1,"20");
    vo.setWhereClauseParam(2,"20");
    Hope this helps,
    Lynn
    Java Tools Team

  • Bind variable and parameter problem

    Hello, I'm migrating a complex report from Oracle Report to BI Publisher. Now I have some problems with the bind variables. In order to explain the question clearly, I simplified the code as below. The value of e1 and sum1 can be generated correctly. The problem is that the value of e2 can not be generated.
    <dataTemplate name="dt" defaultPackage="dt">
         <properties>
              <property name="xml_tag_case" value="upper"/>
         </properties>
         <parameters>
         </parameters>
         <dataQuery>
              <sqlStatement name="q1">
                   <![CDATA[
    select     col1 c1, col2 c2, function1(:c1) e1,
    from     table1
    ]]>
              </sqlStatement>
              <sqlStatement name="q2">
                   <![CDATA[
    select     col3 c3, col4 c4, function2(:sum1) e2,
    from     table2
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="g1" dataType="varchar2" source="q1">
                   <element name="e1" dataType="number" value="e1"/>
              </group>
              <group name="g2" dataType="varchar2" source="q2">
                   <element name="sum1" function="sum" dataType="number" value="g1.e1"/>
                   <element name="e2" dataType="number" value="e2"/>
              </group>
         </dataStructure>
    </dataTemplate>I tried to replace the bind variable ":sum1" in the function2(:sum1) with a value, e.g. 5. And e2 can be generated correctly. So my guess is that ":sum1" is not correctly parsed to function2.
    Please help if you have any idea of what may cause the problem.
    Thank you in advance.

    Thank you. Now the problem is clear and it relates to the conversion of the report.
    I posted a new question in Report conversion compatibility problem (argument, formula and sum column) .

  • Getting Errors in PL/SQL - bad bind variable and encountered the symbol...

    CREATE OR REPLACE TRIGGER update_QOH
    AFTER INSERT ON ORDERLINE
    FOR EACH ROW
    DECLARE
         QOH_PRODUCT PRODUCT.QOH%TYPE;
    BEGIN
         SELECT QOH INTO QOH_PRODUCT FROM PRODUCT WHERE :old.product_no = :new.product_no;
         IF :new.QTY <= :old.QOH THEN
              QOH = :old.QOH - :new.QTY
         ELSE
              send_email(ord_no, 'Backorder');
              INSERT INTO BACKORDER (backorder_no_seq.NEXTVAL, :new.product_no, :new.qty, SYSDATE);
              INSERT INTO PRODVENDOR (po_no_seq.NEXTVAL, :new.vendor_no, :new.product_no, :new.vend_qty, :new.shipping_method, SYSDATE, NULL, NULL, NULL);
         END IF;
    END;
    Error(5,17): PLS-00049: bad bind variable 'OLD.QOH'
    Error(6,7): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ;
    Error(6,9): PLS-00049: bad bind variable 'OLD.QOH'

    Hi,
    Welcome to the forum!
    I see 4 mistakes:
    851543 wrote:
    CREATE OR REPLACE TRIGGER update_QOH
    AFTER INSERT ON ORDERLINE
    FOR EACH ROW
    DECLARE
         QOH_PRODUCT PRODUCT.QOH%TYPE;
    BEGIN
         SELECT QOH INTO QOH_PRODUCT FROM PRODUCT WHERE :old.product_no = :new.product_no;
         IF :new.QTY <= :old.QOH THEN
              QOH = :old.QOH - :new.QTY(1) The variable qoh isn't declared.
    (2) Did you mean the assignment operator, :=, rather than the equality operator, = ?
    (3) An assignment statement must end with a semi-colon.
         ELSE
              send_email(ord_no, 'Backorder');(4) The variable ord_no isn't declared.
              INSERT INTO BACKORDER (backorder_no_seq.NEXTVAL, :new.product_no, :new.qty, SYSDATE);
              INSERT INTO PRODVENDOR (po_no_seq.NEXTVAL, :new.vendor_no, :new.product_no, :new.vend_qty, :new.shipping_method, SYSDATE, NULL, NULL, NULL);
         END IF;
    END;
    /While you can reference :NEW and :OLD values in the trigger, it doesn't make any sense to reference the :OLD values. On an INSERT (which is the only time this trigger fires), all :OLD values are NULL.
    >
    Error(5,17): PLS-00049: bad bind variable 'OLD.QOH'
    Error(6,7): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ;
    Error(6,9): PLS-00049: bad bind variable 'OLD.QOH'I don't believe the code you posted is causing these errors. Each of the errors mentioned above would cause a different message. Post the actual code and error messages.
    Whenever you post a question, post all the code necessary for people to re-create the problem and test their ideas.
    In this case, that means CREATE statements for any tables or sequences involved, INSERT statements for any tables that need rows (such as product) as they exist before the INSERT, some INSERT statements for orderline, and the contents of all the tables after each of those INSERTs.
    Always say which version of Oracle you're using.

  • Bind variables and Dynamic sql

    I have this function which works only when i'm not passing bind variables. The moment i add bind variables it is not able to execute the function.
    Oracle Db Version: 8.1
    Thanks
    Source Code
    FUNCTION TestFunction( In_Test_id in Number,
    In_Asof in Date )
    Return ScoreType
    IS
    LvScore ABC.LV_SCORE.SCORE%TYPE;
    DVScore ABC.LV_SCORE.SCORE%TYPE;
    Begin
    EXECUTE IMMEDIATE
    'SELECT SCORE,DVSCORE
    FROM
    SELECT SCORE,DVSCORE
    DENSE_RANK() OVER (PARTITION BY TEST_ID ORDER BY ASOF_DT DESC) AS score_RANK
    FROM ABC.LV_SCORE
    WHERE TEST_ID = :x
    AND ASOF_DT <= :y
    ) WHERE score_RANK = 1'
    INTO LvScore,DVScore
    USING In_tEST_ID,In_Asof;
    Return ScoreType( LvScore,
    DVScore);
    End;

    It just keeps on executing for sometime and then disconnects itself from database What was the indication that told you that it disconnected? Was there a visible indication of this disconnect?
    Did you get ORA-03113?
    ===========================================
    ORA-03113: end-of-file on communication channel
    Cause: The connection between Client and Server process was broken.
    Action: There was a communication error that requires further investigation. First, check for network problems and review the SQL*Net setup. Also, look in the alert.log file for any errors. Finally, test to see whether the server process is dead and whether a trace file was generated at failure time.

  • How to update bind variable and restrict values in a Model Driven LOV?

    Hi Guys,
    Using JDev 11.1.1.2.0
    I've recreated an excellent Frank Nimphius article about restricting values derived from a model driven LOV (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf)
    But my bind variable isn't updating. Deleting the bind variable gets me the entire LOV. Activate the code below and insert a bind variable into the where clause like Frank says and I get nothing back. Bind variable is blank. Any ideas? Code wasn't supplied with the article. It seems simple enough but the bind variable isn't updating in the SQL, even though the updated value shows up here...
      public void onLovLaunch(LaunchPopupEvent launchPopupEvent)
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DepartmentId");
        lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("deptId","60");
        System.out.println("lov name: " + lov.getName().toString());
        System.out.println("lov Param Attrs: " + lov.getListIterBinding().getViewObject().getNamedWhereClauseParams().getAttribute("deptId").toString());
        System.out.println("lov View Object: " + lov.getListIterBinding().getViewObject().getName().toString());
        System.out.println("lov IterBinding: " + lov.getListIterBinding().getName().toString());
       }Gets me ...
    lov name: DepartmentId
    lov Param Attrs: 60
    lov View Object: _LOCAL_VIEW_USAGE_lov_model_queries_EmployeesView_DepartmentsView
    lov IterBinding: DepartmentIdList_2

    That's a good idea, but it's still not working. Here is how I implemented it. It might be different from your suggestion as I'm still pretty new to this.
    I have a recursive tree table. You select a node. You then click a button which calls the listener below. "findParents" is a method call to the AppModuleImpl class and it finds all parent nodes of your selection. "restrictPartBomLOV", also of the AppModuleImpl class, then modifies the model driven lists' View Object (partBomLOV) to exclude those parent node values.
    The resulting model driven LOV on the popup should be updated, yeah? But it still isn't udpating. If I manually type in the updated Where clause in PartBomLOV.xml query tab, it works, but it doesn't programmatically.
      public void insertPopupFetchListener(PopupFetchEvent popupFetchEvent)
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("findParents");
        parents = (List)operationBinding.execute();
        operationBinding = bindings.getOperationBinding("restrictPartBomLOV");
        operationBinding.execute();
       public void restrictPartBomLOV(List parents)
          ViewObjectImpl vo = getPartBomLOV();
          String wcl = "";
          Object[]   p = parents.toArray();
          for(int i = 0; i < p.length; i++)
             if (i == 0)
                wcl = wcl + "PNUM <> '" + p.toString() + "'";
    else
    wcl = wcl + "AND PNUM <> '" + p[i].toString() + "'";
    vo.setWhereClause(wcl);
    System.out.println(vo.getWhereClause().toString());
    vo.executeQuery();
    Edited by: LovettWB on Nov 11, 2010 11:23 PM

  • ADF Groovy Expression with bind variable and ResourceBundle

    Now I have ViewObject which have WHERE clause with bind variable.
    This bind variable is for language. Within bind variable I can change Value Type to Expression and into Value: I put +(ResourceBundle.getBundle("model.ModelBundle")).getString("language")+.
    Now if I run Oracle Business Component Browser (on AppModule) this works. In my ModelBundle.properties there is language=1 name-value pair. And with different locale I have different language number.
    Now if I put that ViewObject on one JSF, this bind variable expression does not work any more. Error:
    *oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.util.MissingResourceException, msg=Can't find bundle for base name model.ModelBundle, locale my_locale*
    Any ideas?
    10x
    Zmeda

    The most wierd thing is that, if I make ViewObjectImpl and insert this method
    public String getLanguage() {
    return (ResourceBundle.getBundle("model.ModelBundle")).getString("language");
    and call it in Bind Variable Expression Value: viewObject.getLanguage()
    IT WORKS!
    But why with groovy expression it does not work?
    Zmeda

  • Bind variable and normal variable/parameter

    Hi all
    In many references it is common suggestion to use bind variable in SQL query for better performance. In oracle forms if we write query we use bind variable usually like as below:
    select emp_name
    from hr_employee
    where emp_no = :emp_no;
    But if we use backend function, we send the employee number through parameter and in backend function the query is as below
    select emp_name
    from hr_employee
    where emp_no = pEmpNo; --- IN Parameter
    Does this query get facility as bind variable??
    Thanks in advance.
    Mokarem.

    You may check Bind Variables for reference.
    String literals are usually not automatically converted to binds, unless (and only in certain circumstances)cursor_sharing is enabled.

  • Bind variable and parse_call

    if i use a bind variable in sql will it reduce the values of column parse_calls in v$sqlarea?
    i am using bind variable in the following statement
    declare
    y number;
    begin
    :x:=101;
    select salary into y from hr.employees where employee_id=:x;
    end;
    but subsequent execution of the pl/sql code shows an increase in parse_call column values
    why its so.
    if i am using a bind variable the parse_calls should be reduced.
    i am using oracle 9.2

    To reduce the number of parse calls, you must hold cursors open. It is important to distinguish between a hard parse, a soft parse, and a session cursor cache hit. Using bind variables helps reduce the frequency of hard parses, where among other things memory is allocated to add a SQL statement to the library cache. Effectively using the SESSION_CACHED_CURSORS parameter helps reduce the number of soft parses, which among other things involve syntax and security checking, as well as obtaining the library cache latch to search for an already parsed and optimized version of the SQL statement. I would suggest taking a look at the following link and reading down through to the section "Reducing Parse Calls with Oracle Forms":
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10821/memory.htm#i34608
    Also, take a look at the following Oracle Magazine article, specifically the section describing Execute to Parse:
    http://www.oracle.com/technology/oramag/oracle/09-sep/o59asktom.html
    Now a test case to possibly see what happens:
    The set up:
    CREATE TABLE T1 (EMPLOYEE_ID NUMBER);
    INSERT INTO T1
    SELECT
      ROWNUM
    FROM
      DUAL
    CONNECT BY
      LEVEL<=1000;
    COMMIT;
    VARIABLE X NUMBERNow the test case:
    EXEC :X:=10
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             10
    SELECT
      HASH_VALUE,
      CHILD_NUMBER,
      PARSE_CALLS,
      EXECUTIONS
    FROM
      V$SQL
    WHERE
      SQL_TEXT='SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X';
    HASH_VALUE CHILD_NUMBER PARSE_CALLS EXECUTIONS
    4179534647            0           1          1
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             10
    SELECT
      HASH_VALUE,
      CHILD_NUMBER,
      PARSE_CALLS,
      EXECUTIONS
    FROM
      V$SQL
    WHERE
      SQL_TEXT='SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X';
    HASH_VALUE CHILD_NUMBER PARSE_CALLS EXECUTIONS
    4179534647            0           2          2
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             10
    SELECT
      HASH_VALUE,
      CHILD_NUMBER,
      PARSE_CALLS,
      EXECUTIONS
    FROM
      V$SQL
    WHERE
      SQL_TEXT='SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X';
    HASH_VALUE CHILD_NUMBER PARSE_CALLS EXECUTIONS
    4179534647            0           3          3
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             10
    SELECT
      HASH_VALUE,
      CHILD_NUMBER,
      PARSE_CALLS,
      EXECUTIONS
    FROM
      V$SQL
    WHERE
      SQL_TEXT='SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X';
    HASH_VALUE CHILD_NUMBER PARSE_CALLS EXECUTIONS
    4179534647            0           4          4
    COLUMN NAME FORMAT A27
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      MS.STATISTIC#=SN.STATISTIC#
      AND SN.NAME LIKE 'session cursor cache%';
    NAME                             VALUE
    session cursor cache hits         1111
    session cursor cache count         148
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             10
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      MS.STATISTIC#=SN.STATISTIC#
      AND SN.NAME LIKE 'session cursor cache%';
    NAME                             VALUE
    session cursor cache hits         1112
    session cursor cache count         149
    EXEC :X:=20
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      MS.STATISTIC#=SN.STATISTIC#
      AND SN.NAME LIKE 'session cursor cache%';
    NAME                             VALUE
    session cursor cache hits         1112
    session cursor cache count         149
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             20
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      MS.STATISTIC#=SN.STATISTIC#
      AND SN.NAME LIKE 'session cursor cache%';
    NAME                             VALUE
    session cursor cache hits         1114
    session cursor cache count         150
    EXEC :X:=30
    SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X;
    EMPLOYEE_ID
             30
    SELECT
      SN.NAME,
      MS.VALUE
    FROM
      V$MYSTAT MS,
      V$STATNAME SN
    WHERE
      MS.STATISTIC#=SN.STATISTIC#
      AND SN.NAME LIKE 'session cursor cache%';
    NAME                             VALUE
    session cursor cache hits         1116
    session cursor cache count         150
    SELECT
      HASH_VALUE,
      CHILD_NUMBER,
      PARSE_CALLS,
      EXECUTIONS
    FROM
      V$SQL
    WHERE
      SQL_TEXT='SELECT EMPLOYEE_ID FROM T1 WHERE EMPLOYEE_ID= :X';
    HASH_VALUE CHILD_NUMBER PARSE_CALLS EXECUTIONS
    4179534647            0           7          7In the above, the first execution caused a hard parse, which is not obvious from the V$SQL output. The second execution was a soft parse, as was the third. The fourth execution was satisfied by the session cursor cache (unfortunately, I did not capture the number of session cursor cache hits before the fourth execution). After the seventh execution, V$SQL still shows the number of PARSE_CALLS is equal to the number of EXECUTIONS, but the last four executions were satisfied without obtaining the library cache latch as would be required by a soft parse.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

Maybe you are looking for

  • Can't open songs once transferred to new computer. Please help!

    Hello I followed the helpful advice on these boards and used an external hard drive to transfer my iTunes library from an old PC to an new one. My problem now is I see the songs the songs in my music folder but it seems that I would have to import th

  • CS3 and camera raw for Nikon D5000

    I have dowloded the 4.6 plug in (installed automaticallywith updater). I still can not open my raw images in cs3.  Is the Nikon D5000 only supported by cs4?

  • Stuck on restore screen cannon restore phone

    i got this iphone from a friend (its a 3g1203) and its been working well ever since i got it. the other day i noticed it was working extremely slow and not opening files so i decided to restore it. thats when the real trouble started. it will restore

  • Oracle startup with Windows

    We have Oracle 10g (x64) installed on a Windows XP Pro x64 computer, along with ASM. When the computer reboots, both instances start up, but the database instance doesn't actually open the database on startup. So far, I've checked some registry setti

  • IOS for MPLS on 1800 & 2600 series router

    Hi, What IOS version to be on 1800 & 2600 series routers to support MPLS