How to use sql "IN" operator with named bind variable in where clause ?

Can one bind variable be used for the "IN" list ('1','2','3') ?

rob,
No worries. Glad it helped. Glad to see also that you're doing things right and trying to use bind variables ;)
May I suggest adding "SOLVED" to the title of the original post?
Best,
John

Similar Messages

  • How do I refresh a table with a bind variable using a return listener?

    JDev 11.1.2.1.0.
    I am trying to refresh a table with a bind variable after a record is added.
    The main page has a button which, on click, calls a task flow as an inline document. This popup task flow allows the user to insert a record. It has its own transaction and does not share data controls.
    Upon task flow return, the calling button's return dialog listener is invoked which should allow the user to see the newly created item in the table. The returnListener code:
        // retrieve the bind variable and clear it of any values used to filter the table results
        BindingContainer bindings = ADFUtils.getBindings();
        AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("pBpKey");
        attr.setInputValue("");
        // execute the table so it returns all rows
        OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
        operationBinding.execute();
        // set the table's iterator to the newly created row
        DCIteratorBinding iter = (DCIteratorBinding) bindings.get("AllCustomersIterator");
        Object customerId = AdfFacesContext.getCurrentInstance().getPageFlowScope().get("newCustomerId");
        iter.setCurrentRowWithKeyValue((String)customerId);
        // refresh the page
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getFilterText());
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getCustomerTable());But the table does not refresh ... The bind variable's inputText component is empty. The table flickers as if it updates. But no new values are displayed, just the ones that were previously filtered or shown.
    I can do the EXACT SAME code in a button's actionListener that I click manually and the table will refresh fine. I'm really confused and have spent almost all day on this problem.
    Will

    Both options invoke the create new record task flow. The first method runs the "reset" code shown above through the calling button's returnListener once the task flow is complete. The second method is simply a button which, after the new record is added and the task flow returns, runs the "reset" code by my clicking it manually.
    I'm thinking that the returnListener code runs before some kind of automatic ppr happens on the table. I think this because the table contents flicker to show all customers (like I intend) but then goes back to displaying the restricted contents a split second later.
    Yes, the table is in the page that invokes the taskflow.
    Here are some pictures:
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step1.jpg
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step2.jpg
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step3.jpg
    Step1 - invoke new record task flow
    Step2 - enter data and click Finish
    Step3 - bind parameter / table filter cleared. Table flickers with all values. Table reverts to previously filterd values.

  • How to use SQL filtercondition 'Start with' and 'connect by' in ADF's LOV?

    Hello every!
    I can not use 'Start with' and 'connect by' with parameter in creating ADF's LOV?
    How could I do with it?
    Alex

    assuming you are using adf 11g,
    You need to use View Criteria with the View Object attribute that has a LOV model.
    Follow this, to get some idea http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-oracle-adf-11g-update.html
    hope this helps,

  • How to use sql to compare with session value?

    can any 1 tell me these statement have any problem:
    String query_rocky = "SELECT cust_no, cust_name, street,town FROM Customers where cust_no = <%session.getAttribute("sessionFlag")%>";
    below is my code
    <%@page contentType="text/html"%>
    <HTML>
    <HEAD><TITLE>Customer Order Details</TITLE></HEAD>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    <%@ page import="java.io.*, java.sql.*"%>
    <BODY>
    <CENTER>
    <H3>Customer Order Details</H3>
    <TABLE BORDER="1">
    <%
    try {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection connection = DriverManager.getConnection("jdbc:odbc:rocky");
         Statement statement = connection.createStatement();
         String query_rocky = "SELECT cust_no, cust_name, street,town FROM Customers where cust_no = <%session.getAttribute("sessionFlag")%>";
         ResultSet resRocky = statement.executeQuery(query_rocky);
    while(resRocky.next()){
         int cust_no = resRocky.getInt("cust_no");
         String cust_name = resRocky.getString("cust_name");
         String street = resRocky.getString("street");
         String town = resRocky.getString("town");
    %>
    <TR>
         <TR><TH>Cust no.</TH><TD><%= cust_no %></TD>
         <TR><TH>Name</TH><TD><%= cust_name %></TD>
         <TR><TH>&nbsp</TH><TD><%= street %></TD>
         <TR><TH>&nbsp</TH><TD><%= town %></TD>
    </TR>
    <%
    }// while
    }catch (ClassNotFoundException cnfe){
    System.err.println(cnfe);
    }catch (SQLException ex ){
    System.err.println( ex);
    }catch (Exception er){
    er.printStackTrace();
    %>
    </TABLE>
    </CENTER>
    </BODY>
    </HTML>

    Hi,
    You gotta cast the session variable.
    Ex: (String) session.getAttribute("message")
    also the code should be;
    String customNo = (String) session.getAttribute("sessionFlag");
    String query_rocky = "SELECT cust_no, cust_name, street,town FROM Customers where cust_no = '" + customNo + "';";
    Rajesh

  • How to use SQL String functions with JPA and SAP NW

    Hi Everyone,
    I'm recently got the following problem:
    I have a Web Service project using JPA. But as i found out SAPs JPA implementation or more precisely openSQL restricts the use of the LOWER() function, which converts a String to lower case.
    Now I am looking for some sort of workaround. I want to execute the following JPQL query:
    SELECT bp FROM BusinessPartner bp WHERE LOWER(bp.companyName) LIKE LOWER(:companyName)
    I assume there is somewhere a flag to disable this restrictions, because there might be cases, like mine, where this standard functions are needed.
    Kind Regards,
    Carl

    Hi Vladimir,
    no it's not the same issue, because I am asking for a solution for this problem. There have to be ways to bypass this. Otherwise you can't use JPA properly. This is too much of a restriction!
    Is there no possibility to change to another implementation than openSQL?
    Regards,
    Carl
    Edited by: Carl Simon Heckmann on Feb 2, 2009 2:26 PM

  • Use of CS operator in SELECT... WHERE clause not allowed

    Hi all gurus,
    quite a dumb question, but since I'm facing the issue... I need to access a standard DB table with some selection criteria , in particular I'd like to extract all the entries where the field NAME contains a specific substring.
    Since the CS operator seems not to be supported as far as the compiler tells, what's the best (efficient/effective) way to perform such a task?
    Thanks,
    M.

    Keshav.T wrote:
    Range table
    Thanks Keshav, I hoped there's an alternative way to do that without using range structures/tables... and also, to overcome the case sensitive problem.
    I'd go for that if no alternative arise.

  • Date Effective SDO and named bind variable

    Hi.
    I have a problem with named bind variable in date effective ADF Business Component (:Bind_SysEffectiveDate).
    Service interface of my EmployeeHistorySDO has next methods:
    getEmployeeHistoryView1
    updateEmployeeHistoryView1
    findEmployeeHistoryView1
    createEmployeeHistoryView1
    deleteEmployeeHistoryView1
    If I invoke getEmployeeHistoryView1 method I'm getting next SQL statement:
    [332] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [333] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [334] Column count: 7
    [335] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [336] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [337] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [338] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [339] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [340] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [341] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [342] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, null)
    [343] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, null)
    [344] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(fbkKy__0, 3)
    [345] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, 2010-10-01)
    [346] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [347] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [348] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.execute caused params to be "un"changed
    [349] Column count: 7
    [350] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [351] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [352] executeQueryForCollection ViewObject:EmployeeHistoryView_0_findByKey_, RowSet:EmployeeHistoryView_0_findByKey_
    [353] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ close prepared statements...
    [354] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ Created new QUERY statement
    [355] EmployeeHistoryView_0_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
    [356] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    [357] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
    [358] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_
    [359] Binding param "SysEffectiveDateBindVar": 2010-10-01
    [360] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
    [361] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01"); // JBO-JDBC-INTERACT
    [362] Binding param "fbkKy__0": 3
    [363] // ERROR: Unknown data type oracle.jbo.domain.Number // JBO-JDBC-INTERACT
    [364] pStmt.setObjectAtName(fbkKy__0, "3"); // JBO-JDBC-INTERACT
    Environment successfully binds today date to :SysEffectiveDateBindVar.
    But if I try to invoke updateEmployeeHistoryView1 method environment binds already the variable that doesn't presents in SQL query, so I have an exception:
    [606] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [607] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, Bind_SysEffectiveDate, 2010-10-01 00:00:00.0)
    [608] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [609] executeQueryForCollection ViewObject:EmployeeHistoryView_1_findByKey_, RowSet:EmployeeHistoryView_1_findByKey_
    [610] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close prepared statements...
    [611] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ Created new QUERY statement
    [612] EmployeeHistoryView_1_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
    [613] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    [614] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
    [615] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_
    [616] Binding param "SysEffectiveDateBindVar": 2010-10-01
    [617] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
    [618] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01");  // JBO-JDBC-INTERACT
    [619] Binding param "Bind_SysEffectiveDate": 2010-10-01 00:00:00.0
    [620] // ERROR: Unknown data type java.sql.Timestamp // JBO-JDBC-INTERACT
    [621] pStmt.setObjectAtName(Bind_SysEffectiveDate, "2010-10-01 00:00:00.0");  // JBO-JDBC-INTERACT
    [622] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close single-use prepared statements
    [623] pStmt.close(); // JBO-JDBC-INTERACT
    [624] QueryCollection.executeQuery failed...
    [625] java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:11178)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:815)
         at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName(Unknown Source)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4655)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3645)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:19288)
    In Fusion Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) at chapter 5.2 says that environmnet uses :Bind_SysEffectiveDate bind variable for passing effective date for Date Effective Business Components. But I see that in my case :SysEffectiveDateBindVar bind variabe is used for get method and both variables are used in update method.
    Why environment trying to bind :Bind_SysEffectiveDate if only :SysEffectiveDateBindVar is present in the query ? How can I solve this problem ?
    I'm using
    Oracle JDeveloper Studio Edition Version 11.1.1.3.0
    WebLogic Server Version: 10.3.3.0
    Oracle SOA Suite 11.1.1.
    Edited by: user2975420 on 01.10.2010 6:26

    As I understood ApplicationModule.EFF_DT_PROPERTY_STR is used to pass the value of SysEffectiveDate. This means that this value will bind to variable that present in query filter (:Bind_SysEffectiveDate).
    If this property is not set, the current date value binds to :Bind_SysEffectiveDate variable.
    But the reason of my problem is another.
    When I create date effective entity and date effective view object for this entity the query of VO is next (I see this query in query editor in JDeveloper):
    SELECT EmployeeHistory.HISTORY_ID,
    EmployeeHistory.POSITION,
    EmployeeHistory.WAGE,
    EmployeeHistory.EMPL_ID,
    EmployeeHistory.START_DATE,
    EmployeeHistory.END_DATE
    FROM EMPLOYEE_HISTORY EmployeeHistory
    WHERE (:Bind_SysEffectiveDate BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    But when I invoke getEmployeeHistoryView1 method of view object service interface, the query which I see in log is next:
    SELECT EmployeeHistory.HISTORY_ID,
    EmployeeHistory.POSITION,
    EmployeeHistory.WAGE,
    EmployeeHistory.EMPL_ID,
    EmployeeHistory.START_DATE,
    EmployeeHistory.END_DATE
    FROM EMPLOYEE_HISTORY EmployeeHistory
    WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0)
    AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    Bind variable for SysEffectiveDate has *:SysEffectiveDateBindVar* name now instead of *:Bind_SysEffectiveDate*. But method invokes successfully.
    When I invoke updateEmployeeHistoryView1 environmet already tryes to bind *:Bind_SysEffectiveDate* variable that doesn't present in query. So I have exception:
    java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
    I'm not understanding why environment binds :Bind_SysEffectiveDate parameter which doesn't present in query.

  • How to Use SQL Query having IN Clause With DB Adapter

    Hi,
    I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
    Thanks

    invoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter

  • How to numberformat when using sql:query alogn with c:forEach JSTL tags

    Is there anyway to format the numeric values returned from the database when using <sql:query> alogn with <c:forEach> tags
    Here is my jsp code
    <sql:query..../>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td><c:out value="${row.COL1}" /></td>
    <td><c:out value="${row.COL2}" /></td>
    </tr>
    </c:forEach>
    Col1 values are numeric without any formats Eg: 1000, 10000, 1000000 etc.
    how can i format them to 1,000 , 10,1000 , 100,000 etc

    It is polite to mention what your answer was. These posts are not just here for you to ask questions, but to be used as a resource for other people to find answers. Saying "I solved it" with no details helps noone.
    I presume you discovered the JSTL <fmt:formatNumber> tag?

  • How to use Sql Tracer

    Hi ,
    How to use SQL Tracer..(ST05).
    Thanks,
    Subbu

    Hi,
    ST05: SQL trace
    1.create a small ABAP/4 program that contains only the select statement. Before proceeding, test it to ensure that it works.
    2.Open that program in the editor so that it is ready and waiting to execute.
    3.Open a new session using the menu path System->Create session.
    4.Run transaction ST05 (enter /nst05-zero-five, not oh-five-in the Command field, or choose the menu path System->Utilities->SQL Trace). The Trace SQL Database Requests screen is displayed.
    5.If the Trace SQL Status Information box reads Trace SQL is switched off, go to step 7.
    6.At this point, the Trace SQL Status Information box contains Trace SQL switched on by, followed by the user id who turned on the trace and the date and time it was started. You must switch it off before you can proceed. If the trace was started within the past hour, it is possible that it is still being used. Contact the indicated user or try again later. If the trace was started hours or days ago, the user probably left it on by mistake and it can be safely turned off. To turn off the trace, press the Trace Off pushbutton. The message in the Trace SQL Status Information box should now read Trace SQL is switched off.
    7.Press the Trace On pushbutton. The Trace SQL Database Requests dialog box is displayed. The DB-Trace for User field should contain your user ID. If your user ID is not in this field, enter it now.
    8.Press the OK button. You are returned to the Trace SQL Database Requests screen and the status information reads Trace SQL switched on by, indicating that you turned on the trace.
    9.Switch back to the window containing your editor session (the one with your program waiting to execute).
    10.Press F8 to run your program. (Only press F8, do not do anything else, do not even press the Back button.)
    11.When your program has run and the hourglass is no longer displayed, switch back to the trace window.
    12.Press the Trace Off pushbutton. The status information reads Trace SQL is switched off.
    13.Press the List Trace pushbutton. The Trace SQL Database Requests dialog box is displayed. The fields on this screen will already contain values.
    14.Press the OK button. You might need to wait a little while, at most a couple of minutes. The Trace SQL: List Database Requests screen is displayed.
    15.Type %sc in the Command field and press the Enter key. The Find dialog box is displayed.
    16.Type the name of the table you are tracing in the Search For field. (This is the table named in the select statement in your ABAP/4 program.)
    17.Press the Find button. A search results list should be displayed with your table name highlighted.
    18.Click on the first highlighted table name. You are returned to the Trace SQL: List Database Requests screen. Your cursor is positioned on the first line containing your table name. To the right of it, in the Operation column, should be the word PREPARE, OPEN, or REOPEN.
    19.Press the Explain SQL button on the Application toolbar. The Show Execution Plan for SQL Statement screen is displayed.
    20.Scroll down to the execution plan. The index used will be displayed in blue.
    Jogdand M B

  • How to use List of values with bind variables on item?

    Hi
    I made a dynamic list of values with a bind variable as a provider. I tried to run the list, and it worked fine - i filled inn the bind variable when asked for, and i got a list of values to choose from.
    I would very much like to use this list of values as an attribute on a custom made item. My wish is that when creating the item you someplace write the bind variable, and the list will then turn up as wanted. (I could f.ex add the variable as an attribute on the page type)
    I tried to create a custom attribute and assign the list of values to it. It created an error when I then tried to add the attribute to the item.
    Does anyone have any idea on how to solve this?
    Any help appreciated!
    Maja R. Anjer

    Hi
    i am getting error as
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT meaning, lookup_code,lookup_type
    FROM fnd_lookup_values
    WHERE view_application_id = 200) QRSLT WHERE (lookup_type=:1 AND ( UPPER(MEANING) like :2 AND (MEANING like :3 OR MEANING like :4 OR MEANING like :5 OR MEANING like :6)))
    Thanks
    Mateti

  • Execute PL/SQL block with named binds from within java code?

    Hi guys,
    Is there any good way to execute my PL/SQL code, for example
    BEGIN         :x := :x+1; END;
    from my Java code? I need nothing complicated, just static code block with named binds.
    I have tried the Oracle exetnded JDBC (setXXXbyName methods):
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password"); String SQL="begin :x:=:x+1; end;"; OracleCallableStatement stmt; stmt=(OracleCallableStatement)conn.prepareCall(SQL); stmt.setIntAtName("x", 5); stmt.registerOutParameter("x", Types.INTEGER); stmt.execute(); System.out.println(stmt.getInt("x"));     } catch (Exception x) { x.printStackTrace();    }   }
    And get the java.sql.SQLException: operation not allowed: Ordinal binding and Named binding cannot be combined!
    Then i've tried SQLJ appoach:
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password");       Oracle.connect(conn);       System.out.println("Connected!");           int x=3;       #sql { BEGIN         :x := :x+1;       END; };           System.out.println("x=" + x);     } catch (Exception x) { x.printStackTrace();    }   }
    And x=3 had retuned... Although 4 expected.
    Then, I've set parameter sqlj.bind-by-identifier=true
    And result is another exception! java.sql.SQLException: Missing IN or OUT parameter at index:: 2
    Can you please mark my mistakes/point to correct solution?
    Thanks in advance,
    Alexey

    Found another solution, this time working at least...
      public void testPLSQL() {
           String dynamicSQL=
                "declare\n" +
                "  v_CursorID  INTEGER;\n" +
                "  v_BlockStr  VARCHAR2(500);\n" +
                "  v_Dummy     INTEGER;\n" +
                "  v_x         String(18);\n" +
                "BEGIN\n" +
                "  v_CursorID := DBMS_SQL.OPEN_CURSOR;\n" +
                "  v_BlockStr :=?;" +
                "  DBMS_SQL.PARSE(v_CursorID, v_BlockStr, DBMS_SQL.V7);\n" +
                "  v_x:=?;"+
                "  DBMS_SQL.BIND_VARIABLE(v_CursorID, ':x', v_x,18);\n" +
                "  v_Dummy := DBMS_SQL.EXECUTE(v_CursorID);\n" +
                "  DBMS_SQL.VARIABLE_VALUE(v_CursorID, ':x', v_x);\n" +
                "  DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "  ?:=v_x;"+
                "  COMMIT;\n" +
                "EXCEPTION\n" +
                "  WHEN OTHERS THEN\n" +
                "    DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "    RAISE;\n" +
                "END DynamicPLSQL;";
             try {
                   Class.forName("oracle.jdbc.driver.OracleConnection");
                   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user", "password");
                   System.out.println("Profit");
         String SQL="begin :x:=:x+1; end;";
         OracleCallableStatement stmt;
         stmt=(OracleCallableStatement)conn.prepareCall(dynamicSQL);
         stmt.setString(1, SQL);
         int x=3;
         stmt.setInt(2, x);
         stmt.registerOutParameter(3,     Types.INTEGER);
         stmt.execute();
         x=stmt.getInt(3);
         System.out.println(x);
         assertEquals(4, x);
             } catch (Exception ex) {
                  ex.printStackTrace();
                  assertTrue(false);
      }Now the only thing I need is to code some kind of preprocessor of SQL block, to prepare the dynamicSQL lair for SQL critter...
    Please please please show me something less complicated! :8}

  • How to use Two main windows with in a page in script ?

    Hi any body explain me...
    How to use Two main windows with in a page in script ?
    with  header data in one main window,
    & Item data in other main window.

    HI..,
    u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
    Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
    Here is the procedure !!
    -->Create a page window and assign it to a page.
    Choose <b>Edit --> Main windows</b>.
    A dialog box appears.
    -->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
    -->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
    Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
    -->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
    <b>
    Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
    In label printing, the field Upper margin also varies from main window to main window:
    <b>
      Upper margin of current main window +  Window height + Vertical spacing = Upper margin of next main window</b>
    -->Enter a value in the field Start position.
    This is a counter. Enter a starting value which is equal to or greater than 1.
    -->The main windows are added to the list.
    -->Save your form.
    reward if it helps u...
    sai ramesh

  • How to use JavaMail 1.4 with Oracle Application Server 10g (9.0.4.0.0)

    Hi all,
    I'd like to know if it's possible and how to use JavaMail 1.4 with Oracle Application Server 10g (9.0.4.0.0), Windows version.
    With the following code, I can see that the mail.jar used by the server is the one included in the jdk installation :
    // I'm testing InternetAddress.class because I want to use commons-email-1.2.jar that requires mail.jar 1.4 (or higher) and activation.jar 1.1 (or higher)
    // and I know that inside the commons-email-1.2.jar file, I need to call the InternetAddress.validate() method that throws a java.lang.NoSuchMethodError: javax.mail.internet.InternetAddress.validate()V if it is used with mail.jar 1.2.
    Class cls = javax.mail.internet.InternetAddress.class;
    java.security.ProtectionDomain pDomain = cls.getProtectionDomain();
    java.security.CodeSource cSource = pDomain.getCodeSource();
    java.net.URL location = cSource.getLocation();
    System.out.println(location.toString());
    This code returns : file:/C:/oracle/app/jdk/jre/lib/ext/mail.jar and this mail.jar file has an implementation version number: 1.2
    - I've tried to include my own mail.jar (1.4.2) and activation.jar (1.1.1) files in the war file that I deploy, but it doesn't work (the server still uses the same mail.jar 1.2)
    - I've tried to put the mail.jar (1.4.2) and activation.jar (1.1.1) files in the applib directory of my OC4J instance, but it doesn't work (the server still uses the same mail.jar 1.2)
    - I know that a patch exists : I've read the following document: How to Make Libraries such as mail.jar and activation.jar Swappable ? [ID 552432.1]
    This article talks about the Patch 6514136, but this patch only applies to : Oracle Containers for J2EE - Version: 10.1.3.3.0
    Can you please help me ?
    Thanks in advance for your answers,
    Laurent

    I strongly suggest to upgrade to AS 10.1.3 to get this.
    Think of future support of AS 9.0.4. You will get not critical patch updates anymore.
    --olaf                                                                                                                                                                                                                                                                                                               

  • How to use a Web Template with queries from multiple BW Systems?

    Hi all,
    can anybody help me how to use a Web Template with queries (DATA PROVIDER)in it from multiple BW Systems?
    Thanks in advance, best regards
    Frank

    Great! Thanks for the quick response.
    Have you tried this for XMLA datasources created within the EP system also?
    i.e use Web Analyzer to create a view from the XMLA source and use that view within WAD?
    Thanks.

Maybe you are looking for