Show row count

Hi!
I'm using JDeveloper 11g Release 2 (11.1.2.3.0).
Here an easy question. For the moment, I have this query:
SELECT Sale.SALE_DATE,
       Sale.SALE_PRO_ID,
       Sale.SALE_ID
       Product.PRO_ID,
       Product.PRO_NAME
FROM Sale, Product
WHERE (Sale.SALE_PRO_ID = Product.PRO_ID)I want to show a table like this:
Unit Sold        Product Name
52                 Prod1
41                 Prod8
30                 Prod3
18                 Prod15
5                  Prod2Can someone show me how to do it? I'm neawby in SQL...
Thanks in advance!

Hello!
Sorry, but I don't explain the correct query, I put one similar, but In the real one it don't work.
Here the real one:
Query:
SELECT Sale.SALE_DATE,
       Sale.SALE_CAR_ID,
       Sale.SALE_ID,
       Car.CAR_BRAND_ID,
       Car.CAR_MOD_ID,
       Car.CAR_ID,
       Band.BRA_NAME,
       Brand.BRA_ID,
       Model.MOD_NAME,
       Model.MOD_ID
FROM Sale, Car, Brand, Model
WHERE ((Sale.SALE_CAR_ID = Car.CAR_ID) AND (Car.CAR_BRAND_ID = Brand.BRA_ID)) AND (Car.CAR_MOD_ID = Model.MOD_ID)And I want this:
Unit Sold            Car Brand            Car Model
89                   Volkswagen           Polo
43                   Volkswagen           Passat
5                    Volkswagen           GolfThanks again!

Similar Messages

  • Is it possible to show the count of number or rows in table on the Home page Tab button.

    Is it possible to show the count of number or rows in table on the Home page Tab button.
    On home page there is a Tab called Count and I want to show the count on the right corner of this tab button.
    Please help

    Create an application item. APP_HOME_COUNT.
    Create an application process:
      make the application process type "on new instance" if you only want this to run once
      make it "on load before header" if you want to have the value set every page load
    application process source:
    select count(*) into APP_HOME_COUNT from <your table>
    modify the tab name to reference the app item, maybe something like "Count(&APP_HOME_COUNT.)"
    result should look like this "Count(5)"
    Good Luck,
    Tyson

  • DataTable.Rows.Count property is occasionally wrong

    I have a web service in C#.NET which calls a stored procedure using ADO.NET. The stored procedure is always returning 1 row, which is then loaded into a DataTable. The Rows.Count property of the DataTable is then examined.
    When this web service is called repeatedly with numerous requests, it occasionally returns Rows.Count as 0 when it should be 1. I have debugged and examined it at runtime and found that there is indeed 1 row in the datatable, but that the Rows.Count property
    is 0.
    Is this a known bug?
    I'm using .Net Framework 2.0
    Note: This is an issue that occurs very rarely. My testing shows that it takes about 90 minutes to recreate it when you have 2 concurrent processes sending requests repeatedly at a rate of about 10 requests per second.

    Are you sure that there aren't multiple threads access the DataTable?
    Can you post a repro? 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • How to add the Row count(number of rows in table)  in  the table header?

    Hi,
    I'm having a table. This table is viewed when i click on a search button.
    <b>On the table header it should dynamically display the number of rows in the table, i.e., the row count.</b>
    How to do this? could any one explain me with the detailed procedure to achieve this.
    Thanks & Regards,
    Suresh

    If you want to show a localized text in the table header, you should use the <b>Message Pool</b> to create a (parameterized) message "tableHeaderText" like "There are table entries".
    Next, create a context attribute "tableHeaderText" of type "string" and bind the "text" property of the table header Caption UI element to this attribute.
    Whenever the table data has changed (e.g. at the end of the supply function for the table's data source node), update the header text:
    int numRows = wdContext.node<TableDataSourceNode>().size();
    String text = wdComponentAPI.getTextAccessor().getText
      IMessage<ComponentName>.TABLE_HEADER_TEXT,
      new Object[] { String.valueOf(numRows) }
    wdContext.currentContextElement().setTableHeaderText(text);
    Maybe you want to provide a separate message for the case that there are no entries.
    Alternatively, you can make the attribute calculated and return the header text in the attribute getter.
    Armin

  • Obiee oracle gateway error while updating row count

    Hi ,
    OBIEE server 11.1.1.5 ,oracle server11g installed in linux 64bit,
    while updating row count in Admin tool i am getting the following error
    [NQODBC][SQL_STATE:HY000][nQSError:10058] A general error has occured.
    [nQSError: 43113]Message returned from OBIS.
    [nQSError:43093]An error occured while processing the EXECUTE PHYSICAL statement.
    [nQSError:17003]Oracle gateway error: OCIEnvNIsCreate or OCIEnvInit failed to initialize environment.Please check your Oracle Client installation and make sure the correct version of OCI libraries are in the library path.
    i am able to check the database from sqlplus it is working fine.
    Any suggestion highly appreciated plzzz

    Make sure your connection pool is valid and able to import or execute reports.
    If everything good as above said, in Physical layer database properties-> general tab choose the database version and try it once.
    If not
    Check the doc id 1271486.1
    Or
    To resolve the issue create a softlink (ln -s) in the <OracleBI>/server/Bin folder to link to the 32-bit Oracle Client Driver file.
    The example below shows how to perform a softlink from the 64 bit directory:
    cd /u10/app/orcladmin/oracle/OracleBI/server/Bin
    ln -s $ORACLE_HOME/lib32/libclntsh.so.10.1 libclntsh.so.10.1
    If helps mark

  • Unique row count in table footer

    JDev 11.1.1.6
    Hi,
    In my current table, I am able to show total row count at a table footer by using #{bindings.<myVO>Iterator.estimatedRowCount}.
    I have a request from my user to show unique total row count. For example rows below:
    1 A
    2 B
    3 A
    4 C
    The footer should show:
    4 3
    The second column has A, B, and C where A is counted only 1 (unique). Is there a way to achieve this?
    Thanks.

    Hi RRA,
    This may work for a static # of rows (no filtering). In the table I use, I can do filtering and that certainly will make the count result be different if I use another VO for distinct result.
    Thanks.

  • Row Count mismatch in a table

    Hi,
    I am having a table and if i do count(*) , the total rows are coming 36882, but if i take export backup or select * from table, it is showing 7225. Any help to trace out the problem is highly appreciated. I am using oracle 9.2.0.4 in aix 5.3
    Regards
    Sridhar

    Is the "table" being selected from and rows counted, an actual table? Confirm using ALL_OBJECTS. What is the table type? Hash?
    s. I have counted in the actual table only. From all_objects, the object type is TABLE.
    Is FGAC (Fine Grain Access Control) used? Have you tried the select count or export from the SYS schema (exempt from FGAC)? Have you looked at the execution plans?
    No FGAC is used in that table. Export taken from sys also. Then also the same problem.Execution plan has been verified.
    If full table scan is performed, then less number of rows are returned. If the index hint is used and give count(*) or select * from table_name, all rows are returned.
    What happens when a CTAS is done against this table - what is the rowcount of the new table?
    if we give select * from alone then 7000+ rows alone created in new table.
    If index hint is used for ctas, then all the rows nearly 38000 rows are created in the new table.
    There are numerous sanity checks to do, before "accusing" a table of showing incorrect and buggy row count totals
    - All levels of trouble shooting has been already done and no use. This is the second time, i am facing this problem.
    Hence raised the issue and requested help from others.

  • Localization in OBIEE 10g(Error "start row is set higher than the row count

    Hi All,
    I m Working on Localization.
    I have used exteranize string and saved excel file and added language column and inserted data en and fr and loaded the file into the database.
    then i have created 2 variables
    one is for weblanguage SELECT 'VALUEOF(NQ_SESSION.WEBLANGUAGE)' FROM DUAL
    second is SELECT SESSION_VARIABLE, TRANSLATION FROM TAB_EXTERNAL WHERE LANGUAGE = 'VALUEOF(NQ_SESSION.LOCALE)' when i click on Test for the second variable it showing error
    "start row is set higher than the row count"
    i have seleted start row =10 and show some 10.then also it is showing same error.
    Please send me the solution ASAP.
    Thanks and Regards
    Kiran Kumar

    Hi Kiran,
    I am working in OBIEE localization. I created two variables and when press test i am getting vaules successfully. But in OBIEE application i am getting columns in english only. It seems there is some problem with values in DUAL table. It contains only 1 column called 'DUMMY' and value as 'X'.
    Please give me complete configuration steps to setup localization OBIEE 10g. Please drop me a mail to [email protected] if u have steps. I will call u if u provide contact number.

  • Total row count - where from is that value?

    Hi,
    I need the value of total row count that is displayed at the button of portal report. I need this value to use in my java script.
    Is that value somewhere in database? Maybe any variable or hidden form element on the page?
    Where from does the portal know when to show only the previous button and when both next and previous? It must by calucated somehow.
    Thanks in advance.
    best regards
    Krzysztof Jungowski
    null

    Thanks. Just to make clear:
    Probelm:
    I need to display links to pages with part of results at the bottom of page - just like in discussion group: Pages: [1] [2] [3] ....
    Solution:
    I know that there is a hidden form on every report rendered by portal. In that form there are several elements like:
    pagenumer, minrow and maxrows. Updating these elements I can jump to every page with results.
    Total row count problem:
    The problem is that I don't know the number of pages. If I had a total row count value I would calculate the number of pages and create links only to existing pages.
    best regards
    Krzysztof Jungowski

  • 3.0.9.8.5 - Total Row Count in reports

    "Total Row Count" seems to be broken after applying patch 3.0.9.8.5.
    After applying the patch, we viewed an existing report which returned (let's say) 25 rows (and I've got max rows per page set to 5):
    The first page correctly says: "Total Row Count in Report- 25" and "Row(s) 1 - 5 "
    But then clicking the 'next' button, the following page incorrectly says: "Total Row Count in Report- 10" and "Row(s) 6 - 10 "
    So, the total row count is getting screwed up. Clicking "previous" in the example above, the total row count goes down to '5'.
    Another 3.0.9.8.5 patch problem appears to be 5 extra <br>'s within the report customize page top level of buttons and the criteria form. Looks ugly.

    Thanks for the reply.
    Is there nothing I can do to fix this problem before the next 3.0.9 patch comes out? We've have perhaps another few months to go before we make the move to portal release 2.
    This one issue with patch 3.0.9.8.5 is mostly definitely a show-stopper for us...we cannot live with customers seeing errors as basic as "total rows" returned in queries....we will have to roll back to our previous patch level 3.0.9.8.3. By doing this, we will continue to get bad customer feedback because of the awful performance introduced by that patch (Internet Explorer HTTP 1.0 vs 1.1 / keepalives / SSL issue). That's not to mention that we won't see the benefits of the content-area export/import bug fixes in this latest pathset.
    So, if there is ANYTHING we can do to fix this one problem, we (and our customers) would greatly appreciate hearing about it.
    thanks,
    -john

  • Maximum Row Count - dynamically change

    Hi,
    How can I change dynamically (eg. from some item) value "Maximum Row Count" in "Report Attributes -> Layout and Pagination"?
    Is this possible?
    best regards,
    Jarek

    Thank you for your answer, but I want to do something else.
    I want to show all rows from my query in report with pagination.
    The number of rows increases.
    According to documentation, field "Number of Rows" sets the number of rows which I can see on one page and field "Maximum Row Count" sets the maximum number of rows which I can see on all pages (number of rows to query).
    I thougth, that when I set (before page is shown) a variable from eg. query "SELECT count(*) FROM table", I will be able to put this variable name in "Maximum Row Count" field, to see all rows from my query. However this field is the numeric field and I can't put any variable name there :(
    The only way to always show all records from my query is to set "Maximum Row Count" field to very high number? Is this natural way in apex? Is this only way?
    best regards,
    Jarek

  • How to get  visible row  count  in JTable ?

    I have one table which is added to one scroll pane. For example my table have total 1000 rows, but at a time only 20 rows should be visible to the scroll pane. And I want to scroll the rows and show only 20 at a time.When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so on. I want to know how to get that number which represents the visible row( in this case it is 20).So kindly help me how to get visible row count. Any help regarding this will be appriciated.
    Thanks and Regards,
    Sheetal

    how to get visible row count.First you need to get the viewport used by the scrollpane. Then you can use methods like getViewPosition() and getViewSize() to get information about the current postition of and size of the viewport.
    Then you can use the table method getRowAtPoint(). to determine the first and last visible row which can then be used to calculate the visible row count.
    When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so onThis is the default behaviour when a "block" scroll is done.
    However when you click on the arrow button on the scrollbar it will only scroll a single row. You could override the getScrollableUnitIncrement() method to return the value from the getScrollableBlockIncrement() method.
    However the user can still drag the scrollbar manually which would cause a problem. So you would also need to remove the MouseMotionListeners from the scrollbar to prevent this.

  • Conditional display based on row count

    I have a report region with sql query (PL/SQL function body returning sql query). In this region i have text item above the report. I would like to have a condition on this item that it should only show if there exists records in the report (row count > 0).
    How can this be done?
    Best regards
    Erik

    There are many options available for conditional display. You can use this one here:
    http://apex.oracle.com/pls/otn/f?p=31517:7
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • JTextPane + Getting a row count..

    Hi,
    I've been looking for a solution to this, but can't find one already in the forum. there are some close .. but this is my problem..
    I'm looking to get the current row count of a JTextPane... I'm not looking to get the count of '\n'.... I want to take the wrapping into account .. so if I resize the JTextPane, the row counts will change accordingly.
    The reason I'm looking for this information is so I can set the size on the JTextPane so that it always shows the data.. but when it only has one line, I only want it to take up space for one line (the reason for this is I don't want vertical scrollbars appearing where they're not needed)
    I hope I have given enough information for someone to help me out..
    Thanks :)
    /Balmark

    Unfortunately WrappedPlainView's methods and inner classes are private so we can't access it normal way.
    This is an example of hack access to WrappedPlainView. In some cases it can throw access violation exception.
    best regards
    Stas
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    import java.lang.reflect.*;
    public class Test {
    JScrollPane scroll;
    JTextArea textArea=new JTextArea();
    public Test() throws Exception {
    JFrame frame=new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    textArea.setLineWrap(true);
    textArea.setText("12345 67890 12345 67890 12345 67890\n 12345 67890 12345 67890 12345 67890");
    scroll=new JScrollPane(textArea);
    frame.getContentPane().add(scroll);
    JButton b=new JButton("print line count");
    frame.getContentPane().add(b,BorderLayout.SOUTH);
    b.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.err.println(textArea.getUI().getRootView(textArea).getView(0).getViewCount());
    WrappedPlainView pv=(WrappedPlainView)textArea.getUI().getRootView(textArea).getView(0);
    int lineCount=0;
    for(int i=0; i<pv.getViewCount(); i++) {
    View pvLine=pv.getView(i);
    try {
    Class cl=pvLine.getClass();
    Field f=cl.getDeclaredField("nlines");
    f.setAccessible(true);
    lineCount+=f.getInt(pvLine);
    /* Method methodLineCount=cl.getDeclaredMethod("calculateLineCount",null);
    methodLineCount.setAccessible(true);
    Object result=methodLineCount.invoke(pvLine,null);
    System.err.println("Line count="+result.toString());*/
    catch (Exception ex) {
    ex.printStackTrace();
    System.err.println("Line count="+lineCount);
    frame.setSize(200,200);
    frame.setLocationRelativeTo(null);
    frame.show();
    public static void main(String[] args) throws Exception {
    new Test();
    }

  • Interactive report unique row count

    Hi,
    I just want to know if there is a way to do a row count with a unique on an interactive report column.
    What I mean is that I have a report that looks like that
    Project Project type Hours
    Project 1 Project type 1 1
    Project 2 Project type 2 1
    Project 1 Project type 1 1
    Project 3 Project type 3 1
    Project 2 Project type 2 1
    I would like to do a unique on the project name. So, at the end, I would like to have a count that says that I have 3 different projects.
    Is there anyway to do that ?
    Thanks,
    Chantale

    Hi Chantale - did you manage to solve this one?
    Example here (http://apex.oracle.com/pls/otn/f?p=11189:1) showing 14 rows, but only 7 distinct rows. These duplicates are valid, and the SQL cannot be changed. Is there a way through the IR to show a count of 7 (the distinct rows)?
    Thanks,
    Mike
    Edited by: Mike, UK on Oct 2, 2009 12:04 PM

Maybe you are looking for