Filtering a set of collections using JSTL

Hi, i am currently facing a problem where i tried to query a set of collections in JSTL. My 1st query is using date for example,
<sql:setDataSource var="ds" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://192.168.250.86:1223;DatabaseName=eleavedb;SelectMethod=cursor" user="sa" password="sapassword"/>
<sql:query var="countLeave" dataSource="${ds}">
SELECT * FROM VCST_EMPLOYEE_LEAVE WHERE leave_from LIKE 'May 31 2006%'
     <sql:param value="${dates}%" />
</sql:query>
After querying through date, i need to query these collection of data based on its type. But, my problem is....how to do it? This is because it's type is not unique.

You may try the paging taglib ...
http://www.servletsuite.com/servlets/pagertag.htm

Similar Messages

  • Displaying a set of records using jstl

    hi i am new to jstl.my requirement is i want to display a set of records from my database using jstl.for eg i want to display 50 records per page and i want to navigate to other records using next and prevoius buttons and i need to put view and edit buttons in that page.can anybody give me a solution for this.urgent

    You may try the paging taglib ...
    http://www.servletsuite.com/servlets/pagertag.htm

  • Can you set pager attribute using jstl c:out tag?

    I am trying to use the pager tag library from jsptags.com. The pager tag has a maxPageItems attribute. I want maxPageItems to be variable. I also want to use the jstl instead of scriptlets and expressions. Instead of writing
    <pg:pager
        maxPageItems="<%= myPageItems %>" >I want to write
    <pg:pager
        maxPageItems="<c:out value='myPageItems'/>">When I do this I get a java.lang.NumberFormatException: for input string: ""
    I think this issue is documented on the jsptags website. So maybe I have no choice but to use the expression format. I guess I should also mention that I am using jstl 1.1 and jsp 1.2 (implemented in tomcat 4.1.27)
    Has anyone tried this and had success?
    Did I provide enough information?

    Sorry, but you can't use tags as attributes to other tags (where would it end?)
    You're stuck with using <%= %> syntax.

  • Set Property to javaBean using JSTL

    Hi all,
    I have a custom object variable that I read from the session using JSTL.
    <c:set var="someObj" value="${sessionScope.myObj}" scope="page"/>
    Now i wan to set the obj into my JavaBean.
    <jsp:useBean id="myBean" scope="request" class"ObjectA">
         <jsp:setProperty name="myBean" property="objA" value='????' />     
    </jsp:useBean>
    How may I achieve this?
    I've tried the following ways:
    value = ${someObj}
    value = '<c:out value=$"someObj">'
    value = 'someObj'
    But none of them works. Any suggestion? I do not wish to have any scriplets.
    Thank you.

    Here is an example of how to do it:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
    First Bean :
        <!-- create the first bean in the request scope-->
         <jsp:useBean id="firstBean" scope="request" class="com.test.testBean"/>
         <!-- output the default name -->
        <c:out value="${firstBean.name}" />
        <!-- set the name to a new value an output the new value -->
        <c:set   value="newName" target="${firstBean}" property="name" />
        <BR><c:out value="${firstBean.name}" />
        <P>
    Second bean : 
        <!-- create the first bean in the request scope-->
        <jsp:useBean id="secondBean" scope="request" class="com.test.testBean"/>
         <!-- output the default name -->
        <c:out value="${secondBean.name}" />
         <!-- set the name to a new value an output the new value -->
        <c:set   value="secondbeanName" target="${secondBean}" property="name" />
        <BR><c:out value="${secondBean.name}" />
    <P>
    Bean reference:
        <!-- set the first bean beanRef to the second bean --> 
        <c:set   value="${secondBean}" target="${firstBean}" property="beanRef" />
         <!-- output the name property of the first bean bean ref -->
            <c:out value="${firstBean.beanRef.name}" />     
            <!-- change the name property of the second bean and the output the name property of the first bean bean ref -->
            <c:set   value="A completely new name" target="${secondBean}" property="name" />
         <br><c:out value="${firstBean.beanRef.name}" />     
        </body>
    </html>where com.test.testBean is:
    package com.test;
    public class testBean {
         private String name = "My Name";
         private int value = 11;
         private boolean exists = true;
         private testBean beanRef;
         public boolean isExists() {
              return exists;
         public void setExists(boolean exists) {
              this.exists = exists;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public int getValue() {
              return value;
         public void setValue(int value) {
              this.value = value;
         public testBean getBeanRef() {
              return beanRef;
         public void setBeanRef(testBean beanRef) {
              this.beanRef = beanRef;
    }

  • Hw can i get arabic support in oracleAS using jstl: showing '?????' symbols

    Hello All,
    I am using OracleAS for portal deployment and portlets UI constructed by using jstl.
    i have used spring portlet jstl for the jsp pages.
    when i am trying to change the language, it is showing '?????' symbols.
    I have used correct unicode. i tested in pluto portal server. when i deployed in oracleAS,
    for english not a problem. for arabic it is showing as '????'.
    i have used this code to get arabic in pluto. same code i used. i am getting error.
    <c:set target="${pageContext.response}" property="characterEncoding" value="UTF-8" />
    <fmt:setLocale value="ar" />
    <fmt:requestEncoding value="UTF-8" />
    i know it is not setting charector encoding.
    i tried some other too like:
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    and
    <%@ page pageEncoding="UTF-8" %>
    No improvement. please help me out of this.
    how can i get arabic support in oracle AS by using jstl?
    Thanks,
    Arun

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • How do I use jstl  to insert  links that passes sql info?

    Hi all,
    I'm using JSTL with sql and I want to create a link for every row so that the link would also contain the item in the first column of every row. But I keep getting stuck at saving the value. This is what I've tried:
    <c:set var="myName" value="test" scope="page"/>
    <tr>
    <c:forEach var="row" items="${name.rowsByIndex}">
         <tr>
    <c:forEach var="column" items="${row}">
         <c:if test="row =='uname'">
              <c:set var="myName" value="${column}"/>
         </c:if>
         <td>myName=<c:out value="${pageScope.myName}"/>"> <c:out value="${column}"/> </td>
    </c:forEach>
    </tr>
    </c:forEach>
    I either get a link of "edit.jsp?uName=$myName".
    Any ideas would be appreciated.
    Chris

    Introducing the <c:url> and <c:param> tags!
    <c:url value="edit.jsp">
      <c:param name="uName" value="${myName}"/>
    </c:url>Why the nested loops? When does row=='uname'? Could that ever occur?
    If you are after a specific column why not have one loop over ${name.rows} and get ${row.uname}?
    What server are you using?
    What version of JSTL?
    What is the taglib import you have made?

  • Invalid table name  error when updating object in collection using SQL

    Hi,
    I have pl/sql code where I am selecting a object from a collection using sql select query. I am processing this record and now I want to update the collection with the new object. ie. ensure that the object that was fetched be removed and this new one be added.
    considering my_ot is the object type and my_tt is the table type.
    DECLARE
    my_col my_tt;
    my_col1 my_tt
    my_var my_ot;
    my_var2 VARCHAR2(10);
    BEGIN
    // populating my_col1 with select query
    //populating my_col with select query
    FOR my_col1.FIRST .. my_col.LAST LOOP
    //populating my_var2
    BEGIN
    SELECT my_ot(c.field1, c.field2 ,c.field3) INTO my_var FROM TABLE(my_col) c WHERE c.field3 = my_var2
    //processing the field my_VAR
    UPDATE TABLE(my_col) c SET c.field1 = my_var.field1 , c.field2 = my_var.field2 , WHERE c.field3 = my_var.field3;
    EXCEPTION WHEN NO_DATA_FOUND
    my_col.EXTEND;
    my_col(my_col.LAST) := // new my_ot object
    END;
    END LOOP;
    Here, when compiling the update query is not being compiled. I am getting a error 'invalid table name'. Is there any way to modify an object in the collection without knowing its index?
    If not, is it possible to find the index of a object in the collection in select query?
    Thanks in advance
    Paddy

    Hi,
    Is there any way to find the index of a object in the collection? Then I will simply replace the object at that index, right!
    Thanks
    Paddy

  • How to count  the length of a  collection in JSTL?

    Hi ,Everyone.
    I want to count the length of a collection in JSTL.
    For example:
    <c:out value="${length(ownerList)}" />
    the program compile wrong. Is length function supported in JSTL?
    Thanks in advance!

    Use:
    <c:out value="${fn:length(ownerList)}"/>You'll have to include the functions taglib to use the function:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

  • Send Vector class to JSP and print this Vector using JSTL

    Hello All!
    I need your help to solve my question.
    I developed a Servlet + jsp application.
    I tested it in local with Apache Tomcat/6.0.20 and it works correctly.
    I write and use these classes:
    class for execute query, and including data page:
    package MySQL;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.util.*;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    * @author initmax
    public class MySQLQuery {
        private Connection CurrentConnect; //obj for connect to databae
        private Vector VectorPageObj = new Vector(); //save array object page, after execute query
    public MySQLQuery() {}
    //constructor accept current conection database
    public MySQLQuery(Connection CurrentConnectBase)
        CurrentConnect = CurrentConnectBase;
    //method accept name table and return all info on this table
    public void SelectAllField(String NameTable)
           try
             Statement st = CurrentConnect.createStatement();
             String query = ("select * from "+NameTable);
             ResultSet resultQuery = null;
             resultQuery = st.executeQuery(query);
    //step in cycle after execution query, and create Vector object
               while (resultQuery.next())
                  GenPageMySQL PageObj = new GenPageMySQL();
                  PageObj.setId(resultQuery.getInt("id"));
                  PageObj.setTheme(resultQuery.getString("theme"));
                  PageObj.setPage(resultQuery.getString("page"));
                  VectorPageObj.add(PageObj); //add obj in tail vector
           catch (SQLException e) {
             e.printStackTrace();
        *@set the CurrentConnect
        public void setConnection(Connection CurrentConnectBase) {
             CurrentConnect = CurrentConnectBase;
        *@get Vector object "Vector created after execute query"
         public Vector getVectorPageObj(Connection CurrentConnectBase) {
             return VectorPageObj;
    }start Servlet class:
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import MySQL.*;
    public class indexServlet extends HttpServlet {
        private  String getpage;
        //Connected MySQL
        private MySQLConnect MySQLConnectObj = new MySQLConnect();
        private MySQLQuery MySQLQueryObj = new MySQLQuery();
        public void init(){
              MySQLConnectObj.DownloadDriver();
              MySQLConnectObj.Connected();
              //Use current connection, for execution query
              MySQLQueryObj.setConnection(MySQLConnectObj.GetConnection());
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException, NullPointerException  {
      //      init();
            PrintWriter out = response.getWriter();
    //GET case useer
          getpage = request.getParameter("page");
          out.print("MySQLConnectObj.GetConnection() = "+MySQLConnectObj.GetConnection()); 
    //Check curent connect to database
          if(MySQLConnectObj.GetConnection() != null)
               MySQLQueryObj.SelectAllField("up_menu");//execution query
               MySQLConnectObj.DisConnected();
                request.setAttribute("up_menu_theme",MySQLQueryObj.getVectorPageObj(null));
                RequestDispatcher Dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/jsp/index.jsp");
                Dispatcher.forward(request, response);
          else if(MySQLConnectObj.GetConnection() == null){
                init() ;
            out.print("MySQLConnectObj.GetConnection() = "+MySQLConnectObj.GetConnection());
    //        MySQLConnectObj.DisConnected();
    }I forward Vector "MySQLQueryObj.getVectorPageObj(null)" to JSP, how I can print data vector using JSTL?

    your right, I learn Java however this very Interesting!
    I change code, change Vector on List
    class MySQLQyery:
    package MySQL;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.util.*;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    * @author initmax
    public class MySQLQuery {
        private Connection CurrentConnect; //obj for connect to databae
    public MySQLQuery() {}
    //constructor accept current conection database
    public MySQLQuery(Connection CurrentConnectBase) {
        CurrentConnect = CurrentConnectBase;
    //method accept name table and link on List, after work return all info on this table inside List
    public List<GenPageMySQL> selectAllField(String NameTable, List<GenPageMySQL> ListPageObj) {
           try {
             Statement st = CurrentConnect.createStatement();
             String query = ("select * from "+NameTable);
             ResultSet resultQuery = null;
             resultQuery = st.executeQuery(query);
    //step in cycle after execution query, and create Vector object
               while (resultQuery.next()) {
                  GenPageMySQL PageObj = new GenPageMySQL();
                  PageObj.setId(resultQuery.getInt("id"));
                  PageObj.setTheme(resultQuery.getString("theme"));
                  PageObj.setPage(resultQuery.getString("page"));
                  ListPageObj.add(PageObj); //add obj in tail vector
           catch (SQLException e) {
             e.printStackTrace();
           return ListPageObj;
        *@set the CurrentConnect
        public void setConnection(Connection CurrentConnectBase) {
             CurrentConnect = CurrentConnectBase;
      List<GenPageMySQL> ListPageObj;
                //get List<RowObject>
                ListPageObj = MySQLQueryObj.getListPageObj();
      out.print("Size Page objects = "+ListPageObj.size());
                request.setAttribute("upMenu",ListPageObj);
                RequestDispatcher Dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/jsp/index.jsp");
                Dispatcher.forward(request, response);string out.print("Size Page objects = "+ListPageObj.size()); == worked, I get count objects correct
    How I can output fields Object GenPageMySQL in JSTL?
    writing so:
             <c:out value="hello, Max" />
             <c:out value="${10+20/2}" />
             <c:forEach items="${upMenu}" var="Object" >     
                   <c:out value="${Object.getId}"> </c:out>
             </c:forEach>
        </body>
    </html>but get error:
    org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/index.jsp at line 36
    33:          <c:forEach items="${upMenu}" var="Object" >
    34:         
    35:                 
    36:                <c:out value="${Object.getId}"> </c:out>
    37:
    38:    
    39:          </c:forEach>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         indexServlet.doGet(indexServlet.java:49)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)How I can in output print fields my Object?
    Thank you for your help.

  • Using JSTL variables in JSP or Javascript. Possible ?

    Hi All,
    Is it possible to share or use the variables which are declared are used by JSTL in JSP expression or scriplet code and in Java Script.
    Example:
    This Works:
    <fmt:set var="test" value="JSTL" />
    <fmt:out value="${test}" />
    But, this gives error:
    <% out.println(test) %>
    And passing the value of variable 'test' to Java Script code also gives error.
    How to use JSTL variables in JSP and in Javascript ?
    Yours,
    Sankar.B

    By default, JSTL variables are kept in servlet
    attributes. Default is to store it in the page
    context. You can make it request/session/application
    scope as required by an attribute of the set tag.Hi there,
    Can anyone advise how to access JSP variables in JSTL?
    Can it be done as the same method through request/session/application scope?
    Thnks...

  • Managing statistics for object collections used as table types in SQL

    Hi All,
    Is there a way to manage statistics for collections used as table types in SQL.
    Below is my test case
    Oracle Version :
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> Original Query :
    SELECT
         9999,
         tbl_typ.FILE_ID,
         tf.FILE_NM ,
         tf.MIME_TYPE ,
         dbms_lob.getlength(tfd.FILE_DATA)
    FROM
         TG_FILE tf,
         TG_FILE_DATA tfd,
              SELECT
              FROM
                   TABLE
                        SELECT
                             CAST(TABLE_ESC_ATTACH(OBJ_ESC_ATTACH( 9999, 99991, 'file1.png', NULL, NULL, NULL),
                             OBJ_ESC_ATTACH( 9999, 99992, 'file2.png', NULL, NULL, NULL)) AS TABLE_ESC_ATTACH)
                        FROM
                             dual
         )     tbl_typ
    WHERE
         tf.FILE_ID     = tfd.FILE_ID
    AND tf.FILE_ID  = tbl_typ.FILE_ID
    AND tfd.FILE_ID = tbl_typ.FILE_ID;
    Elapsed: 00:00:02.90
    Execution Plan
    Plan hash value: 3970072279
    | Id  | Operation                                | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                         |              |     1 |   194 |  4567   (2)| 00:00:55 |
    |*  1 |  HASH JOIN                               |              |     1 |   194 |  4567   (2)| 00:00:55 |
    |*  2 |   HASH JOIN                              |              |  8168 |   287K|   695   (3)| 00:00:09 |
    |   3 |    VIEW                                  |              |  8168 |   103K|    29   (0)| 00:00:01 |
    |   4 |     COLLECTION ITERATOR CONSTRUCTOR FETCH|              |  8168 | 16336 |    29   (0)| 00:00:01 |
    |   5 |      FAST DUAL                           |              |     1 |       |     2   (0)| 00:00:01 |
    |   6 |    TABLE ACCESS FULL                     | TG_FILE      |   565K|    12M|   659   (2)| 00:00:08 |
    |   7 |   TABLE ACCESS FULL                      | TG_FILE_DATA |   852K|   128M|  3863   (1)| 00:00:47 |
    Predicate Information (identified by operation id):
       1 - access("TF"."FILE_ID"="TFD"."FILE_ID" AND "TFD"."FILE_ID"="TBL_TYP"."FILE_ID")
       2 - access("TF"."FILE_ID"="TBL_TYP"."FILE_ID")
    Statistics
              7  recursive calls
              0  db block gets
          16783  consistent gets
          16779  physical reads
              0  redo size
            916  bytes sent via SQL*Net to client
            524  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              2  rows processed Indexes are present in both the tables ( TG_FILE, TG_FILE_DATA ) on column FILE_ID.
    select
         index_name,blevel,leaf_blocks,DISTINCT_KEYS,clustering_factor,num_rows,sample_size
    from
         all_indexes
    where table_name in ('TG_FILE','TG_FILE_DATA');
    INDEX_NAME                     BLEVEL LEAF_BLOCKS DISTINCT_KEYS CLUSTERING_FACTOR     NUM_ROWS SAMPLE_SIZE
    TG_FILE_PK                          2        2160        552842             21401       552842      285428
    TG_FILE_DATA_PK                     2        3544        852297             61437       852297      852297 Ideally the view should have used NESTED LOOP, to use the indexes since the no. of rows coming from object collection is only 2.
    But it is taking default as 8168, leading to HASH join between the tables..leading to FULL TABLE access.
    So my question is, is there any way by which I can change the statistics while using collections in SQL ?
    I can use hints to use indexes but planning to avoid it as of now. Currently the time shown in explain plan is not accurate
    Modified query with hints :
    SELECT    
        /*+ index(tf TG_FILE_PK ) index(tfd TG_FILE_DATA_PK) */
        9999,
        tbl_typ.FILE_ID,
        tf.FILE_NM ,
        tf.MIME_TYPE ,
        dbms_lob.getlength(tfd.FILE_DATA)
    FROM
        TG_FILE tf,
        TG_FILE_DATA tfd,
            SELECT
            FROM
                TABLE
                        SELECT
                             CAST(TABLE_ESC_ATTACH(OBJ_ESC_ATTACH( 9999, 99991, 'file1.png', NULL, NULL, NULL),
                             OBJ_ESC_ATTACH( 9999, 99992, 'file2.png', NULL, NULL, NULL)) AS TABLE_ESC_ATTACH)
                        FROM
                             dual
        tbl_typ
    WHERE
        tf.FILE_ID     = tfd.FILE_ID
    AND tf.FILE_ID  = tbl_typ.FILE_ID
    AND tfd.FILE_ID = tbl_typ.FILE_ID;
    Elapsed: 00:00:00.01
    Execution Plan
    Plan hash value: 1670128954
    | Id  | Operation                                 | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                          |                 |     1 |   194 | 29978   (1)| 00:06:00 |
    |   1 |  NESTED LOOPS                             |                 |       |       |            |          |
    |   2 |   NESTED LOOPS                            |                 |     1 |   194 | 29978   (1)| 00:06:00 |
    |   3 |    NESTED LOOPS                           |                 |  8168 |  1363K| 16379   (1)| 00:03:17 |
    |   4 |     VIEW                                  |                 |  8168 |   103K|    29   (0)| 00:00:01 |
    |   5 |      COLLECTION ITERATOR CONSTRUCTOR FETCH|                 |  8168 | 16336 |    29   (0)| 00:00:01 |
    |   6 |       FAST DUAL                           |                 |     1 |       |     2   (0)| 00:00:01 |
    |   7 |     TABLE ACCESS BY INDEX ROWID           | TG_FILE_DATA    |     1 |   158 |     2   (0)| 00:00:01 |
    |*  8 |      INDEX UNIQUE SCAN                    | TG_FILE_DATA_PK |     1 |       |     1   (0)| 00:00:01 |
    |*  9 |    INDEX UNIQUE SCAN                      | TG_FILE_PK      |     1 |       |     1   (0)| 00:00:01 |
    |  10 |   TABLE ACCESS BY INDEX ROWID             | TG_FILE         |     1 |    23 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       8 - access("TFD"."FILE_ID"="TBL_TYP"."FILE_ID")
       9 - access("TF"."FILE_ID"="TBL_TYP"."FILE_ID")
           filter("TF"."FILE_ID"="TFD"."FILE_ID")
    Statistics
              0  recursive calls
              0  db block gets
             16  consistent gets
              8  physical reads
              0  redo size
            916  bytes sent via SQL*Net to client
            524  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              2  rows processed
    Thanks,
    B

    Thanks Tubby,
    While searching I had found out that we can use CARDINALITY hint to set statistics for TABLE funtion.
    But I preferred not to say, as it is currently undocumented hint. I now think I should have mentioned it while posting for the first time
    http://www.oracle-developer.net/display.php?id=427
    If we go across the document, it has mentioned in total 3 hints to set statistics :
    1) CARDINALITY (Undocumented)
    2) OPT_ESTIMATE ( Undocumented )
    3) DYNAMIC_SAMPLING ( Documented )
    4) Extensible Optimiser
    Tried it out with different hints and it is working as expected.
    i.e. cardinality and opt_estimate are taking the default set value
    But using dynamic_sampling hint provides the most correct estimate of the rows ( which is 2 in this particular case )
    With CARDINALITY hint
    SELECT
        /*+ cardinality( e, 5) */*
    FROM
         TABLE
              SELECT
                   CAST(TABLE_ESC_ATTACH(OBJ_ESC_ATTACH( 9999, 99991, 'file1.png', NULL, NULL, NULL),
                   OBJ_ESC_ATTACH( 9999, 99992, 'file2.png', NULL, NULL, NULL)) AS TABLE_ESC_ATTACH)
              FROM
                   dual
         ) e ;
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 1467416936
    | Id  | Operation                             | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                      |      |     5 |    10 |    29   (0)| 00:00:01 |
    |   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|      |     5 |    10 |    29   (0)| 00:00:01 |
    |   2 |   FAST DUAL                           |      |     1 |       |     2   (0)| 00:00:01 |
    With OPT_ESTIMATE hint
    SELECT
         /*+ opt_estimate(table, e, scale_rows=0.0006) */*
    FROM
         TABLE
              SELECT
                   CAST(TABLE_ESC_ATTACH(OBJ_ESC_ATTACH( 9999, 99991, 'file1.png', NULL, NULL, NULL),
                   OBJ_ESC_ATTACH( 9999, 99992, 'file2.png', NULL, NULL, NULL)) AS TABLE_ESC_ATTACH)
              FROM
                   dual
         ) e ;
    Execution Plan
    Plan hash value: 4043204977
    | Id  | Operation                              | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                       |      |     5 |   485 |    29   (0)| 00:00:01 |
    |   1 |  VIEW                                  |      |     5 |   485 |    29   (0)| 00:00:01 |
    |   2 |   COLLECTION ITERATOR CONSTRUCTOR FETCH|      |     5 |    10 |    29   (0)| 00:00:01 |
    |   3 |    FAST DUAL                           |      |     1 |       |     2   (0)| 00:00:01 |
    With DYNAMIC_SAMPLING hint
    SELECT
        /*+ dynamic_sampling( e, 5) */*
    FROM
         TABLE
              SELECT
                   CAST(TABLE_ESC_ATTACH(OBJ_ESC_ATTACH( 9999, 99991, 'file1.png', NULL, NULL, NULL),
                   OBJ_ESC_ATTACH( 9999, 99992, 'file2.png', NULL, NULL, NULL)) AS TABLE_ESC_ATTACH)
              FROM
                   dual
         ) e ;
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 1467416936
    | Id  | Operation                             | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                      |      |     2 |     4 |    11   (0)| 00:00:01 |
    |   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|      |     2 |     4 |    11   (0)| 00:00:01 |
    |   2 |   FAST DUAL                           |      |     1 |       |     2   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement (level=2)I will be testing the last option "Extensible Optimizer" and put my findings here .
    I hope oracle in future releases, improve the statistics gathering for collections which can be used in DML and not just use the default block size.
    By the way, are you aware why it uses the default block size ? Is it because it is the smallest granular unit which oracle provides ?
    Regards,
    B

  • Query for create manual tabular form using apex collection using item textfield with autocomplete

    can we create a manual tabular form inside item textfield with autocomplete ?
    how it is possible?
    with Apex_item API used for this item.
    i used this code for creat  cascading select list
    select seq_id,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   1,
            p_value                     =>   c001,
            p_query                     =>   'SELECT C001 D
         , C002 R
      FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = ''col1''',
            p_attributes                =>   'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f01_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f01_#ROWNUM#',
            p_show_extra                =>   'NO') name,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   2,
            p_value                     =>   c002,
            p_query              =>   ' SELECT null d, null r FROM dual WHERE 1 = 2
            p_attributes                =>   'style="width:150px"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f02_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f02_#ROWNUM#',
            p_show_extra                =>   'NO')name2,
    from apex_collections
    where
    collection_name = 'COLLECTION1'
    It is fine .
    but i want item in tabular form  textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
    how it is created.i have no idea related textfield with autocomplete.Please help me....

    pt_user1
    I understand that the add row button is currently doing a submit.
    To not submit the page you need a dynamic action on the page.
    Does the javascript function addRow do what you want?
    Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
    You're process could be something like:
    Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
    And as second action refresh your tabular form.
    If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
    Nicolette

  • JSP Worked Well Using Scripting Elements, But, Becomes a Null Using JSTL

    I have to bother all of you again with my JSTL problems. I am working on a JSP, which is very similar to the one that caused a lengthy discussion on this forum before. This JSP is a bit more complicated.
    Again, this JSP worked well and displayed what I expected when the page was coded using the scripting elements.
    I tried to use JSTL where possible and managed to correct all the compilation errors.
    Now, I got a simple message: 'null' in the browser without any explanation - typical problem working with JSP: very difficult to debug.
    I have tried to identify problems "one by one" and found the first encounter is where I want to set the background color for each row inside the <c:forEach ....> tag.
    I examined the code again and again, I could not see what would lead to 'null'. I need a hand again.
    <%@ taglib uri="/tags/struts-html-el" prefix="html" %>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/tiles" prefix="tiles" %>
    <%@ taglib uri="/tags/request" prefix="req" %>
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    <%@ page import="org.apache.artimus.message.utility.ParamUtil" %>
    <%@ page import="org.apache.artimus.message.exceptions.AssertionException" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUser" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUserImpl" %>
    <%@ page import="org.apache.artimus.filter.EnableEmotionFilter" %>
    <%@ page import="org.apache.artimus.message.ThreadBean" %>
    <%@ page import="org.apache.artimus.message.PostBean" %>
    <%@ page import="org.apache.artimus.message.AttachmentBean" %>
    <%@ page import="org.apache.artimus.MessageInboxConfig" %>
    <%@ page import="org.apache.artimus.WebSiteGlobal" %>
    <%@ page import="org.apache.artimus.SiteUtil" %>
    <c:set var="threadBean" value="${requestScope.ThreadBean}" />
    <c:set var="postRows" value="${requestScope.PostBeans}" />
    <c:set var="numberOfPosts" value="${requestScope.NumberOfPosts}" />
    <c:set var="previousTopic" value="${requestScope.PreviousTopic}" />
    <c:set var="nextTopic" value="${requestScope.NextTopic}" />
    <c:set var="offset" value="${requestScope.offset}" />
    <c:set var="threadID_int" value="${requestScope.thread}" />
    <c:if test="${threadBean.threadID != threadID_int}">
        The two threadID are not the same.
    </c:if>
    <c:set var="threadID" value="${threadID_int}" />
    <%-- the code before this line works fine and I have a number of things displayed as expected --%>
    <c:forEach var="postBean" items="{postRows}" varStatus="i">
    <% PostBean postBean =
       ( PostBean )pageContext.getAttribute( "postBean" );
    %>
       <c:choose>
          <c:when test="${(postBean.parentPostID) eq 0}">
             <c:set var="background" value="#FFCE9C" />
          </c:when>
          <c:otherwise>
             <c:choose>
                <c:when test="${(i+1)%2 ne 0}">
                   <c:set var="background" value="#EEEEEE" />
                </c:when>
                <c:otherwise>
                   <c:set var="background" value="#FFFFFF" />   
                </c:otherwise>
             </c:choose>
          </c:otherwise>
       </c:choose>
    <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
      <tr bgColor="${background}">
      </tr>
    </table>
    </c:forEach>

    Where is the null occuring? Have you looked at the returned HTML code to see where the 'null' is?
    You might try just a few <c:out value=""/>, like:
    The postRows = <c:out value="${postRows"/><br/>
    <c:forEach var="postBean" items="${postRows"/>
      The Current postBean = <c:out value="${postBean}"/><br/>
      The Current parentPostID = <c:out value="${postBean.parentPostID eq 0}"/><br/>
      <!-- Only do this set if background ends up null, to make sure the scope of background is wide enough -->
      <c:set var="background" value="#FFFFFF"/>
      <c:choose>
        <c:when test="${postBean.parentPostID eq 0}">
          <c:set var="background" value="#FFCE9C"/>
        </c:when>
        <c:when test="${(i+1)%2 ne 0}">
          <c:set var="background" value="#EEEEEE"/>
        </c:when>
        <c:otherwise>
          <c:set var="background" value="#FFFFFF"/>
        </c:otherwise>
      </c:choose>
      The Background is now = <c:out value="${background}"/><br/>
      <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
        <tr bgColor="${background}">
        </tr>
      </table>
    </c:forEach>By adding output like that when we are debugging we can help track down where problems that occur are coming from. That and looking at the source code have been invaluable to me...

  • Link to summary report with filtered data set within FormsCentral

    Is it possible to generate a link to a summary report with a filtered data set within FormsCentral?
    If I have 4 sales agents each using the form to submit their repsective sales (with a dropdown indicating the sales agent) is it possible to filter the data so that only Sales Agent A see a report of their sales?
    Thanks,
    D

    Try following forum:
    http://forums.adobe.com/community/formscentral?view=discussions

  • User selection to return filtered record set

    Hi,
    I want to create a JSP which allows a user to enter search criteria for several columns of a table. I will use the entered values to set the sql where clause and produce the filtered record set. (eg the user enters a particular customer code and status code in order to see a list of orders placed by that customer which have the selected status code.)
    The problem I have is this: I want the input fields for the selection criteria to be combo boxes populated with values from the database.
    What is the best way to do this?

    Hi,
    I want to create a JSP which allows a user to enter search criteria for several columns of a table. I will use the entered values to set the sql where clause and produce the filtered record set. (eg the user enters a particular customer code and status code in order to see a list of orders placed by that customer which have the selected status code.)
    The problem I have is this: I want the input fields for the selection criteria to be combo boxes populated with values from the database.
    What is the best way to do this?

Maybe you are looking for

  • Can i upgrade my mac ox laptop to lion..

    can i upgrade my mac ox laptop to lion..

  • CASE in a WHERE clause : ORA-00905

    Hi everyone, I am trying to use a CASE in a WHERE clause and I got the error ORA-00905: missing keyword. Here is my code : SELECT id_reserv,      concat(nom,concat('_',indice)) as nom,      libelle,      num_lot,      resa_keyword1,      resa_keyword

  • BTE to modify planning level

    Hi! I´m using BTE 1025 (P/S) to modify automatically the panning level of certain FI documents. My version: 4.6C Now we are upgrading to ECC 6.0, but BTE 1025 doesn´t run. What´s the problem with BTE for modifying documents in ECC 6.0? Thanks in adva

  • To work with BPC in What areas we need to be perfect?

    Hai, Inorder to manage  while working with BPC pls suggest me what parts of excel i have to learn, pls will u provide any scenarios on BPC:

  • E-mail Issues after update

    Hi. About a week ago the SVP that I do technology for was given his Playbook tablet.  The device worked flawlessly for that initial week.  Last night he decided to run the device update and since then he cannot get his corporate e-mails to bridge to