Query rows returned VS csv rows downloaded

Does anyone know whether it's possible to have the rows returned by the query to the default of 500 but the actuall rows downloaded in the .csv file to be all the rows that would have been returned from the query? (otherwise the performance of the query is too slow if you try and get the limit of 10,000 rows)
Thanks
Alice

Alice,
You can define the number of rows on a page (using number of rows) and the total number of rows retrieved from your query (using max row count). The total number is what’s returned when you export your report as a CSV file. And if you’re page renders too slowly when you set the total number of rows to 10000, you could try using the simple pagination style “Row Ranges X to Y”. With this pagination style, the report would only process your result set up to the max row shown on the current page.
Regards,
Marc

Similar Messages

  • Query to return ALL rows even those with zero counts

    Hi,
    The following query will return only those rows that have a non zero count value:
    select c.id, a.name, count(*) as XYZ from CON c, CUST a
    where c.help !='1' and (c.id = a.id) group by c.id, a.name order by c.id;
    The results are:
    1 ME 3
    3 YOU 4
    What i want is to return all rows in CUST and the count, XYZ, that correspond to each row in CUST that matches the whare condition above, even if the count is zero.
    ie
    1 ME 3
    2 WE 0
    3 YOU 4
    Can this be done?

    You may want to get the counts then do the outer join. If you simply count with an outer join you will get 1 for 'WE' because there is a row in the cust table with 'WE'. This may work for you;
    with
      cust as (
       select 1 id, 'ME' name from dual union all
       select 2 id, 'YOU' name from dual union all
       select 3 id, 'WE' name from dual),
      con as (
       select 1 id, '2' help from dual union all
       select 1 id, '2' help from dual union all
       select 1 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual)
    -- end of test data 
    select a.id, a.name, nvl(c.cnt,0) xyz
    from cust a, 
       (select id, help, count(*) cnt
       from con
       where help !='1'
       group by id, help) c
    where a.id = c.id(+)

  • Can we put a range on company code 100 to 999 in query row definition?

    Hi all,
    Does anyone know how to define a blank range on a query row definition? For example, we need to put a company code range from 100 to 999 in order to have a range large enough to cover future new comapny codes, but we do not have master data exist for comapny code 999 in BW, It does not seem I can put ccode 999 in the query definition screen.  I used hierarchy as a workaround. I created a company code hierarchy to include the range from 100 to 999 and then pull the hierarchy to the query definition.  It worked, but I have some problems when I use structure in conjunction with the hierarchy.  Anybody have an idea?

    Hi Nancy,
    I believe a simple selection option variable can work for you..
    You would have to create them for each row..
    So for each selection in your structure you can restrict by the respective Variable..
    While creating the variable specify the default values you want eg: 100 to 999 .
    You doot need to have it ready for input..and even if these values are not present in master data it will allow you to use these values in the variable default values..
    Let me know if you need any clarification..
    Ashish..

  • Query rows to column

    dear Friends,
    i need query row to column
    example
    1 a data1 data2 data3
    2 b data1 data2 data3
    output format
    1 2 a
    data1 data2 data3

    Please consider the following when you post a question.
    1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
    You can use the following query and do a copy past of the output.
    select * from v$version 2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
    that are asked the answer is already there.
    3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
    I have the following table called sales
    with sales
    as
          select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
          union all
          select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
    select *
      from sales 4. Rather than telling what you want in words its more easier when you give your expected output.
    For example in the above sales table, I want to know the total quantity and number of invoice for each product.
    The output should look like this
    Prod_id   sum_qty   count_inv
    1         145       2 5. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
    6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
    Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
    use the {noformat}{noformat} tags.
    The usage of the tag is like this.
    <place your code here>\
    7. If you are posting a *Performance Related Question*. Please read
       {thread:id=501834} and {thread:id=863295}.
       Following those guide will be very helpful.
    8. Please keep in mind that this is a public forum. Here No question is URGENT.
       So use of words like *URGENT* or *ASAP* (As Soon As Possible) are considered to be rude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to - extract query result set in CSV and make multiple files if result set is huge.

    I have a query which returns millions of rows. I need to extract those rows in CSV files. Having said that i want to keep these files under a limit of 500 MB . Result set can be distributed among multiples files but each file can not be > 500 MB in size.
    How to achieve this?

    You may use this standard! procedure from Blushadow and produce something useful for your need. https://community.oracle.com/message/6499123#6499123

  • Query to return list of all missing primary key ids from table T1

    I found this query online that returns a start and stop for a range of all missing primary key id values from table T1. However i want to rewrite this query to return a whole list of all the missing primary key ids and not a start and stop range. any help plz?
    select strt, stp
    from (select m.id + 1 as strt,
    (select min(id) - 1 from T1 x where x.id > m.id) as stp
    from T1 m left outer join T1 r on m.id = r.id - 1 where r.id is null)x where stp is not null

    with t as
              select  1 as id from dual union all
              select  2 as id from dual union all
              select  3 as id from dual union all
              select  5 as id from dual union all
              select  8 as id from dual union all
              select 10 as id from dual union all
              select 11 as id from dual union all
              select 20 as id from dual
    select  id_start + level missing_id
      from  (
             select  id id_start,
                     nullif(lead(id) over(order by id) - 1, id) id_end
               from  t
      start with id_end is not null
      connect by prior id_start = id_start
             and prior dbms_random.random is not null
             and level <= id_end - id_start
    MISSING_ID
             4
             6
             7
             9
            12
            13
            14
            15
            16
            17
            18
    MISSING_ID
            19
    12 rows selected.Or:
    with t as
              select  1 as id from dual union all
              select  2 as id from dual union all
              select  3 as id from dual union all
              select  5 as id from dual union all
              select  8 as id from dual union all
              select 10 as id from dual union all
              select 11 as id from dual union all
              select 20 as id from dual
    select  id_start + level - 1 missing_id
       from  (
              select  min(id) id_start,
                      max(id) id_end
                from  t
       connect by level <= id_end - id_start
    minus
    select  id
       from  t
    MISSING_ID
             4
             6
             7
             9
            12
            13
            14
            15
            16
            17
            18
    MISSING_ID
            19
    12 rows selected.SY.

  • Query to return next 7 dates

    Hello,
    is there a way to return the next 7 dates just using a query... for example, I need a query that returns:
    select (I don't know that put here) from dual
    Date
    2012-10-05
    2012-10-06
    2012-10-07
    2012-10-08
    2012-10-09
    2012-10-10
    2012-10-11
    If possible, I would like to know if there's a way to pass a date and based on it, the query returns the next 7 dates based on the passed date... for example:
    select (I don't know that put here) from dual where date > '2012-10-15'
    Date
    2012-10-16
    2012-10-17
    2012-10-18
    2012-10-19
    2012-10-20
    2012-10-21
    2012-10-22
    I really appreciate any help
    Thanks

    Sven W. wrote:
    I don't like connect by. That is fair enough, it is just your opinion.
    It is slow and shouldn't be used for real production code.This however, is absolute garbage.
    Changing the query to return 10,000 dates takes a little over 1s
    SQL> select date '2012-10-15' + level - 1 from dual
      2  connect by level <= 10000;
    <snip>
    28-FEB-40
    29-FEB-40
    01-MAR-40
    10000 rows selected.
    Elapsed: 00:00:01.26>
    In your case you can simply do this
    with inputdata as (select to_date('2012-10-15','yyyy-mm-dd') startday from dual)
    select startday+1 from inputdata union all
    select startday+2 from inputdata union all
    select startday+3 from inputdata union all
    select startday+4 from inputdata union all
    select startday+5 from inputdata union all
    select startday+6 from inputdata union all
    select startday+7 from inputdata ;
    Running your alternative for 10,000 dates took quite some time to create, needed to be put in a file to execute and has been running now for about 15 minutes
    select date '2012-10-15' + 1 from dual union all
    select date '2012-10-15' + 2 from dual union all
    <snip>
    select date '2012-10-15' + 9996 from dual union all
    select date '2012-10-15' + 9997 from dual union all
    select date '2012-10-15' + 9998 from dual union all
    select date '2012-10-15' + 9999 from dual union all
    select date '2012-10-15' + 10000 from dual
    ;It is much more code, takes more time to write, is proven to be incredibly slow and shouldn't be used for real production code.
    Edited by: 3360 on Oct 5, 2012 9:52 AM
    Sorry it took only 12 minutes, it seemed a lot longer when waiting for it
    29-FEB-40
    01-MAR-40
    01-MAR-40
    02-MAR-40
    10000 rows selected.
    Elapsed: 00:12:01.35

  • Oracle 11g:Query to return only 1 to 1 relationship & random selection

    Hi
    I have a complex query to modify but I have below the sample tables and data with only very few fields(only affected fields).
    Query based on 2 tables b_test and s_test.
    Pls see below.
    create table b_test(building_id number not null,invalid varchar2(1));
    create table s_test(sub_building_id number not null,building_id number ,invalid varchar2(1),sequence_no number);
    insert into b_test values (1000,'N');
    insert into b_test values(2000,'N');
    insert into b_test values(3000,'N');
    commit;
    insert into s_test values(1,1000,'N',90);
    insert into s_test values(2,1000,'N',91);
    insert into s_test values(3,1000,'N',92);
    insert into s_test values(4,1000,'Y',93);
    insert into s_test values(5,NULL,'N',NULL);
    insert into s_test values(1,2000,'N',94);
    insert into s_test values(2,2000,'N',95);
    insert into s_test values(3,2000,'N',96);
    insert into s_test values(4,2000,'N',97);
    insert into s_test values(5,2000,'N',98);
    insert into s_test values(6,NULL,'N',NULL);
    insert into s_test values(10,3000,'N',99);
    insert into s_test values(11,3000,'N',100);
    commit;The query below returns all rows required:(also see results:)
    select b.building_id,b.invalid,s.sub_building_id,s.sequence_no from b_test b,
    (select * from s_test where invalid='N') s
    where b.building_id = s.building_id(+)
    and b.invalid='N'
    Results:
    BUILDING_ID INVALID      SUB_BUILDING_ID     SEQUENCE_NO
    1000              N     1                     90
    1000             N     2                     91
    1000             N     3                     92
    2000             N     1                     94
    2000             N     2                     95
    2000             N     3                     96
    2000             N     4                     97
    2000             N     5                     98
    3000             N     10                      99
    3000             N     11                     100Now there are 2 requirements:
    1)How can the above query be changed so that 1:1 relationship if sub_building_id is returned?i.e For 1 building_id, only show 1 sub_building(This could be a random selection)
    (Pls help with query)
    The results would be like
    BUILDING_ID INVALID     SUB_BUILDING_ID     SEQUENCE_NO
    1000               N     1                      90
    2000               N     1                      94
    3000               N     11                     1002)How can the same SEQUENCE_NO be shown for all sub_buildings for the same building? (Pls help with query)
    The results will be:
    BUILDING_ID INVALID     SUB_BUILDING_ID     SEQUENCE_NO
    1000             N     1                       90
    1000             N     2                       90
    1000             N     3                       90
    2000             N     1                       94
    2000              N     2                       94
    2000             N     3                       94
    2000             N     4                       94
    2000             N     5                       94
    3000             N     10                       99
    3000             N     11                       99Many thanks!
    Edited by: Krithi on 08-Nov-2012 08:48
    Edited by: Krithi on 08-Nov-2012 08:55

    Krithi wrote:
    Hi
    I have a complex query to modify but I have below the sample tables and data with only very few fields(only affected fields).
    Query based on 2 tables b_test and s_test.
    Pls see below.
    create table b_test(building_id number not null,invalid varchar2(1));
    Thanks for posting the CREATE TABLE and INSERT statements, and your existing query; that's very helpful.
    The query below returns all rows required:(also see results:)
    select b.building_id,b.invalid,s.sub_building_id,s.sequence_no from b_test b,
    (select * from s_test where invalid='N') s
    where b.building_id = s.building_id(+)
    and b.invalid='N'
    Results:
    BUILDING_ID INVALID      SUB_BUILDING_ID     SEQUENCE_NO
    1000              N     1                     90
    1000             N     2                     91
    1000             N     3                     92
    2000             N     1                     94
    2000             N     2                     95
    2000             N     3                     96
    2000             N     4                     97
    2000             N     5                     98
    3000             N     10                      99
    3000             N     11                     100
    When I run your query, I get NULL for sequence_no on the last 2 rows, where building_id=3000. The numbers 99 and 100 don't seem to occur in either table. Did you post the worng sample data and/or results?
    >
    Now there are 2 requirements:
    1)How can the above query be changed so that 1:1 relationship if sub_building_id is returned?i.e For 1 building_id, only show 1 sub_building(This could be a random selection)
    (Pls help with query) Here's one way:
    WITH       got_r_num  AS
         SELECT  sub_building_id
         ,     building_id
         ,     sequence_no
         ,     ROW_NUMBER () OVER ( PARTITION BY  building_id
                                   ORDER BY          sequence_no
                           )         AS r_num
         FROM    s_test
         WHERE     invalid     = 'N'
    SELECT    b.building_id
    ,       b.invalid
    ,       r.sub_building_id
    ,       r.sequence_no
    FROM             b_test     b
    LEFT OUTER JOIN      got_r_num  r  ON  r.building_id  = b.building_id
    WHERE     NVL ( r.r_num
               , 1
               )          = 1
    ORDER BY  b.building_id
    ;This is called a Top-N Query , because we're picking N items (N = 1 in this case) from the top of an ordered list. What makes one item the "top", and another one "lower"? That's determined by the analytic ORDER BY clause, in this case
    ORDER BY      sequence_noThat means the row with the lowest sequence_no (for each building_id) will get r_num=1. If you want a random row from that building_id to be chosen as #1, then you can change the analytic ORDER BY clause to
    ORDER BY      dbms_random.valueYou can ORDER BY anything you like, even a constant, but you must have an analytic ORDER BY clause. ROW_NUMBER requires an analytic ORDER BY clause.
    The results would be like
    BUILDING_ID INVALID     SUB_BUILDING_ID     SEQUENCE_NO
    1000               N     1                      90
    2000               N     1                      94
    3000               N     11                     100
    Again, I don't see where the 100 comes from. The results I get are:
    BUILDING_ID I SUB_BUILDING_ID SEQUENCE_NO
           1000 N               1          90
           2000 N               1          94
           3000 N              11
    2)How can the same SEQUENCE_NO be shown for all sub_buildings for the same building? (Pls help with query)
    SELECT    b.building_id
    ,       b.invalid
    ,       s.sub_building_id
    ,       MIN (s.sequence_no) OVER ( PARTITION BY  s.building_id)
                            AS seq_no
    FROM             b_test  b
    LEFT OUTER JOIN      s_test  s  ON  s.building_id  = b.building_id
                                AND s.invalid      = 'N'
    The results will be:
    BUILDING_ID INVALID     SUB_BUILDING_ID     SEQUENCE_NO
    1000             N     1                       90
    1000             N     2                       90
    1000             N     3                       90
    2000             N     1                       94
    2000              N     2                       94
    2000             N     3                       94
    2000             N     4                       94
    2000             N     5                       94
    3000             N     10                       99
    3000             N     11                       99
    Again, I don't see where you get sequence_no = 99. The results I get are:
    BUILDING_ID I SUB_BUILDING_ID     SEQ_NO
           1000 N               1         90
           1000 N               2         90
           1000 N               3         90
           2000 N               1         94
           2000 N               2         94
           2000 N               5         94
           2000 N               3         94
           2000 N               4         94
           3000 N              10
           3000 N              11Edited by: Frank Kulash on Nov 8, 2012 12:12 PM
    Added explanation and results
    Edited by: Frank Kulash on Nov 8, 2012 12:28 PM
    It looks like you cahnged your sample data from
    insert into s_test values(10,3000,'N',NULL);
    insert into s_test values(11,3000,'N',NULL);to
    insert into s_test values(10,3000,'N',99);
    insert into s_test values(11,3000,'N',100);The queries I posted are niow getting 99, like you requested.

  • Query not returning all data

    All,
    I have 2 dimension tables and 1 logical fact table
    a01_bi_agency_interest_dim
    a01_bi_dsk_central_file_dim
    tier2_facts
    1 Complex Join in Physical Layer
    A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID = A01_BI_DSK_CENTRAL_FILE_DIM.MASTER_AI_ID AND A01_BI_AGENCY_INTEREST_DIM.INT_DOC_ID = A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID
    2 Logical Joins in BMM
    A01_BI_AGENCY_INTEREST_DIM to tier2_facts (inner, 0 or 1 to many)
    A01_BI_DSK_CENTRAL_FILE_DIM to tier2_facts (inner, 0 or 1 to many)
    Query only returns 1 row. Should return many rows, I have checked the data through sql queries in SqlPlus.
    Query from advanced tab.
    SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_NAME saw_0,
    A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1
    FROM TIER2 ORDER BY saw_0, saw_1
    Any help would be appreciated. I am missing something, but doesn't make sense.
    Thanks,
    Kathy

    It doesn't do the join and I get 1 record returned with zero's for both values. Why doesn't it pick up my join?
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID saw_0, A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1 FROM TIER2 ORDER BY saw_0, saw_1
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- General Query Info:
    Repository: Star, Subject Area: TIER2, Presentation: TIER2
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Cache Hit on query:
    Matching Query:     SET VARIABLE QUERY_SRC_CD='Report';SELECT A01_BI_AGENCY_INTEREST_DIM.MASTER_AI_ID saw_0,
    A01_BI_DSK_CENTRAL_FILE_DIM.INT_DOC_ID saw_1
    FROM TIER2 ORDER BY saw_0, saw_1
    Created by:     Administrator
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Query Status: Successful Completion
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Physical Query Summary Stats: Number of physical queries 1, Cumulative time 0, DB-connect time 0 (seconds)
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Rows returned to Client 1
    +++300000:300004:----2012/06/01 12:44:51
    -------------------- Logical Query Summary Stats: Elapsed time 0, Response time 0, Compilation time 0 (seconds)

  • CSV file Download

    Hi folks,
    I would like to achieve the following functionality (in order)
    1. Query DB
    2. Parse results returned into CSV format (perhaps, in a stringbuffer or file)
    3. Return the CSV file or string to the client
    4. Display a pop up window to the user allowing the user to download file.
    How do I implement steps 3 and 4? I would really appreciate some sample code.
    Cheers,
    Rahul

    hi shipla,
    I ended up using the ByteArrayOutputStream...It seems to work well for now, lemme know if tehre are any issues regarding this. Thanks...
    java.io.ByteArrayOutputStream outStream = new java.io.ByteArrayOutputStream();
    outStream.write(csv.toString().getBytes());
    _ctx.getResponse().setHeader("Content-disposition","attachment;filename=test.csv");
    _ctx.getResponse().setContentType("application/excel");
    _ctx.getResponse().setContentLength(outStream.size());
    outStream.writeTo(_ctx.getResponse().getOutputStream());
    _ctx.getResponse().getOutputStream().flush();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Updating a table with a query that return multiple values

    Hi,
    I'm trying to update a table which contain these fields : ItemID, InventoryID, total amounts
    with a query that return these values itemId, inventoryid and total amounts for each items
    Mind you, not all the rows in the table need to be updated. only a few.
    This what i wrote but doesn't work since the query return multiple values so i can't assign it to journalAmounts.
    UPDATE [bmssa].[etshortagetemp]
    SET JournalAmounts = (SELECT sum(b.BomQty) FROM [bmssa].[Bom] b
    JOIN [bmssa].[SalesLine] sl ON sl.ItemBomId = b.BomId
    JOIN [bmssa].[SalesTable] st ON st.SalesId = sl.SalesId
    WHERE st.SalesType = 0 AND (st.SalesStatus IN (0,1,8,12,13)) AND st.DataAreaId = 'sdi'
    GROUP BY b.itemid, b.inventdimid)
    Any advise how to do this task?

    Remember that link to the documentation posted above that explains exactly how to do this. When you read it which part exactly were you having trouble with?

  • SQL- Query that return only one record

    Hello,
    is it possible to execute a pure SQL-Query which returns only one row although multiple rows are found.
    It is no problem in PL/SQL, but I have no idea if the same is also possible in SQL.
    thanks in advance
    Michael

    Why not? There are 4 records in this table, but only selected one.
    SQL> with t
      2  as
      3  (
      4     select '#%$@#$@$@##$' Addr from dual
      5     union all
      6     select '18 Jalan Scott' from dual
      7     union all
      8     select '18 Lemana St' from dual
      9     union all
    10     select '32-penstation' from dual
    11     union all
    12     select '99999999999' from dual
    13  )
    14  select addr
    15    from t
    16   where rownum =1
    17  /
    ADDR
    #%$@#$@$@##$
    SQL>Cheers
    Sarma.

  • Image Import Error "No query results returned"

    Hi All,
    I have the problem while importing images, several image have not been imported with this error.
    Log:
    Importing [German [DE]] '205865_logo.jpg'...failed.
    Import complete
    Error:
    E:\images\205865\h-jpeg\205865_logo.jpg: No query results returned
    Altogether I have imported 17000 Images. 16998 have been successful and 2 throw this error. Anybody an idea what this means and how to avoid it?
    Best Regards
    Roman
    Edited by: Roman Becker on Mar 8, 2009 1:14 PM

    Hi Roman,
    I assume you import the images to a catalog, dont you?
    Which catalog do you use? MDM or CCM?
    Daniel

  • IPTObjectManager.Query not returning correct result (Java)

    Hi,
    I am having a problem with the IPTObjectManager.Query method. The code is given below. The issue I am having is, that when I search for a community in a specific folder not results are returned. However if I search in all folders (using -1 as the second parameter to the method) it returns multiple communities including the one I need. Anyone else had the same issue with this??
    // THIS CODE WORKS AND RETURN MULTIPLE COMMUNITIES
    // THE hotelCode VARIABLE IS A STRING VARIABLE CONTAINING A VALUE
    // WHICH IS THE COMMUNITY NAME.
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, -1, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);
    // THIS CODE DOES NOT WORK. I AM PASSING IS THE FOLDER ID OF THE
    // FOLDER WHICH CONTAINS THE COMMUNITY
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, 303, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);

    I don't know about G6, however in version 5 there does not appear an easy way of doing it. I guess the "easiest" way would be to query sub-folders first, build and array of their ids, and then query for communities in those folders. This is using server API. Something like this (.NET):
    publicvoidGetFolderCommunities(intfolderId){    IPTAdminFolder folder =this.session.GetAdminCatalog().OpenAdminFolder(folderId, false);    IPTQueryResult qr =folder.QuerySubfolders(PT_PROPIDS.PT_PROPID_ALL, [b]1, null, 0, -1, newobject[][] {             newobject[] { PT_PROPIDS.PT_PROPID_FOLDER_FOLDERTYPE }, newobject[] { PT_FILTEROPS.PT_FILTEROP_EQ } , newobject[] { PT_ADMIN_FOLDER_TYPES.PT_ADMIN_FOLDER_TYPE_COMMUNITYFOLDER } } ); int[] folderIds =newint[qr.RowCount()]; Console.WriteLine("------ sub-folders for communities -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        intparentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDER_PARENTFOLDERID);        folderIds[i] =objectId; Console.WriteLine("{0}: {1}; parent: {2}", objectId, objectName, parentFolderId); } qr =this.session.GetCommunities().Query( PT_PROPIDS.PT_PROPID_ALL, -1, (object) null, 0, -1, newobject[][] {            newobject[] { PT_PROPIDS.PT_PROPID_FOLDERID }, newobject[] { PT_FILTEROPS.PT_FILTEROP_IN } , newobject[] { folderIds } } ); Console.WriteLine("------ communities from sub-folders -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        int parentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDERID);        Console.WriteLine("{0}: {1}; folder: {2}", objectId, objectName, parentFolderId); }}
    Or you could use EDK RPC search. Again, in .NET:
    publicvoidSearchForCommunities(intfolderId){ IPortalSearchRequest searchRequest =this.ptSession.GetSearchFactory().CreatePortalSearchRequest(); searchRequest.SetObjectTypesToSearch(newObjectClass[] { ObjectClass.Community }); searchRequest.SetDocFoldersToSearch(newint[] {}, true); searchRequest.SetAdminFoldersToSearch(newint[] { folderId}, true); searchRequest.SetResultsCount(0, 100); searchRequest.SetResultsOrderBy(PortalField.OBJECT_ID); searchRequest.SetFieldsToReturn(newPlumtreeField[] {}); searchRequest.SetQuery("*"); ISearchResponse searchResponse =searchRequest.Execute(); intreturnedMatches =searchResponse.GetReturnedCount(); ISearchResultSet resultSet =searchResponse.GetResultSet(); IEnumerator enumerator =resultSet.GetResults(); while(enumerator.MoveNext()) { ISearchResult result =(ISearchResult) enumerator.Current; Console.WriteLine( result.GetFieldAsInt(PortalField.OBJECT_ID) +": "+ result.GetFieldAsString(PlumtreeField.NAME) ); }}
    Ruslan.

  • SQL query  which return all the NET SERVICES which are avaiable in tnsname

    hi all
    how to write a sql query which return all the net services which are avaiable in tnsname.ora
    Regards
    s

    Also, tnsnames.ora is stored on the client, and not necessarily on the server; it's possible (and quite likely) that the name I use for a database in my tnsnames.ora could be different from the name you use for the same database; conversely we might use the same name for two different databases.
    Regards Nigel

Maybe you are looking for