How to get count of rows for a table?

Hi,
How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
Regards,
Devashish

Hi Devashish,
WdContext.node<Your_node_name>().size() will give you the no: of rows.
This should be the node that is bound to the table's datasource property.
WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
You can access an attribute of a particular row as
WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
Hope this helps,
Best Regards,
Nibu.
Message was edited by: Nibu Wilson

Similar Messages

  • How to get count as 0 for records not in table

    Hi All,
    I have requirement where I need count of records in the table based on ids. Example query below
    SELECT empid ,
    nvl(COUNT(id), 0) empcount
    FROM employee
    WHERE empid IN(1, 2, 4, 5)
    GROUP BY empid
    In the table only record for "empid=2" is present so I get count 1 for it. But with it I should get count as 0 for non existing records. Expecting below output
    empid | empcount
    1 | 0
    2 | 1
    4 | 0
    5 | 0
    Appreciate your help and Thanks in advance.
    Regards.
    Ashish

    e.g.
    SQL> select column_value deptno, count (deptno)
    from emp, table (sys.odcinumberlist (10, 20, 100))
    where deptno(+) = column_value
    group by column_value
        DEPTNO COUNT(DEPTNO)
            10             3
            20             5
           100             0
    3 rows selected.

  • How to get the selected rows in a table

    Hi,
    How to get the ids of all the selected rows. On Page load a query is executed that shows the data in a table with a checkbox in the first column to select the rows and delete. Now if a user select multiple rows how do I get the ids of selected rows in the backend code.
    Thanks

    Please search the forum before posting questions.
    refer following thread for table selection.
    Re: Record selection with MessageCheckBox and print the selected record.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • How to get all minimum values for a table of unique records?

    I need to get the list of minimum value records for a table which has the below structure and data
    create table emp (name varchar2(50),org varchar2(50),desig varchar2(50),salary number(10),year number(10));
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',3000,2005);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',4000,2007);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2007);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2008);
    insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2010);
    commit;
    SELECT e.name,e.org,e.desig,min(e.year) FROM emp e,(
    SELECT e1.name,e1.org,e1.desig,e1.salary FROM emp e1
    GROUP BY (e1.name,e1.org,e1.desig,e1.salary)
    HAVING COUNT(*) >1) min_query
    WHERE min_query.name = e.name AND min_query.org = e.org AND min_query.desig =e.desig
    AND min_query.salary = e.salary
    group by (e.name,e.org,e.desig);With the above query i can get the least value year where the emp has maximum salary. It will return only one record. But i want to all the records which are minimum compare to the max year value
    Required output
    emp1     org1     mgr     7000     2008
    emp1     org1     mgr     7000     2007Please help me with this..

    Frank,
    Can I write the query like this in case of duplicates?
    Definitely there would have been a better way than the query I've written.
    WITH      got_analytics     AS
         SELECT     name, org, desig, salary, year
         ,     MAX (SALARY)  OVER ( PARTITION BY  NAME, ORG, DESIG)          AS MAX_SALARY
         ,     ROW_NUMBER () OVER ( PARTITION BY  NAME, ORG, DESIG, SALARY
                                    ORDER BY        year  DESC
                           )                              AS YEAR_NUM
           FROM    (SELECT 'emp1' AS NAME, 'org1' AS ORG, 'mgr' AS DESIG, 3000 AS SALARY, 2005 AS YEAR FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',4000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',4000,2008 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2008 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL)
    SELECT     name, org, desig, salary, year
    FROM     got_analytics
    WHERE     salary          = max_salary
    AND     YEAR_NUM     > 1
    Result:
    emp1     org1     mgr     7000     2010
    emp1     org1     mgr     7000     2008
    emp1     org1     mgr     7000     2007
    emp1     org1     mgr     7000     2007
    WITH      got_analytics     AS
         SELECT     name, org, desig, salary, year
         ,     MAX (SALARY)  OVER ( PARTITION BY  NAME, ORG, DESIG)          AS MAX_SALARY
         ,     ROW_NUMBER () OVER ( PARTITION BY  NAME, ORG, DESIG, SALARY
                                    ORDER BY        year  DESC
                           )                              AS YEAR_NUM
      ,     ROW_NUMBER () OVER ( PARTITION BY  NAME, ORG, DESIG, SALARY, Year
                                    ORDER BY        YEAR  DESC
                           )                              AS year_num2
         FROM    (SELECT 'emp1' AS NAME, 'org1' AS ORG, 'mgr' AS DESIG, 3000 AS SALARY, 2005 AS YEAR FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',4000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',4000,2008 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2008 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL UNION ALL
    SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL)
    SELECT     name, org, desig, salary, year
    FROM     got_analytics
    WHERE     salary          = max_salary
    AND     YEAR_NUM     > 1
    AND YEAR_NUM2 < 2
    Result:
    emp1     org1     mgr     7000     2008
    emp1     org1     mgr     7000     2007

  • OBIEE - How to get count of members for a level?

    I have a dimension logical table and hierarchy defined in my BMM layer. I want to define a logical column that can get distinct count of members at Level0.
    Level2
    Level1
    Level0
    I tried creating a logical column using Level0 key and Count Distinct aggregation function in my dimension table. But when I use this column in the report, it gives navigation space error.
    Any ideas/thoughts on how to achieve this?
    Thanks in advance

    Aggregations always work on columns in a logical fact table and never on a logical dimension
    - Create a logical fact table based on the same physical table
    - Create a logical join between the newly created fact table and the dimension table whose levels we want to count
    - Create the Count Distinct columns, one each based on the level key columns
    - Expose the columns to the presentation
    - Deploy the rpd and it works like a charm
    Edited by: Mahesh Jayashankar on May 31, 2011 8:45 AM

  • How to get count of records for each type from internal table

    Hi Guys,
    I want to implement a logic to find out the count of records in a internal table.
    Assume my internal table have one field having the entries as shown below.
    Internal table Entries
    10
    10
    10
    11
    11
    12
    12
    12
    12
    13
    14
    14
    15
    15
    15
    15
    15
    16
    16
    17
    18
    19
    20
    20
    20
    ....... etc....
    I should get an output as below
    10's - 3
    11's -2 ,
    12's - 4.... etc..
    Could any one help me how to do this.
    Thanx,
    Kumar

    REPORT  zzz.
    DATA: i(100),
          t(100),
          j TYPE n.
    TYPES: BEGIN OF gt_int_type,
            linex(100) TYPE c,
           END OF gt_int_type.
    DATA: gt_int TYPE STANDARD TABLE OF gt_int_type,
          wa_int LIKE LINE OF gt_int.
    START-OF-SELECTION.
      wa_int-linex = '10'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '10'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '10'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '11'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '11'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '12'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '12'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '12'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '12'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '13'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '14'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '14'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '15'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '15'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '15'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '15'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '15'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '16'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '16'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '17'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '18'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '19'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '20'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '20'.
      APPEND wa_int TO gt_int.
      wa_int-linex = '20'.
      APPEND wa_int TO gt_int.
      LOOP AT gt_int INTO wa_int.
        WRITE:/ wa_int-linex.
      ENDLOOP.
      ULINE.
      SKIP 3.
      SORT gt_int BY linex.
      READ TABLE gt_int INDEX 1 INTO i.
      j = 0.
      LOOP AT gt_int INTO wa_int.
        IF wa_int-linex EQ i.
          j = j + 1.
        ELSE.
          WRITE:/ i,'''s = ', j.
          j = 1.
          i = wa_int-linex.
        ENDIF.
      ENDLOOP.
      WRITE:/ i,'''s = ', j.
    consider clearing leading/trainling spaces...

  • How to define 'First Vsible row'  for Tree table in Web Dynpro

    Hi,
    I am using a table with a treebykeytablecolumn. The user can change the selected
    line from another view and then I change the selected line within the tree according to his choice. This works fine.
    Unfortunatelly, I did not succeed to change the displayed page in the tree, so the user has to scroll up or down to see the selected data, if it is not on the current page.
    I try to bind the 'FirstVisibleRow', using the index of the selected element, but this
    index does not fit. The page changes, but as the index is somehow 'wrong', it is not
    the expected page that is shown.
    Looping at the node, my selected element get index 30, but the selected line is the 8th one (regarding what is current ly open or not in the tree) and the 14th if we expand all nodes above.
    So, is there a way to specify which line to be the 1st visible one when there is a tree column?
    thanks a lot for your help.
    reagrds,
    barbara

    Follow these steps,
    1- Create an attribute with char1 in the view context e.g first_vis_row
    2- go to the table properties in view and bind the property first_visible_row to this attribute.
    3- NOw go to the wddoinit method of the view...
    4- read the internal table and find out the index of the row which you want to set as first row. As in ur case you want a specific date in first row. So read the internal table and findout the index.
    5- now write this code, say your attribute name is first row inside node flag1...(you can change it for yoru requirement)
    DATA lo_nd_flag1 TYPE REF TO if_wd_context_node.
      DATA lo_el_flag1 TYPE REF TO if_wd_context_element.
      DATA ls_flag1 TYPE wd_this->element_flag1.
      DATA lv_first_row LIKE ls_flag1-first_row.
    * navigate from <CONTEXT> to <FLAG1> via lead selection
      lo_nd_flag1 = wd_context->get_child_node( name = wd_this->wdctx_flag1 ).
    * get element via lead selection
      lo_el_flag1 = lo_nd_flag1->get_element(  ).
    * get single attribute
      lo_el_flag1->get_attribute(
        EXPORTING
          name =  `FIRST_ROW`
        IMPORTING
          value = lv_first_row ).
    here change the lv_first_row to the index which you got after raeading the internal table.
    suppose it's
    lv_first_row = 4.
      lo_el_flag1->set_attribute(
        EXPORTING
          name =  `FIRST_ROW`
          value = lv_first_row ).
    Hope it works.

  • How to get no of rows in xslt table in javascript function

    Hi ,
    I have an XSLTtable and I want to access the no of rows in java script function.
    Please help me in this issue.
    Thanks in advance,
    Raj.

    Hi Raj
    Use xslt count function for this.
    Use xslt to generate value like
    <input type="hidden" id="NoOfRow" value="{count(//Row)}"/>
    You can use value of hidden variable using javascript
    Regards
    Anshul

  • Get all the rows of the table

    Hi,
         In my example I want to get all the rows of the table. The table has 20 rows. The visibleRowCount is set to 7 and firstVisibleRow is set to 3.
         I have created the table as
         var oTable = new sap.ui.table.Table({
               id: "oTable",
               title: "My Table",
               visibleRowCount: 7,
               firstVisibleRow: 3,
               selectionMode: sap.ui.table.SelectionMode.Single
         I tried to get the rows of the table using the below code
         var table = sap.ui.getCore().byId("oTable");
         var rows = table.getRows();     //     Returns only 7 rows     
        How to get all the rows of the table when the table is populated with a odata service  ?       

    Hi Vishal,
    The table only put in the html file the rows that you define in visiblerowcount (rows control). The method getRows, get this controls, and you only have 7. The table control render automacatically the data in thats rows when you scroll on it.
    If that you want is to retrieve the data of the rows, you need catch it from the model:
    oTable.getModel().getData();
    Regards,

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • How to get Only 20 rows? (Urgent)

    Hi, everyone.
    If I want to get only 20 words from a table,
    how can I write query?
    For example,
    Table name: WORD (this table is like dictionary)
    columns: W_WORD, W_MEANING
    Select * FROM WORD
    WHERE W_WORD LIKE 'H%'
    ORDER BY W_WORD ASC
    This query gets all the words starting with 'H'.
    But, I want to get only 20 results(rows).
    How can I do? I'm using MS Acess.
    Please response me. Thank you.

    You seem to be using SQLserver.
    SELECT TOP 20 *
    FROM WORD
    WHERE W_WORD LIKE 'H%'
    ORDER BY W_WORD ASC
    Look up the TOP clause in the docs for further info, other DBMS may have different syntaxes for this functionality

  • How to get the last error for while loop?

    How to get the last error for while loop? I just want transfer the last error for while loop, but the program use the shift register shift all error every cycle.

    What do you mean by "get" and "transfer"?
    If the shift register is not what you want, use a plan tunnel instead.
    Typically, programmers are interested in the first, not last, error.
    Can you show us your code so we have a better idea what you are trying to?
    LabVIEW Champion . Do more with less code and in less time .

  • How to calculate number of rows for perticular characterstic in SAP BI Bex

    Hi experts,
    Please let me know how to calculate  ' number of rows  ' for perticular characterstic in Bex query. 
    Thanks & Regards,
    Babu..

    Hello,
    You can try this
    Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select  'always display'.
    Thanks.
    With regards,
    Anand Kumar

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

Maybe you are looking for

  • How do I authorize itunes music using an old apple id from an email that no longer exists?

    I have a lot of music in my itunes that is linked to my old apple id account from an old computer. I no longer have this computer or the email account. The email I used no longer exists (so I can't receive the recovery emails) and I completely forgot

  • Connect imac 2011 to hdtv

    Hi, I am trying to connect my mid-2011 iMac to my HDTV but can't find any useful information on the Internet. The iMac lacks a display port thus I am not sure what connector I need to purchase to have a dual screen setup. Is there any adapter in the

  • Internal Server Error #(IS6532) and Auth701 Servis...

    Dear Sirs To save you repeating yourselves by trying to give me fruitless advice, I'm going to start by telling you what I already know. Please rest assured though that this is a complaint. I know that BT have fallen out with Yahoo and that you're tr

  • Remove old Adobe Add-ons for PS CC, CS6

    Keep geting "Uinstalling The Add-on Lorem Ipsum Generator failed Generator for Photoshop CC, CS6., please try again. I don't want it installed, since it for an old version of Photoshop and i only have the latest version installed (Photoshop 2014 CC).

  • Fundamental Networking in Java - book announcement

    Announcing the publication of my new book Fundamental Networking in Java, Springer-Verlag, aimed squarely & with thanks at all denizens of this forum and at Java network programmers everywhere. Scope: everything you can do with a Socket. See http://w