Getting the recordcount of a RemoteObject query

Can anyone give me an idea of how to display the recordcount
of a returned query in Flex? I'm returning my query results into a
datagrid using RemoteObject via a ColdFusion Component.

Have you tried the length property?
If you're setting your dataGrid something like this...
mydatagrid.dataprovider = event.result as ArrayCollection
You could reference the recordcount like this:
mydatagrid.dataprovider.length

Similar Messages

  • How to get the recordcount of a query in a array

    I have an array called "sums" that holds 4 query's, each
    query has a different number of records.
    Then i use this code to loop the records of the query inside
    the array:
    <cfloop index="x" from="1" to="#arrayLen(sums)#">
    <cfloop index="i" from="1" to="#sums[x].recordcount#">
    data to loop
    </cfloop>
    </cfloop>
    This results in 4 times 4 records, of course as i now use the
    array length in the inner loop.
    My question is, how can i get the recordcount of a query in a
    array so i can use that for the inner loop "to" value.
    Thanks.

    quote:
    Originally posted by:
    MarcovandenOever
    Does sums[x]recordcount point to the first query in the array
    sums when i use it like this?
    In the array there are four query's, i want to loop the
    array, then i want to loop the records of each query.
    <cfloop index="x" from="1" to="#arrayLen(sums)#">
    <cfloop index="i" from="1" to="#sums[x].recordcount#">
    data to loop
    </cfloop>
    </cfloop>
    No. It points to each query in turn. So if you have four
    queries, the first time it will point to sum[1]. Then next time
    sum[2], etcetera. It should work exactly the way you want "as is".
    If you are having a problem, it is probably related to the code
    inside your inner loop.

  • Is there any function module to get the variables used in a query?

    Hi experts
    Please, do you know if is there any function module to get the variables used in a query?
    Thanks and regards
    Luis

    Hi Srini
    Yes, I have checked the tables but I need a function module
    Thanks anyway!
    Luis

  • Getting the recordcount of a third table from a Join query

    Hi Folks,
    I've been trying to get my head around the best way of doing
    this within a single query, and sadly none of the books within my
    collection touch upon this scenario.
    I'm using the query below to query 2 tables as you can see. I
    want to add in a further query which searches a third table
    'ccsample' looking for matching records in the 'merchant_id' field
    against the merchant_id field of the cc_watchlists table. I only
    want to return the recordcount from the 'ccsample' table.
    I've tried adding another join, however if the recordcount in
    ccsample is 0, no records are returned at all (the query below
    returns 2 rows).
    I hope this makes sense!
    Query;
    <cfquery name="getwatched" datasource="#datasource#">
    SELECT r.retailer_name, r.id, r.shortname, d.id AS wid,
    d.merchant_id, d.user_id, d.e_updates
    FROM cc_watchlists d
    LEFT JOIN merchants r
    ON d.merchant_id=r.id
    WHERE d.user_id=#SESSION.Auth.ID#
    ORDER BY r.retailer_name ASC
    </cfquery>

    Did you make it a LEFT (OUTER) JOIN as well (something like
    below)? Not sure about what database you are using, but the
    ISNULL() function in MSSQL will convert any instances where you
    don't have a match to a 0 for counting purposes.
    SELECT r.retailer_name, r.id, r.shortname,
    d.id AS wid,d.merchant_id, d.user_id, d.e_updates,
    COUNT(ISNULL(c.merchant_id, 0)) AS cc_count
    FROM cc_watchlists d
    LEFT JOIN merchants r ON d.merchant_id=r.id
    LEFT JOIN ccsample c ON d.merchant_id=c.merchant_id
    WHERE d.user_id=#SESSION.Auth.ID#
    GROUP BY r.retailer_name, r.id, r.shortname,
    d.id,d.merchant_id, d.user_id, d.e_updates
    ORDER BY r.retailer_name ASC
    Phil

  • How to get the role name in which query is published ?

    Hi Experts,
       Is there any table where i can get the name of the role in which a particular query is published. I know that if i have a role , i can check in pfcg giving that role name and in menu tab i can see all the queries published under that role. But if i know query but not role how to get the role name . Is there any table or functon modules or programs to get the information.
    Thanks & Regards
    Vamsi Kiran

    Check this table
    AGR_HIER

  • Get the column names of a query (in own plugin)

    Hi,
    I'm developing my first plugin. It is a region plugin where the plugin-user passes a sql query as the source that the plugin will turn into a formated report.
    I found how to retreive the query result by using APEX_PLUGIN_UTIL.GET_DATA functions. Since it is an array, it is simple to cycle through the data rows. But how can i figure out
    1) how many columns the query returns
    2) whats the name of the columns is?
    Thanks a lot in advance for any hint...
    Cheers, Hans

    Hi Hans,
    the package APEX_PLUGIN_UTIL provides everything you need. No need to do your own DBMS_SQL handling!
    Have a look at the API documentation and the example of GET_DATA at http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plugin_util.htm#BABFBIJD
    The t_column_value_list record type is a two dimensional array defined as
    type t_column_value_list  is table of wwv_flow_global.vc_arr2 index by pls_integer;The first array contains an entry for each column.
    l_column_value_list.COUNTcan be used to get the number of columns.
    l_column_value_list(1).COUNTcan be used to get the number of rows. An example to iterate over all columns and rows:
    for l_column in 1 .. l_column_value_list.count loop
        for l_row in 1 .. l_column_value_list(l_column).count loop
            sys.htp.p('column#=' || l_column || ' row=' || l_row || ' value: ' || l_column_value_list(l_column)(l_row));
        end loop;
    end loop;If you need the name of the columns and maybe the original data type and not everything converted to VARCHAR2 you have to use the more sophisticated GET_DATA2. See http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plugin_util.htm#BABFJHAI
    This function returns the record type t_column_value_list2 which is defined as
    type t_value is record (
        varchar2_value      varchar2(32767),
        number_value        number,
        date_value          date,
        timestamp_value     timestamp,
        timestamp_tz_value  timestamp with time zone,
        timestamp_ltz_value timestamp with local time zone,
        interval_y2m_value  interval year to month,
        interval_d2s_value  interval day to second,
        blob_value          blob,
        bfile_value         bfile,
        clob_value          clob );
    type t_value_list is table of t_value index by pls_integer;
    type t_column_values is record (
        name       varchar2(32767),
        data_type  varchar2(20), /* use c_data_type_* constants to compare */
        value_list t_value_list );
    type t_column_value_list2 is table of t_column_values         index by pls_integer;Again, it's some kind of two dimensional array. The first dimensions are the columns. But this time you also get some details of the parsed column. For example:
    for l_column in 1 .. l_column_value_list2.COUNT loop
        sys.htp.p('Column Name: ' || l_column_value_list2(l_column).name || ' Data Type: ' || l_column_value_list2(l_column).data_type );
    end loop;Will return you all the columns of the SQL statement. Using "name" and "data_type" you can get the column name and the data type. To access the values you can use
    for l_column in 1 .. l_column_value_list2.COUNT loop
        sys.htp.p('Column Name: ' || l_column_value_list2(l_column).name || ' Data Type: ' || l_column_value_list2(l_column).data_type );
        for l_rows in 1 .. l_column_value_list2(l_column).value_list.COUNT loop
            sys.htp.p(
                'row=' || l_row || ' value: ' ||
                apex_plugin_util.get_value_as_varchar2 (
                    p_data_type => l_column_value_list2(l_column).data_type,
                    p_value     => l_column_value_list2(l_column).value_list(l_row) );
        end loop;
    end loop;I used apex_plugin_util.get_value_as_varchar2 to always get a VARCHAR2, independent of the actual data type of the column. If you need the original data type, use "number_value", ... of the t_value record type.
    Hope that gives you a direction
    Patrick
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to get the layouts in ABAP program/Query

    Hi -
    I had created some layouts for a ABAP query and I can see them in the table LTDX as well.
    But I had deleted the layouts while changing the query settings.
    How can I get those layouts back in my query? Please suggest. Thanks.

    Hi,
    Did you check with the below function modules,
    ALV_LAYOUT_GET
    REUSE_ALV_VARIANT_F4
    Also try executing the report, RSVARDOC_610, which will enable the variants sometimes after some modifications.
    I am not sure, but may be you can have a look.....

  • Get the latest date record in Query

    Hi, Expert:
    Please help on this:
    The requirement is to get the the latest date record in Query. For example:
    Data in provider:
    Plant          date            amount
    A01         2007/04/08      30
    A01         2007/06/09      70
    A01         2007/12/08      30
    we only want the query display:
    A01         2007/12/08      30
    I have tried exception aggregation, but it does not work. Any ideas are highly appreciated.

    Or you can model the date as a key figure after 0date_kyf and set aggregation to max, you'll get something like
    select plant, amount, max(date) from ... group by plant, amount
    used it for inventory reporting (materials and their last movement date, days from the last movement etc.) and worked well.

  • How to get the execution time of a query

    Hi,
    Environment: 10.2.0.4.0
    Just wondering how I can get the query execution time? I am not interested in the query output nor do I want the statistics, just the execution time?
    Any suggestions will be appreciated
    Thanks in advance
    rogers42

    If you're using SQL*Plus
    SQL> set autotrace traceonly
    SQL> set timing on
    SQL> <<your query here>>SQL*Plus will fetch all the data and then report the query plan, execution statistics, and elapsed time. It will not display the actual data.
    SET TIMING ON alone tells SQL*Plus to display the execution time of each SQL statement-- the problem is that it also displays all the data which can skew the results because you're including the time required by SQL*Plus to pipe a bunch of data to the screen.
    Justin

  • How to get the CPU time of a query?

    Hello all, will someone pls tell me how to get the CPU time instead of Elapsed Time of a query?
    Thanks.

    If i am not wrong, Jonathan Lewis blogged about the changed behaviour.
    Here is short test:
    SQL> CREATE OR REPLACE FUNCTION Cpu RETURN NUMBER IS
      2    Retval NUMBER;
      3  BEGIN
      4    SELECT m.VALUE
      5    INTO      Retval
      6    FROM      V$statname s, V$mystat m
      7    WHERE  s.Statistic# = m.Statistic#
      8    AND       NAME = 'CPU used by this session';
      9    RETURN Retval;
    10  END;
    11  /
    Function created.
    cat cpu_test.sql
    DECLARE
    TYPE t IS TABLE OF NUMBER;
    tt t;
    BEGIN
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM all_objects;
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY object_type) BULK COLLECT INTO tt FROM user_objects;
    dbms_output.put_line(cpu());
    SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM dba_objects;
    dbms_output.put_line(cpu());
    END;
    SQL> select * from v$version
      2  /
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Linux: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL> @cpu_test
    0
    0
    0
    0
    PL/SQL procedure successfully completed.
    SQL> @cpu_test
    106
    106
    106
    106
    PL/SQL procedure successfully completed.
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> set serveroutput on
    SQL> @cpu_test
    1
    129
    130
    145
    PL/SQL procedure successfully completed.
    SQL> @cpu_test
    145
    273
    275
    290
    PL/SQL procedure successfully completed.Best regards
    Maxim

  • Get the record count from a query

    Hi,
    does anyone know how to get the record count from a sql query?
    e.g: I've got a ResultSet from the Statement.excuteQuery(), and I want to know how many records this ResultSet contains, how to get this?
    I'd read thoughout the documents of Statement and ResultSet, but couldn't find a solution, do I have to use another seperate query such as "select count(*)" to do this?
    thanks.
    Yang Liu

    If you are not using a scrollable result set then the following is the best way to do it.
    there are several key words in SQL that can be used, the one you are interested in is count();
    so if your query at the moment is
    "select col1, col2, col3 from my_table where col2=? and col3=?"you can work out how many rows will be returned by executing this command first
    "select count(col1) from my_table where col2=? and col3=?"this will return a result set with one row and one column, you can get the row count as follows:
    ResultSet rs = ps.executeQuery();
    int rowCount = rs.getInt(1);I hope this helps :)

  • Getting the input values in xacute query

    Hi friends,
       I have webpage which should send production order number to the xacute query.
         In the xacute query iam calling a BLT where i have defined a transcation property for this production order number of type input and defined tracer to check whether its getting any prodution number or not.
    When am testing the xacute query i was not getting any production number which i was passing thru webpage.
    Can anybody tell me how should i get the value from the webpage to the xacute query.
    Please help me out.
    Thanks in advance.
    Regards
    Sireesha.

    Hi,
    I hope you get the production order no from some applet.
    Include one more param and call a funtion in that applet
    For example:
    <param name="CellSelectionEvent" value="Functionname">
    Then add your Xacute query template in your webpage.
    In the function, You call this query and set the param.
    For example:
    If you enter some value through forms in webpage
    functionname()
    var x = document.<xacute applet name>.getQueryObject();
    x.setParam(1,document.forms[0].<value>);
    If you get values from applet(applet name)
    functionname()
    var x = document.<xacute applet name>.getQueryObject();
    x.setParam(1,document.<applet name>.getGridObject().getSelectedCellValue(columnno);
    You can also directly call this transaction in your web page via URL and pass the parameter.
    In this case thee is no need to create xacute query.
    Hope this helps you.
    Regards,
    P.S.Kishore kumar

  • Where can I get the itab of generated sap query?

    Hi all,
    I generated a sap query which can display list of table in SAP ALV.
    Now I need to get the itab from the generated codes to perform some custom coding like sending the display list in email body message.
    Where can I get the itab now? From the SAP Query program I noted:
    data: begin of %g00 occurs 100,
                P0000-PERNR like P0000-PERNR,
                P0002-VORNA like P0002-VORNA,
                P0002-NACHN like P0002-NACHN,
                P0019-MNDAT like P0019-MNDAT,
                P0019-BVMRK like P0019-BVMRK,
                TEXT_P0019_BVMRK like TEXT_P0019_BVMRK,
                P0019-TERMN like P0019-TERMN,
                P0019-TMART like P0019-TMART,
                TEXT_P0019_TMART like TEXT_P0019_TMART,
                SYHR_A_P0019_AF_TEXT1 like SYHR_A_P0019_AF_TEXT1,
                SYHR_A_P0019_AF_TEXT2 like SYHR_A_P0019_AF_TEXT2,
                SYHR_A_P0019_AF_TEXT3 like SYHR_A_P0019_AF_TEXT3,
                P0019-UNAME like P0019-UNAME,
                %alvcount type i,
          end of %g00.
    data: begin of %%g00,
                P0000-PERNR(008),
                P0002-VORNA(030),
                P0002-NACHN(030),
                P0019-MNDAT(010),
                P0019-BVMRK(001),
                TEXT_P0019_BVMRK(040),
                P0019-TERMN(010),
                P0019-TMART(002),
                TEXT_P0019_TMART(081),
                SYHR_A_P0019_AF_TEXT1(072),
                SYHR_A_P0019_AF_TEXT2(072),
                SYHR_A_P0019_AF_TEXT3(072),
                P0019-UNAME(012),
          end of %%g00.
    I tried to declare DATA lt_g00 TYPE TABLE OF %g00 in infoset (END-OF-SELECTION After list output) but it cannot compile. It gives out the error message: Type "%G00" is unknown
    Anyone have any idea?

    Hi, colleagues!
    If someone's facing the same problem - it seems to be that the only solution is to use something like this:
    FIELD-SYMBOLS: <fs_alv_copy> TYPE ANY TABLE.
    ASSIGN ('(NAME_OF_YOUR_GENERATED_REPORT)%G00[]')
    TO <fs_alv_copy>.
    and then work with field symbol.

  • How can I get the same result using single query?

    There are 3 tables
    1) tool_desc -
    a master table for storing tool records,
    columns tool_no, tool_chg,
    # of records = 1.5 Millon
    2) step_desc -
    a master table for storing plan wise step records,
    columns plan_id, step_key,
    # of records = 3700 Million
    3) step_tool - a transaction table storing tools to the steps,
    columns plan_id, step_key, tool_no, tool_chg
    For each step in the step_desc table, I need to randomly fetch 1 to 50 tools from tool_desc and insert them into step_tool table.
    Using PL/SQL block, it is like the following -
    begin
    for x in (select plan_id, step_key from step_desc) loop
    insert into step_tool(
    plan_id,
    step_key,
    tool_no,
    tool_chg)
    select
    plan_id,
    x.step_key,
    tool_no,
    tool_chg
    from
    tool sample(0.1)
    where
    rownum <= trunc(dbms_random.value(1,51))
    commit;
    end loop;
    end;
    I need to do the same using a single query so that I can use the CTAS (create table as select) statement and load the data as a bulk.
    Can I do that?

    If they have parent child releation, you can use connect by prior clause,

  • How to get the child data in MDX query?

    I have an MDX query that will return the data for an OLAP report. These report data include the parent_id, child_id and some dimensions data in it. How do I modify the MDX query to have a New member to show a dimension value of the child_id.
    The child_is is actually the parent_id on another row. It is the "Pstpd Decision" I want to be included in a new column using the "Appeal Id". Thanks
    WITH MEMBER [Measures].[Avg TA Time] AS [Measures].[Turn Around Time]/[Measures].[Number of Request]
    SELECT NON EMPTY { [Measures].[Number of Request] } ON COLUMNS,
    NON EMPTY { ([Request Date Time].[FY-AP].[Account Period].ALLMEMBERS *
    [Request Drugs].[Drug Generic Name].[Drug Generic Name].ALLMEMBERS *
    [Dispensary].[Dispensary Hierarchy].[Dispensary].ALLMEMBERS *
    [Disease].[Tumour Group Site].[Tumour Group Site].ALLMEMBERS *
    [Disease].[Tumour Group Sub Site].[Tumour Group Sub Site].ALLMEMBERS *
    [Patient].[Patient Agency ID].[Patient Agency ID].ALLMEMBERS *
    [Pstpd Decision].[Decision].[Decision].ALLMEMBERS *
    [Request].[Request Id Key].[Request Id Key].ALLMEMBERS *
    [Request].[Appeal Id].[Appeal Id].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( { [Appeal Yes No].[Status].&[Yes] } ) ON COLUMNS
    FROM ( SELECT ( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED) ) ON COLUMNS
    FROM [CAP Request])) WHERE ( IIF( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED).Count = 1, STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED), [Request Date Time].[Fiscal Year].currentmember ), [Appeal Yes No].[Status].&[Yes] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    data. 
    Kahlua

    I got it to work by adding the child_id's "decison' to the fact table as it is alot easier to get that data using Sql Script while creating the fact table and also there is already a "decsion" dimension setup. In the cube I can select the
    parent_id's decision and/or child_id's decision. It is working on the report. Thanks.
    Kahlua

Maybe you are looking for

  • Snow Leopard Printing Woes - what worked for me

    I found many print problems posted EVERYWHERE from every printer manufacturer and model and many solutions and some worked for some people. None worked for me. I have a HP Laserjet 2100M, which is old, but is listed as compatible with SL. I cannot pa

  • Incorrect Language txt Being Displayed

    Hi We have recently gone live using ECC 5.0 in a new region, Spain, when the users logon using using ES, certain transactions are showing the text in German, such as transaction S_ALR_87013624 ? Spanish language has been imported 2 years ago and was 

  • PDF does not save filled out fields when using browser

    Hello! I have a couple PDFs that I've uploaded to my website for clients to fill out and download. I'm getting complaints that clients are filling out the form, saving it to their computer, but when re-opening the now saved form, none of the fields a

  • How to get current locale / language

    Hi, I am trying to change the default startup settings for a CDE session, and I need to edit the file /usr/dt/config/lang/sys.session There are two possibilities: /usr/dt/config/C/sys.session or /usr/dt/config/en_US.UTF-8/sys.session How can I find o

  • MS-Access Startup Parameters?

    Is there a way I can call MSACCESS.exe to open a certain .accdb and pass parameters to that accdb? Or will I need to design my outside program to write to a file and just have the accdb parse that outside file as it opens? Mediocre Access 2010 | (Bab