EstimatedRowCount on a query table

Hi,
I have a search page and am supposed to show the total number of rows of the result on the top or bottom of the table.
My table is surrounded with a panelcollection, and in the tool bar of the panel collection, I placed an output text and value is given as #{bindings.VO1.estimatedRowCount} (tried bindings.VO1Iterator.estimatedRowCount as well).
Initially its working fine. but when I navigate to a different page and again come back to the search page, then it is not showing correct row count. (I guess it is showing the total row count of my vo query without applying any view criteria i.e even though my result table has only 54 records, it show 1108 as row count.)
But when I click on any row in the table then again it is changing to correct number (54).
This behaviour seems wierd.
Plz let me know what is the correct way of showing total number of rows in search result as a header or footer of the table.

Hi Jobinesh
1. I am using Rollback because the second page is a transaction page and any uncommitted data should be removed.
2. If its problem with rollback, table data is coming correctly only..only the count is shown wrong. And also, after I just select on any record in the table, its again showing correct value.
3. Anyway to rule it out as you said, I removed the rollback and tried as well. but no change in behaviour.
4. Is there any other way of achieving the same instead of using these unreliable rowCount methods.
I am thinking in terms of creating some client methods in AMImpl or VOImpl and use them to show the count.
But again it should be invoked whenever search / reset is executed or page is rendered.
Please let me know ur ideas.

Similar Messages

  • How to create olap cube using Named Query Table in Data source View

     I Create on OLAP Cube using Existing Tables Its Working Fine But When i Use Named Query Table with RelationShip To other Named query Table  It Not Working .So give me some deep Clarification On Olap Cube for Better Understanding
    Thanks

    Hi Pawan,
    What do you mean "It Not Working"? As Kamath said, please post the detail error message, so that we can make further analysis.
    In the Data Source View of a CUBE, we can define a named query. In a named query, you can specify an SQL expression to select rows and columns returned from one or more tables in one or more data sources. A named query is like any other table in a data source
    view (DSV) with rows and relationships, except that the named query is based on an expression.
    Reference:Define Named Queries in a Data Source View (Analysis Services)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Dbms_sql  in a different schema from query table-error  ** ORA-00942

    Oracle Experts,
    I think I am having problems with using DBMS_SQL in which the function was created in one schema and the query table was created in a different schema.
    We have 2 schemas: S1, S2
    We have 2 tables:
    T1 in Schema S1
    T2 in Schema S2
    We have a function F1 created by DBA in schema S1 that uses the dbms_sql as:
    CREATE OR REPLACE FUNCTION S1.F1(v1 in VARCHAR2) return NUMBER IS
    cursor1 INTEGER;
    BEGIN
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, v1, dbms_sql.NATIVE);
    dbms_sql.close_cursor(cursor1);
    return (0);
    EXCEPTION
    when others then
    dbms_sql.close_cursor(cursor1);
    return (1) ;
    END;
    I am using jdeveloper 11G. We have an Oracle DB 11g.
    We have a java program which uses jdbc to talk to our Oracle DB.
    Basically, in my java program, I call function F1 to check if the query is valid.
    If it is, it returns 0. Otherwise, returns 1:
    oracle.jdbc.OracleCallableStatement cstmt = (oracle.jdbc.OracleCallableStatement) connection.prepareCall ("begin ? := S1.F1 (?); end;");
    cstmt.registerOutParameter (1, java.sql.Types.INTEGER);
    cstmt.setString(2, "Select * from S2.T2");
    cstmt.execute ();
    Since the table that I run the query is T2, created in different schema than F1 was created in, I have the error:
    ** ORA-00942: table or view does not exist
    So my questions are these:
    - I am using Oracle DB 11g, if I run the query on a table that created in a different schema from the one that the function (which uses dbms_sql) was created in, I would get the error ORA-00942?
    - If I runs the query on table T1 in the same schema as the function F1, would I have the same problem(The reason I ask is I cannot create any table in schema S1 because the DBA has to do it; I am not a DBA)
    - This is not a problem, but a security feature because of SQL injection?
    - How to resolve this issue other than creating the table in the same schema as the function that utilizes DBMS_SQL?
    Regards,
    Binh

    Definer rights (default) stored objects run under owner's security domain and ignore role based privileges. So regardless what user you are logged in as, function S1.F1 always executes as user S1 and ignores user S1 roles. Therefore exeuting statement within S1.F1:
    Select * from S2.T2requires user S1 to have SELECT privilege on S2.T2 granted to S1 directly, not via role.
    SY.

  • Dynamic query table for report based on LOV selected

    Hi,
    Need some suggestion and guidance how to dynamically query table via lov for report .
    Scenario:
    Table, TABLE_LIST, has tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from table TABLE_LIST.
    SELECT TABLENAME D, TABLENAME R FROM TABLE_LIST
    In Page 2,a page select list item,P2_TABLENAME to use TABLENAME_LOV
    All data in tables in the table_list have identical structure (columns, triggers, primary key, and so on).
    I want to have the report region query from the table based on selected LOV.
    Example,
    Tablename Filter
    TB1
    CD2 ACTIVE='Y'
    When select TB1, the report regin will query based on TB1.
    When select CD2, the report regin will query based on CD2 WHERE ACTIVE='Y'
    Question:
    How can I query based on &P2_TABLENAME. WHERE &P2_FILTER.
    Like
    select col1, col2 from &P2_TABLENAME WHERE &P2FILTER
    Greatly appreciate any suggestion and some guidance.
    Tigerwapa

    Hi,
    You should always post your Apex version, DB version and other information as suggested in the FAQ.
    And the moment you talk report you should state whether it is IR or Classic.
    As for your query, have you explored the Report type "SQL Query (PL/SQL function body returning SQL query)" ?
    That might be a good fit for what you are trying to achieve.
    Regards,

  • Best way to keep parameters associated with Listobject query table?

    I'm working to establish a standard approach to retrieving data from SQL server databases into Excel based applications.  My current proposed structure allows for exactly one Listobject with a query table per sheet in a workbook.  The connection
    strings and SQL texts for all queries in the workbook are kept in a single table on its own (hidden) sheet.  Each "Datasheet" then has a table and named cells QueryName, ConnectionString and SQLText which are scoped at the sheet level.  The
    connection string and raw SQLText are retrieved from the table using QueryName as an lookup value into the QueryTable.  There are a series of parameter cells whose values are inserted into the SQL text using =Substitute() formulas, where the raw query
    text has #P1#, #P2#, etc, which are subsituted with the parameter values from the parameter cells to assemble the final query text in the named cell SQLText.  To refresh the application, a simple VBA Sub iterates through all the sheets in the workbook.
     If the sheet contains a ListObject with a Querytable, then ConnectionString and SQLText are written to the .Connection and .CommandText properties of the QueryTable and the table is refreshed.
    This works great, but I have a developer who has asked to be able to put multiple Listobjects with querytables on a single sheet so he doesn't need so many sheets in the workbook.  My first though was why do you care how many sheets you have, but on
    the other hand a single sheet can certainly handle more than one ListObject, so... 
    If you're still with me, THANKS!  Here's the question.  If I have more than one ListObject on a sheet, I'll need a ConnectionString and SQLText cell for each one.  How do I keep them associated?  I could require the developer to name
    them ConnectionString1/SQLText1, ConnectionString2/SQLText2, etc. and then expect that ListObject(1) goes with ConnectionSTring1/SQLText1, etc. but I'm not sure that the ListObject index numbers will stay constant.  I could somehow link to the table name,
    but that can be changed...  Any ideas?  If this is too general a question, feel free to ignore.
    Thanks,
    J

     I could somehow link to the table name, but that can be changed...  Any ideas?
    Not sure if this will help or not but maybe a little from several areas might point you in the right direction.
    If you are concerned about users changing the table name then you can define a name to reference the table and then if the user changes the table name then the Refers to automatically changes to the new table reference but your defined name remains the same.
    However, if users want to break a system even when you think you have it bullet proof the users come along with armour piercing bullets.
    Example:
    Insert a table (say Table1)
    Go to Define a name and insert a name of choice (eg.  ForMyTab1)
    Then click the icon at the right of the Refers to field and select the entire table including the column headers and it will automatically insert something like the following in the Refers to field.
    =Table1[#All]
    Now if a user changes the table name then Table1 will also automatically change.
    Example code to to reference the table in VBA.
    Sub Test()
        Dim wsSht1 As Worksheet
        Dim lstObj1 As ListObject
        Set wsSht1 = Worksheets("Sheet1")
        Set lstObj1 = wsSht1.ListObjects(Range("ForMyTab1").ListObject.Name)
        MsgBox lstObj1.Name
    End Sub
    Regards, OssieMac

  • How to Access DB2 MQT (Materialized Query Table) in Crystal 10

    DB2 V8 has a new construct called a Materialized Query Table (MQT) that is essentially a table containing the data represented by a view. This MQT does not appear in the Database List in Crystal under Table, View or Synonym. I assume it is due to the Database Type in DB2 (M). How can I make Crystal recognize the MQT so I can use it in a report?

    Hi Linda,
    This question was posted internally and OLE dB is the work around but no version of CR was noted so not sure if this will work for you. If it doesn't work in CR 10 then you'll have to upgrade to a more current version.
    Because MQT is new to DB2 Crystal 10 OLE dB driver may not know how to handle them.
    Thank you
    Don

  • Selecting from Materialized Query Tables (DB2 UDB database)

    When selecting what objects I wish to view in my Reports, I am unable to see any Materialized Query Tables in the list.  I am able to see the "normal" Tables and Views, just not any Materilized Query Tables.
    Please let me know what I need to set or customize in-order to see and then select fields from these.

    Thanks everyone.
    I was able to find the answer.
    For the new report, in the "Create New Connections"...choose "OLE DB (ADO)" --> then "Microsoft OLE DB Providers for ODBC Drivers"  --> click on the "Next" button --> choose the database --> then user/password details (..and so forth).

  • Treat one power query table as source for another

    Hi,
    I have a Power Query Table named as Final Table - this table has inturn been loaded to the Data Model.  I would like to use this Table (Final Table) as a source for creating another Power Query Table (I want to perform further actions on the
    Final Table to create yet another Table).  So I just want to know what I should specify in the Source (the first line after the Let statement) in the Advanced Editor.
    I do not see any option in the Power Query Ribbon to create an existing Power Query Table as a source.
    Thank you.
    Regards, Ashish Mathur Microsoft Excel MVP www.ashishmathur.com

    You can just use the query name in your new expression. Since it has a space, write #"Final Table" whenever you refer to it.
    (Note that you probably don't need to load this table to the Data Model, but only the one which includes all your transformations. To unload the first table, open Workbook Queries pane select Final Table and after right click, select "Load To".
    In the Load To dialog uncheck the Load to Data Model option).
    Example:
    let
    source=#"Final Table"
    in source

  • Navigation block and the Query Table Side by side in output

    Hi
    I am unable to get the navigation block and the query table side by side when i execute the WAD .Is it possible to place those 2 objects next to each other in the WAD output.In the WAD design those 2 are placed side by side.
    Regards,Pra

    I meant Html Table:
    In WAD in menu you can choose Insert -> Table -> Insert Table
    You need 1 row, 2 columns. In one of the column you should put navigation block and in the other table.
    Regards
    Erwin
    Edited by: Erwin  Buda on Feb 5, 2009 2:06 PM

  • Cannot query tables in remote database

    Hi, I have looked around for similar topics but have not found anything that would be close to my problem. I created a public link to a remote database from my portal database, it is a public link and I can query tables in the remote database just fine when I am on the sqlplus prompt. When I try to create a report, or a dynamic page, it lets me go through the wizard steps ok, however when I run it as a portlet or just run it as a report/page it does not seem to be able to see the query. Below is the response I get from running it as a portal. I am logged in as portal30.
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from C2K (WWV-11230)
    Failed to parse as PORTAL30_PUBLIC - select * from populate@c2k (WWV-08300)
    The preference path does not exist:
    ORACLE.WEBVIEW.PARAMETERS.1320061995 (WWC-51000)
    The preference path does not exist:
    ORACLE.WEBVIEW.PARAMETERS.1320061995 (WWC-51000)
    Error: Unable to execute query (WWV-10201)
    Please help, I have tried everything from public to private synonyms for the linked tables and it just does not work. I am using the most recent version of portal that came with ias 1.0.2.2.0

    Actually I solved my problem, it looks like I should have used the db link utility with the portal, I linked the databases on the sqlplus command line and it seems like that was the issue.

  • SQL*PLUS help to query tables

    Is it possible to query tables of other users from a dba account?
    My problem is that when i connect to sqlplus using:
    sqlplus system/manager@mymachine
    I can only see my tables... I cannot see the tables of other users of the same database... What is the correct syntax of doing it? (Is there a good newbie doc about sqlplus?)

    Yes.
    select owner, table_name from dba_tables;
    (for example)
    OWNER TABLE_NAME
    XYZ123 MYTABLE
    desc XYZ123.MYTABLE;
    select * from xyz123.mytable;
    If you get tired of prefixing the table name with the owner, you can do the following:
    alter session set current_schema=xyz123;
    select * from mytable;

  • Query Tables Does Not Fill Down Formulas When Refreshed

    I have used external data queries for several years, connecting to a variety of data sources, but most frequently to SQL server 2005 using MS Query and ODBC. Anyway, in Excel 2007, when I refresh my queries and the data range adds new
    rows to the query table, the formluas do not fill down past the previous extent of the data range. These are not external queries converted from a previous version of Excel; I built them in Excel 2007, and the issue persists across multiple workbooks.
    To answer the inevitble suggestions:
    1) The formulas are definitely in the query tables, not adjacent.
    2) "Extend data range formats and formulas" is enabled in the advanced tab of Excel options.
    I've found threads on other sites where users had similar problems, but have not seen a satisfactory solution or even a good response to their inquiries. Any ideas?
    P. Dolan
    Stat Analyst, TN Dept of Safety

    I have the same issue with excel 2010.  To answer Ryan's last question,  Excel does seem to consider all the added rows as begin part of the table.   On the pre 2007 queries, there was an option under 'External data properties'
    to specify whether you wanted the formulas to copy down to the new rows. When this option was selected, it worked without fail.  Under 2007 and 2010 this option no longer appears, but most of the time the formulas do copy down properly, but eventually
    something happens to cause this to stop occuring.  The only fix I have found is to recreatet the whole query again.  It then works for awhile and then stops working at some point. I wish I could isolate what causes it to stop, but I haven't been
    able to figure it out.
    Same with me and Excel 2010.  The help refers to the option, but my dialog box does not have it.  (Another option that has disappeared is the ability to get column headers derived from the returned query.)
    Excerpt from help:
    On the Data tab, in the Connections group, click
    Properties.
    In the External Data Range Properties dialog box, select the
    Fill down formulas in columns adjacent to data check box.  

  • Errors with querying a query table using non-QoQ query and QoQ query

    HELP ! ! !  Going into testing soon. I need this to work to get correct report results ! ! ! !
    My issue seems similar to the one just answered about Query of Queries RunTime Error
    and the reply from lawhite01 caught my eye.
    This is a 2 parter. The second part is the QoQ part, but the 1st part has a line in the query that is similar to the QoQ one and it uses the same data. Part 1 also throws an error.
    PART # 1.
    I'm trying to use a query table created through QueryNew and then query it.
    I need multiple columns in the query table I create:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    Then I populate all the cells of the query table.
    Then I set up to use the created query table.
    I do this first:
        <cfquery name="qAltPostID" datasource="#at_datasource#">
             SELECT AltPoster, fk_Job_AnnounceNum
             from JOB_JPContacts
             Where AltJPContactType = 'AltPosterID'
             and AltPoster = '#session.IHSUID#'
             </cfquery>
    Then, in my first query using the created query, I expect to need to choose from multiple values, so I'm using this line in the query (this is NOT a QoQ query):
                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    I've also tried:
                   and AnnounceNum IN (#ValueList(qAltPostID.fk_Job_AnnounceNum)#)   
    and:
                   and JOB_AnnounceNum IN
                    SELECT fk_Job_AnnounceNum
                    from JOB_JPContacts
                    Where AltJPContactType = 'AltPosterID'
                    and AltPoster = '#session.IHSUID#'
    ERROR is: one record should return. I get 0.
    PART # 2: Here's the QoQ part.
    I get the error:
    Query Of Queries runtime error.
    Comparison exception while executing IN.
    Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
    Left hand side expression type = "LONG".
    Right hand side expression type = "STRING".
    A tutorial I found gave an example using only one column for this part of the fix:
         tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    I used this code after all the cells contained values and before running my QoQ query:
            <cfloop index="intID" from="1" to="#tot_AllCurrentDraftListing.recordcount#" step="1">
                <cfset tot_AllCurrentDraftListing["AnnounceNum"] [intID] = JavaCast("string", intID) />
            </cfloop>
              Is that correct?
    Thanks.
    Whoever can help me with this should be awarded extra points ! ! ! !

                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    If you're passing a list as a param, you need to tell <cfqueryparam> it's a list.  Read:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html#1102474
    ERROR is: one record should return. I get 0.
    It's a bit hard to comment on this sort of thing without knowing the data involved.
    A tutorial I found gave an example using only one column for this part of the fix:     tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    Again, this is a matter of reading the relevant docs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_m-r_19.html#292759
    As a general rule, if you're having trouble with the syntax of a CFML statement, look it up in the docs.
    Adam

  • LOV field value search in query table region

    Hi All,
    I have a custom OAF page with LOV fields, i need to do a search and need to display the value in query table region,please suggest.
    Thanks

    Hi,
    Check this article, explains how to use a queryregion for search
    http://imdjkoch.wordpress.com/tag/query-regions/
    -Idris

  • Unable to Query Table

    Hi Folks,
    I'm stuck in weird situation. User complaints fetching data from table A is timing-out ( as per application standards). I decided to collect latest statistics(dbms_stats) on index used by query which is running for more than 12 hours. Ideally which should not.It is partition table and got close to 10 millions records.
    1) I checked dba_waiters - no rows
    2) I checked v$locked_object/v$locks - no rows
    3) I'm unable to run explain-plan for any criteria on that table
    4) I'm unable to open table data-tab in Toad/ Sql developer.
    5) I'm unable to query a single partition; no error but it keeps on running.
    SQL> SELECT * FROM SSAM_TRANS_FACT PARTITION (P20101010S01);

    Again, anything in alert.log? Any trace files? What happens if you issue:
    select 1 from ssam_trans_fact where rownum = 1;What happens when you issue:
    select 1 from ssam_trans_fact partition(P20101010S01) where rownum = 1;SY.

Maybe you are looking for