Help in interpreting the output of explain plan

Hi,
I have written a query in two different ways and then run an explain plan on both of them. Both these queries give same result. I want to know which one will be more efficient. I am giving the output of explain plan for both the queries:
The second plan has a lower cost but has much higher consistent gets !!
Please advise.
Plan 1:
Execution Plan
   0      SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=8637 Card= 1 Bytes=10132)
   1    0   SORT (ORDER BY) (Cost=8637 Card=1 Bytes=10132)
   2    1     WINDOW (SORT) (Cost=8637 Card=1 Bytes=10132)
   3    2       COUNT (STOPKEY)
   4    3         VIEW (Cost=8635 Card=1 Bytes=10132)
   5    4           SORT (ORDER BY) (Cost=8635 Card=1 Bytes=862)
   6    5             WINDOW (SORT) (Cost=8635 Card=1 Bytes=862)
   7    6               MAT_VIEW ACCESS (FULL) OF 'PRD_SEARCH_MVW' (MAT_VIEW) (Cost=8633 Card=1 Bytes=862)
Statistics
        577  recursive calls
          0  db block gets
      39202  consistent gets
      34798  physical reads
          0  redo size
      72348  bytes sent via SQL*Net to client
       4295  bytes received via SQL*Net from client
          9  SQL*Net roundtrips to/from client
         10  sorts (memory)
          0  sorts (disk)
        100  rows processed
Plan-2
Execution Plan
   0      SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=982 Card=1 Bytes=10145)
   1    0   SORT (ORDER BY) (Cost=982 Card=1 Bytes=10145)
   2    1     WINDOW (SORT) (Cost=982 Card=1 Bytes=10145)
   3    2       COUNT (STOPKEY)
   4    3         VIEW (Cost=980 Card=1 Bytes=10145)
   5    4           SORT (ORDER BY) (Cost=980 Card=1 Bytes=10132)
   6    5             WINDOW (SORT) (Cost=980 Card=1 Bytes=10132)
   7    6               WINDOW (SORT) (Cost=980 Card=1 Bytes=10132)
   8    7                 VIEW (Cost=977 Card=1 Bytes=10132)
   9    8                   WINDOW (SORT PUSHED RANK) (Cost=977 Card=1 Bytes=889)
  10    9                     NESTED LOOPS (Cost=976 Card=1 Bytes=889)
  11   10                       HASH JOIN (Cost=305 Card=670 Bytes=18090)
  12   11                         HASH JOIN (Cost=23 Card=140 Bytes=2240)
  13   12                           INDEX (FAST FULL SCAN) OF 'GLCAT_GRP_TO_CAT_PK' (INDEX (UNIQUE)) (Cost=2 Card=52 Bytes=364)
  14   12                           MAT_VIEW ACCESS (FULL) OF 'GLCAT_CAT_TO_MCAT' (MAT_VIEW) (Cost=20 Card=1039 Bytes=9351)
  15   11                         INDEX (FAST FULL SCAN) OF 'PCITEM2GLCATMCAT_FK_IDS' (INDEX) (Cost=281 Card=16903 Bytes=185933)
  16   10                       MAT_VIEW ACCESS (BY INDEX ROWID) OF 'PRD_SEARCH_MVW' (MAT_VIEW) (Cost=1 Card=1 Bytes=862)
  17   16                         INDEX (UNIQUE SCAN) OF 'PK_PRD_SEARCH_ID' (INDEX (UNIQUE)) (Cost=0 Card=1)
Statistics
        481    recursive calls
          2      db block gets
     195742  consistent gets
       7516  physical reads
          0  redo size
      71567  bytes sent via SQL*Net to client
       6629  bytes received via SQL*Net from client
          9  SQL*Net roundtrips to/from client
         15  sorts (memory)
          1  sorts (disk)
        100  rows processedRegards
Madhup
Message was edited by:
Madhup

Thanks a lot for you input. I am posting both the queries below. My requirements are following:
1) I have a products table
2) I have Created grouping hierarchy - Groups, Categories and then Micro-categories - and have setup a separate table for each of them in my database
3) Then I have mapping tables, i.e. a table that stores group to category mapping, another table that stores category to micro-category mapping.
4) Products are mapped directly to micro-categories and one product could be mapped to multiple micro-categories.
5) I have created a materialized view on product and store the mappings as comma separated list of IDs - I have three fields there, on to store comma separated group id, second to store comma separated category ids and third to store the comma separated micro category ids to which the product is mapped.
Now I want to write a query that will return a specified number of matches from this table based on user defined criterion. There are few other filter cirterion apart from Group/Category and Microcategory. These are Company Name, Country, Type of company etc.
This query when run on production will be accessed very frequently - I expect the access to be in the tune of around 5-10 times per second.
There are 50 records in the group table
There are 500 categories
There are 20000 micro-categories
Group to category mapping table has around 1000 records
Category to microcategory table has around 25000 records
The product table has around 100,000 products.
Product to microcategory mapping table has 350000 records
The product mview has the same number of records as that in products table.
The first query uses the single materialized view to access data, however, it always does a full table scan and does not use any index.
When I noticed this in the explain plan, then I tried to write the second query which is using JOINs to arrive at the same output.
The explain plan now says that it is using Index scans.
I did a sample run of both the queries on my production system and I had to withdraw both of them as both brought my system to grinding halt within few minutes of going live.
My system at present receives around 3000 requests per hour during peak load and around 600 requests per hour during off-peak hours.
And I was testing these queries in Off-peak hours !!
Here are the two sql queries just for reference - there are several variables plugged in where clause which are the key drivers of the query:
SQL-1
SELECT DECODE(:OPT,2,A.SC,(MAX(A.SC) OVER (PARTITION BY A.PRD_SEARCH_COMPANY))) AS SO,
     A.SC,                           A.PRD_SEARCH_ID,
     A.PRD_SEARCH_COMPANY_ID,        A.PRD_SEARCH_COMPANY,            A.PRD_SEARCH_COMPANYID_ENCRYPTED,
     A.PRD_SEARCH_PCID,              A.PRD_SEARCH_URL,                A.PRD_SEARCH_PC_CLNT_HOME,
     A.PRD_SEARCH_CLNT_ENABLED,      A.PRD_SEARCH_CODE,               A.PRD_SEARCH_NAME,
     A.PRD_SEARCH_DESC_SMALL,        A.PRD_SEARCH_DESC_DETAILED,      A.PRD_SEARCH_DESC_HTML,
     A.PRD_SEARCH_IMG_SMALL,         A.PRD_SEARCH_IMG_LARGE,          A.PRD_SEARCH_WEIGHT_ITEM,
     A.PRD_SEARCH_MODIFIEDDATE,      A.PRD_SEARCH_SIZE,               A.PRD_SEARCH_LABEL1,
     A.PRD_SEARCH_LABEL1_VALUE,      A.PRD_SEARCH_LABEL2,             A.PRD_SEARCH_LABEL2_VALUE,
     A.PRD_SEARCH_LABEL3,            A.PRD_SEARCH_LABEL3_VALUE,       A.PRD_SEARCH_LABEL4,
     A.PRD_SEARCH_LABEL4_VALUE,      A.PRD_SEARCH_LABEL5,             A.PRD_SEARCH_LABEL5_VALUE,
     A.PRD_SEARCH_LABEL6,            A.PRD_SEARCH_LABEL6_VALUE,       A.PRD_SEARCH_CAT_ID,
     A.PRD_SEARCH_CAT_NAME,          A.PRD_SEARCH_CAT_FLNAME,         A.PRD_SEARCH_NAVIGATION_TREE,
     A.PRD_SEARCH_NAVIGATION_TREE_ID,A.PRD_SEARCH_CITY,               A.PRD_SEARCH_STATE,
     A.PRD_SEARCH_COUNTRY,           A.PRD_SEARCH_PRICE_SALE,         A.PRD_SEARCH_PC_CLNT_TYPE,
     A.PRD_SEARCH_PC_CLNT_TYPE_DESC,
     A.PRD_SEARCH_COMPANY_PHONE,     A.PRD_SEARCH_COMPANY_MOBILE,     A.PRD_SEARCH_COMPANY_FAX,
     A.PRD_SEARCH_COMPANY_EMAIL,     A.PRD_SEARCH_GLCAT_MCAT_ID_LIST, A.PRD_SEARCH_GLCAT_CAT_ID_LIST,
     A.PRD_SEARCH_GLCAT_GRP_ID_LIST, A.PRD_SEARCH_GL_COUNTRY_ISO,     A.PRD_SEARCH_GLUSR_USR_ID,
     A.PRD_SEARCH_TRUSTSEAL_CODE,    A.PRD_SEARCH_CUSTTYPE_ID,        A.PRD_SEARCH_CUSTTYPE_NAME,
     A.PRD_SEARCH_CUSTTYPE_WEIGHT,   A.PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, A.PRD_SEARCH_CUSTTYPE_RANK,
     A.PRD_SEARCH_PC_ITEM_HOTNEW,    A.RK
     FROM
          (SELECT  /*+ FIRST_ROWS (500) */     DECODE(:S_MODE,2,1,3,to_number(to_char(PRD_SEARCH_MODIFIEDDATE,'yyyymmdd')),1) AS SC,
          PRD_SEARCH_ID,
          PRD_SEARCH_COMPANY_ID,        PRD_SEARCH_COMPANY,            PRD_SEARCH_COMPANYID_ENCRYPTED,
          PRD_SEARCH_PCID,              PRD_SEARCH_URL,                PRD_SEARCH_PC_CLNT_HOME,
          PRD_SEARCH_CLNT_ENABLED,      PRD_SEARCH_CODE,               PRD_SEARCH_NAME,
          PRD_SEARCH_DESC_SMALL,        PRD_SEARCH_DESC_DETAILED,      PRD_SEARCH_DESC_HTML,
          PRD_SEARCH_IMG_SMALL,         PRD_SEARCH_IMG_LARGE,          PRD_SEARCH_WEIGHT_ITEM,
          PRD_SEARCH_MODIFIEDDATE,      PRD_SEARCH_SIZE,               PRD_SEARCH_LABEL1,
          PRD_SEARCH_LABEL1_VALUE,      PRD_SEARCH_LABEL2,             PRD_SEARCH_LABEL2_VALUE,
          PRD_SEARCH_LABEL3,            PRD_SEARCH_LABEL3_VALUE,       PRD_SEARCH_LABEL4,
          PRD_SEARCH_LABEL4_VALUE,      PRD_SEARCH_LABEL5,             PRD_SEARCH_LABEL5_VALUE,
          PRD_SEARCH_LABEL6,            PRD_SEARCH_LABEL6_VALUE,       PRD_SEARCH_CAT_ID,
          PRD_SEARCH_CAT_NAME,          PRD_SEARCH_CAT_FLNAME,         PRD_SEARCH_NAVIGATION_TREE,
          PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY,               PRD_SEARCH_STATE,
          PRD_SEARCH_COUNTRY,           PRD_SEARCH_PRICE_SALE,         PRD_SEARCH_PC_CLNT_TYPE,
          PRD_SEARCH_PC_CLNT_TYPE_DESC,
          PRD_SEARCH_COMPANY_PHONE,     PRD_SEARCH_COMPANY_MOBILE,     PRD_SEARCH_COMPANY_FAX,
          PRD_SEARCH_COMPANY_EMAIL,     PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
          PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO,     PRD_SEARCH_GLUSR_USR_ID,
          PRD_SEARCH_TRUSTSEAL_CODE,    PRD_SEARCH_CUSTTYPE_ID,        PRD_SEARCH_CUSTTYPE_NAME,
          PRD_SEARCH_CUSTTYPE_WEIGHT,   PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
          PRD_SEARCH_PC_ITEM_HOTNEW,
          ROW_NUMBER() OVER (PARTITION BY PRD_SEARCH_COMPANY_ID
                              ORDER BY DECODE(:S_MODE,2,1,3,to_number(to_char(PRD_SEARCH_MODIFIEDDATE,'yyyymmdd')),1) DESC) AS RK
          FROM      PRD_SEARCH
          WHERE     DECODE(:GRP_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_GRP_ID_LIST,' ','')||',',:MYGRP_ID_STR)) > 0
          AND       DECODE(:CAT_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_CAT_ID_LIST,' ','')||',',:MYCAT_ID_STR)) > 0
          AND       DECODE(:MCAT_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_MCAT_ID_LIST,' ','')||',',:MYMCAT_ID_STR)) > 0
          AND       DECODE(:ITEM_ID_STR,NULL,1,REGEXP_INSTR(','||PRD_SEARCH_ID||',',:MYITEM_ID_STR)) > 0
          AND       DECODE(:COUNTRY_ISO,NULL,1,REGEXP_INSTR(','||PRD_SEARCH_GL_COUNTRY_ISO||',',:COUNTRY_ISO)) > 0
          AND       DECODE(nvl(NULL,0),0,1,PRD_SEARCH_COMPANY_ID) = DECODE(nvl(NULL,0),0,1,NULL)
          AND       DECODE(nvl(NULL,0),0,1,PRD_SEARCH_GLUSR_USR_ID) = DECODE(nvl(NULL,0),0,1,NULL)
          AND       PRD_SEARCH_CLNT_ENABLED >= nvl(:LIST_TYPE,0)
          AND       NVL(Length(PRD_SEARCH_TRUSTSEAL_CODE),0) >= :TSONLY
          ORDER BY SC DESC, PRD_SEARCH_CUSTTYPE_WEIGHT ASC, DBMS_RANDOM.RANDOM
          )  A
WHERE A.RK <= :MY_PRD_PER_COMP
AND   ROWNUM <= :MYMAXREC
ORDER BY SO DESC, DECODE(:OPT,2,'1',A.PRD_SEARCH_COMPANY), A.RK ASC, DBMS_RANDOM.RANDOM
SQL-2
     SELECT
          DECODE(:OPT,2,SC,(MAX(SC) OVER (PARTITION BY PRD_SEARCH_COMPANY))) AS SO,
          SC,                           PRD_SEARCH_ID,
          PRD_SEARCH_COMPANY_ID,        PRD_SEARCH_COMPANY,            PRD_SEARCH_COMPANYID_ENCRYPTED,
          PRD_SEARCH_PCID,              PRD_SEARCH_URL,                PRD_SEARCH_PC_CLNT_HOME,
          PRD_SEARCH_CLNT_ENABLED,      PRD_SEARCH_CODE,               PRD_SEARCH_NAME,
          PRD_SEARCH_DESC_SMALL,        PRD_SEARCH_DESC_DETAILED,      PRD_SEARCH_DESC_HTML,
          PRD_SEARCH_IMG_SMALL,         PRD_SEARCH_IMG_LARGE,          PRD_SEARCH_WEIGHT_ITEM,
          PRD_SEARCH_MODIFIEDDATE,      PRD_SEARCH_SIZE,               PRD_SEARCH_LABEL1,
          PRD_SEARCH_LABEL1_VALUE,      PRD_SEARCH_LABEL2,             PRD_SEARCH_LABEL2_VALUE,
          PRD_SEARCH_LABEL3,            PRD_SEARCH_LABEL3_VALUE,       PRD_SEARCH_LABEL4,
          PRD_SEARCH_LABEL4_VALUE,      PRD_SEARCH_LABEL5,             PRD_SEARCH_LABEL5_VALUE,
          PRD_SEARCH_LABEL6,            PRD_SEARCH_LABEL6_VALUE,       PRD_SEARCH_CAT_ID,
          PRD_SEARCH_CAT_NAME,          PRD_SEARCH_CAT_FLNAME,         PRD_SEARCH_NAVIGATION_TREE,
          PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY,               PRD_SEARCH_STATE,
          PRD_SEARCH_COUNTRY,           PRD_SEARCH_PRICE_SALE,         PRD_SEARCH_PC_CLNT_TYPE,
          PRD_SEARCH_PC_CLNT_TYPE_DESC,
          PRD_SEARCH_COMPANY_PHONE,     PRD_SEARCH_COMPANY_MOBILE,     PRD_SEARCH_COMPANY_FAX,
          PRD_SEARCH_COMPANY_EMAIL,     PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
          PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO,     PRD_SEARCH_GLUSR_USR_ID,
          PRD_SEARCH_TRUSTSEAL_CODE,    PRD_SEARCH_CUSTTYPE_ID,        PRD_SEARCH_CUSTTYPE_NAME,
          PRD_SEARCH_CUSTTYPE_WEIGHT,   PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
          PRD_SEARCH_PC_ITEM_HOTNEW,    RK
     FROM
               SELECT
                    /*+ FIRST_ROWS (500) */ DECODE(:OPT,2,SC,(MAX(SC) OVER (PARTITION BY PRD_SEARCH_COMPANY))) AS SO,
                    SC,PRD_SEARCH_ID,
                    PRD_SEARCH_COMPANY_ID,        PRD_SEARCH_COMPANY,            PRD_SEARCH_COMPANYID_ENCRYPTED,
                    PRD_SEARCH_PCID,              PRD_SEARCH_URL,                PRD_SEARCH_PC_CLNT_HOME,
                    PRD_SEARCH_CLNT_ENABLED,      PRD_SEARCH_CODE,               PRD_SEARCH_NAME,
                    PRD_SEARCH_DESC_SMALL,        PRD_SEARCH_DESC_DETAILED,      PRD_SEARCH_DESC_HTML,
                    PRD_SEARCH_IMG_SMALL,         PRD_SEARCH_IMG_LARGE,          PRD_SEARCH_WEIGHT_ITEM,
                    PRD_SEARCH_MODIFIEDDATE,      PRD_SEARCH_SIZE,               PRD_SEARCH_LABEL1,
                    PRD_SEARCH_LABEL1_VALUE,      PRD_SEARCH_LABEL2,             PRD_SEARCH_LABEL2_VALUE,
                    PRD_SEARCH_LABEL3,            PRD_SEARCH_LABEL3_VALUE,       PRD_SEARCH_LABEL4,
                    PRD_SEARCH_LABEL4_VALUE,      PRD_SEARCH_LABEL5,             PRD_SEARCH_LABEL5_VALUE,
                    PRD_SEARCH_LABEL6,            PRD_SEARCH_LABEL6_VALUE,       PRD_SEARCH_CAT_ID,
                    PRD_SEARCH_CAT_NAME,          PRD_SEARCH_CAT_FLNAME,         PRD_SEARCH_NAVIGATION_TREE,
                    PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY,               PRD_SEARCH_STATE,
                    PRD_SEARCH_COUNTRY,           PRD_SEARCH_PRICE_SALE,         PRD_SEARCH_PC_CLNT_TYPE,
                    PRD_SEARCH_PC_CLNT_TYPE_DESC,
                    PRD_SEARCH_COMPANY_PHONE,     PRD_SEARCH_COMPANY_MOBILE,     PRD_SEARCH_COMPANY_FAX,
                    PRD_SEARCH_COMPANY_EMAIL,     PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
                    PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO,     PRD_SEARCH_GLUSR_USR_ID,
                    PRD_SEARCH_TRUSTSEAL_CODE,    PRD_SEARCH_CUSTTYPE_ID,        PRD_SEARCH_CUSTTYPE_NAME,
                    PRD_SEARCH_CUSTTYPE_WEIGHT,   PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
                    PRD_SEARCH_PC_ITEM_HOTNEW,
                    ROW_NUMBER() OVER (PARTITION BY PRD_SEARCH_COMPANY_ID
                              ORDER BY DECODE(:S_MODE,2,1,3,TO_NUMBER(TO_CHAR(PRD_SEARCH_MODIFIEDDATE,'YYYYMMDD')),1) DESC) AS RK
               FROM
                         SELECT
                              DECODE(:S_MODE,2,1,3,TO_NUMBER(TO_CHAR(PRD_SEARCH_MODIFIEDDATE,'YYYYMMDD')),1) AS SC,
                              PRD_SEARCH_ID,
                              PRD_SEARCH_COMPANY_ID,        PRD_SEARCH_COMPANY,            PRD_SEARCH_COMPANYID_ENCRYPTED,
                              PRD_SEARCH_PCID,              PRD_SEARCH_URL,                PRD_SEARCH_PC_CLNT_HOME,
                              PRD_SEARCH_CLNT_ENABLED,      PRD_SEARCH_CODE,               PRD_SEARCH_NAME,
                              PRD_SEARCH_DESC_SMALL,        PRD_SEARCH_DESC_DETAILED,      PRD_SEARCH_DESC_HTML,
                              PRD_SEARCH_IMG_SMALL,         PRD_SEARCH_IMG_LARGE,          PRD_SEARCH_WEIGHT_ITEM,
                              PRD_SEARCH_MODIFIEDDATE,      PRD_SEARCH_SIZE,               PRD_SEARCH_LABEL1,
                              PRD_SEARCH_LABEL1_VALUE,      PRD_SEARCH_LABEL2,             PRD_SEARCH_LABEL2_VALUE,
                              PRD_SEARCH_LABEL3,            PRD_SEARCH_LABEL3_VALUE,       PRD_SEARCH_LABEL4,
                              PRD_SEARCH_LABEL4_VALUE,      PRD_SEARCH_LABEL5,             PRD_SEARCH_LABEL5_VALUE,
                              PRD_SEARCH_LABEL6,            PRD_SEARCH_LABEL6_VALUE,       PRD_SEARCH_CAT_ID,
                              PRD_SEARCH_CAT_NAME,          PRD_SEARCH_CAT_FLNAME,         PRD_SEARCH_NAVIGATION_TREE,
                              PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY,               PRD_SEARCH_STATE,
                              PRD_SEARCH_COUNTRY,           PRD_SEARCH_PRICE_SALE,         PRD_SEARCH_PC_CLNT_TYPE,
                              PRD_SEARCH_PC_CLNT_TYPE_DESC,
                              PRD_SEARCH_COMPANY_PHONE,     PRD_SEARCH_COMPANY_MOBILE,     PRD_SEARCH_COMPANY_FAX,
                              PRD_SEARCH_COMPANY_EMAIL,     PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
                              PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO,     PRD_SEARCH_GLUSR_USR_ID,
                              PRD_SEARCH_TRUSTSEAL_CODE,    PRD_SEARCH_CUSTTYPE_ID,        PRD_SEARCH_CUSTTYPE_NAME,
                              PRD_SEARCH_CUSTTYPE_WEIGHT,   PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
                              PRD_SEARCH_PC_ITEM_HOTNEW,
                              ROW_NUMBER() OVER (PARTITION BY P.PRD_SEARCH_ID ORDER BY P.PRD_SEARCH_ID) RK1
                         FROM
                              GLCAT_GRP_TO_CAT G2C, GLCAT_CAT_TO_MCAT C2M, PC_ITEM_TO_GLCAT_MCAT M, PRD_SEARCH P
                         WHERE
                              G2C.FK_GLCAT_CAT_ID = C2M.FK_GLCAT_CAT_ID
                              AND C2M.FK_GLCAT_MCAT_ID = M.FK_GLCAT_MCAT_ID
                              AND M.FK_PC_ITEM_ID = P.PRD_SEARCH_ID
                              AND DECODE(:MCAT_ID_STR, NULL, 1, INSTR(','||:MCAT_ID_STR||',',','||M.FK_GLCAT_MCAT_ID||',',1))> 0
                              AND DECODE(:CAT_ID_STR, NULL, 1, INSTR(','||:CAT_ID_STR||',',','||C2M.FK_GLCAT_CAT_ID||',',1)) > 0
                              AND DECODE(:GRP_ID_STR, NULL, 1, INSTR(','||:GRP_ID_STR||',',','||G2C.FK_GLCAT_GRP_ID||',',1)) > 0
                              AND DECODE(:ITEM_ID_STR,NULL,1,INSTR(','||:ITEM_ID_STR||',' , ','||P.PRD_SEARCH_ID||',')) > 0
                              AND DECODE(:COUNTRY_ISO,NULL,1,INSTR(','||:COUNTRY_ISO||',', ','||P.PRD_SEARCH_GL_COUNTRY_ISO||',')) > 0
                              AND DECODE(NVL(:COMPANY_ID,0),0,1,P.PRD_SEARCH_COMPANY_ID) = DECODE(NVL(:COMPANY_ID,0),0,1,:COMPANY_ID)
                              AND DECODE(NVL(:GLUSR_ID,0),0,1,P.PRD_SEARCH_GLUSR_USR_ID) = DECODE(NVL(:GLUSR_ID,0),0,1,:GLUSR_ID)
                              AND P.PRD_SEARCH_CLNT_ENABLED >= NVL(:LIST_TYPE,0)
                              AND NVL(LENGTH(P.PRD_SEARCH_TRUSTSEAL_CODE),0) >= :TSONLY
               WHERE RK1=1
               ORDER BY SC DESC, PRD_SEARCH_CUSTTYPE_WEIGHT ASC, DBMS_RANDOM.RANDOM
          ) A
     WHERE A.RK <= :MY_PRD_PER_COMP
     AND   ROWNUM <= :MYMAXREC
     ORDER BY A.SO DESC, DECODE(:OPT,2,'1', A.PRD_SEARCH_COMPANY), A.RK ASC, DBMS_RANDOM.RANDOMRegards
Madhup

Similar Messages

  • Understand the output of explain plan

    I am trying to understand the output of explain plan. I have 2 plans below and don't understand it completely.
    In below SQL I would expect optimizer to fetch "ROWNUM < 500" first and then do the outer join. But below explain plan doesn't list it as No. 1. So I don't really understand how to intepret the sequence from the explain plan:
    select TASK0_.TASK_ID from
    (  select TASK0_.TASK_ID from
      ( select task0_.task_id  from task task0_) TASK0_ where ROWNUM < 500 ) TASK0_ 
    left outer join f_message_task task0_1_ on task0_.task_id=task0_1_.task_id
    left outer join b_a_task task0_2_ on task0_.task_id=task0_2_.task_id
    left outer join i_task task0_3_ on task0_.task_id=task0_3_.task_id
    left outer join o_task task0_4_ on task0_.task_id=task0_4_.task_id
    left outer join r_transmission_task task0_5_ on task0_.task_id=task0_5_.task_id
    left outer join s_error_task task0_6_ on task0_.task_id=task0_6_.task_id
    PLAN_TABLE_OUTPUT     
    Plan hash value: 707970537     
    | Id  | Operation                    | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |     
    |   0 | SELECT STATEMENT             |                          |   499 | 19461 |  1042   (6)| 00:00:13 |     
    |*  1 |  HASH JOIN OUTER             |                          |   499 | 19461 |  1042   (6)| 00:00:13 |     
    |*  2 |   HASH JOIN OUTER            |                          |   499 | 16966 |   757   (6)| 00:00:10 |     
    |   3 |    NESTED LOOPS OUTER        |                          |   499 | 14471 |   589   (4)| 00:00:08 |     
    |   4 |     NESTED LOOPS OUTER       |                          |   499 | 12475 |   588   (4)| 00:00:08 |     
    |   5 |      NESTED LOOPS OUTER      |                          |   499 | 10479 |   588   (4)| 00:00:08 |     
    |   6 |       NESTED LOOPS OUTER     |                          |   499 |  8982 |   588   (4)| 00:00:08 |     
    |   7 |        VIEW                  |                          |   499 |  2495 |   588   (4)| 00:00:08 |     
    |*  8 |         COUNT STOPKEY        |                          |       |       |            |          |     
    |   9 |          INDEX FAST FULL SCAN| PK_TASK                  |   697K|  3403K|   588   (4)| 00:00:08 |     
    |* 10 |        INDEX UNIQUE SCAN     | PK_r_TRANSMISSION |     1 |    13 |     0   (0)| 00:00:01 |     
    |* 11 |       INDEX UNIQUE SCAN      | PK_b_a_TASK          |     1 |     3 |     0   (0)| 00:00:01 |     
    |* 12 |      INDEX UNIQUE SCAN       | PK_s_ERROR_TASK     |     1 |     4 |     0   (0)| 00:00:01 |     
    |* 13 |     INDEX UNIQUE SCAN        | PK_i_TASK    |     1 |     4 |     0   (0)| 00:00:01 |     
    |  14 |    INDEX FAST FULL SCAN      | PK_o_TASK           |   347K|  1695K|   161   (6)| 00:00:02 |     
    |  15 |   INDEX FAST FULL SCAN       | PK_f_MESSAGE        |   392K|  1917K|   276   (4)| 00:00:04 |     
    Predicate Information (identified by operation id):     
       1 - access("TASK0_"."TASK_ID"="TASK0_1_"."TASK_ID"(+))     
       2 - access("TASK0_"."TASK_ID"="TASK0_4_"."TASK_ID"(+))     
       8 - filter(ROWNUM<500)     
      10 - access("TASK0_"."TASK_ID"="TASK0_5_"."TASK_ID"(+))     
      11 - access("TASK0_"."TASK_ID"="TASK0_2_"."TASK_ID"(+))     
      12 - access("TASK0_"."TASK_ID"="TASK0_6_"."TASK_ID"(+))     
      13 - access("TASK0_"."TASK_ID"="TASK0_3_"."TASK_ID"(+))     
    In below SQL I expect rownum to be applied at the end but it gets applied first:
    select *  from (  select TASK0_.TASK_ID from ( select task0_.task_id  from task task0_ 
    left outer join f_message_task task0_1_ on task0_.task_id=task0_1_.task_id
    left outer join b_a_task task0_2_ on task0_.task_id=task0_2_.task_id
    left outer join i_task task0_3_ on task0_.task_id=task0_3_.task_id
    left outer join o_task task0_4_ on task0_.task_id=task0_4_.task_id
    left outer join r_t_task task0_5_ on task0_.task_id=task0_5_.task_id
    left outer join s_error_task task0_6_ on task0_.task_id=task0_6_.task_id
    ) TASK0_ where ROWNUM < 500 ) TASK0_;
    PLAN_TABLE_OUTPUT     
    Plan hash value: 673345378     
    | Id  | Operation                    | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |     
    |   0 | SELECT STATEMENT             |                          |   499 |  6487 |   507   (1)| 00:00:07 |     
    |   1 |  VIEW                        |                          |   499 |  6487 |   507   (1)| 00:00:07 |     
    |*  2 |   COUNT STOPKEY              |                          |       |       |            |          |     
    |   3 |    NESTED LOOPS OUTER        |                          |   501 | 19539 |   507   (1)| 00:00:07 |     
    |   4 |     NESTED LOOPS OUTER       |                          |   501 | 17034 |     5  (20)| 00:00:01 |     
    |   5 |      NESTED LOOPS OUTER      |                          |   501 | 15030 |     5  (20)| 00:00:01 |     
    |   6 |       NESTED LOOPS OUTER     |                          |   501 | 13026 |     5  (20)| 00:00:01 |     
    |   7 |        NESTED LOOPS OUTER    |                          |   501 | 11523 |     5  (20)| 00:00:01 |     
    |   8 |         NESTED LOOPS OUTER   |                          |   501 |  5010 |     5  (20)| 00:00:01 |     
    |   9 |          INDEX FAST FULL SCAN| PK_TASK                  |   499 |  2495 |     2   (0)| 00:00:01 |     
    |* 10 |          INDEX UNIQUE SCAN   | PK_o_TASK           |     1 |     5 |     1   (0)| 00:00:01 |     
    |* 11 |         INDEX UNIQUE SCAN    | PK_r_T |     1 |    13 |     0   (0)| 00:00:01 |     
    |* 12 |        INDEX UNIQUE SCAN     | PK_b_a_TASK          |     1 |     3 |     0   (0)| 00:00:01 |     
    |* 13 |       INDEX UNIQUE SCAN      | PK_s_ERROR_TASK     |     1 |     4 |     0   (0)| 00:00:01 |     
    |* 14 |      INDEX UNIQUE SCAN       | PK_i_TASK    |     1 |     4 |     0   (0)| 00:00:01 |     
    |* 15 |     INDEX UNIQUE SCAN        | PK_f_MESSAGE        |     1 |     5 |     1   (0)| 00:00:01 |     
    Predicate Information (identified by operation id):     
       2 - filter(ROWNUM<500)     
      10 - access("TASK0_"."TASK_ID"="TASK0_4_"."TASK_ID"(+))     
      11 - access("TASK0_"."TASK_ID"="TASK0_5_"."TASK_ID"(+))     
      12 - access("TASK0_"."TASK_ID"="TASK0_2_"."TASK_ID"(+))     
      13 - access("TASK0_"."TASK_ID"="TASK0_6_"."TASK_ID"(+))     
      14 - access("TASK0_"."TASK_ID"="TASK0_3_"."TASK_ID"(+))     
      15 - access("TASK0_"."TASK_ID"="TASK0_1_"."TASK_ID"(+))Edited by: user628400 on Feb 20, 2009 12:14 PM
    Edited by: user628400 on Feb 20, 2009 12:15 PM

    Please read the FAQ: http://forums.oracle.com/forums/help.jspa
    And learn how to post code and explain plans using the tags.                                                                                                                                                                                                                                                                           

  • Can you help me interpret the following lines in UPDATE rule?

    Hi,
    Can you help me interpret the following lines in UPDATE rule?
    1. What is the role of role of u201CCHANGING RESULT.u201D and u201CCHANGING lc_local_value.u201D?
    2. What is the role of the CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY', in particular the Exporting and Importing parts?
    3. Can I say that u201CCOMM_STRUCTURE-ORDER_VALu201D in the subroutine is passed to u201Clc_document_valueu201D in the u201CFORM loc_curr_convertu201D; and further passed to u201Cforeign_amountu201D in the u201CCALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'u201D?
    4. Finally, what becomes of my original u201CActual Goods receipt quantityu201D( 0GR_QTY ) which I am writing the routine for? I donu2019t see any where in the code that it is being referred to? Do any of these codes affect the value of 0GR_QTY?
    5. Also, if there are 3 different subroutines in the INCLUDE and I am making the change described in #4 above, how do I know which of the 3 subroutines to call?
    ===============================
    ===============================
    So I am reviewing a transfer routine in for u201CActual Goods receipt quantityu201D and routine an INCLUDE statement: INCLUDE RS_BCT_MM_UPDATE_RULES.
    The update rule also includes the following properties to run the following subroutine in the Include:
    IF u2026..
    perFORM LOC_CURR_CONVERT
               USING    COMM_STRUCTURE-ORDER_VAL
                        COMM_STRUCTURE-DOC_DATE
                        COMM_STRUCTURE-ORDER_CURR
                        COMM_STRUCTURE-LOC_CURRCY
                        COMM_STRUCTURE-EXCHG_RATE
               CHANGING RESULT.
    I verified in the INCLUDE (RS_BCT_MM_UPDATE_RULES) and the subroutine is as follows:
    FORM loc_curr_convert
      USING    lc_document_value
               lc_date
               lc_document_currency
               value(lc_local_currency)
               lc_rate
      CHANGING lc_local_value.
    conversion of lc_rate from floating-point to decimal. Necessary for *
    call of CONVERT_TO_LOCAL_CURRENCY.
    data lc_rate_dec type p decimals 5.
    lc_rate_dec = lc_rate.
      IF lc_document_currency = lc_local_currency
      no conversion necessary -> Main case 1
        AND NOT ( lc_document_currency IS INITIAL
               OR lc_local_currency IS INITIAL ) .
        lc_local_value = lc_document_value.
      ELSEIF NOT ( lc_document_currency IS INITIAL
      OR lc_local_currency IS INITIAL OR lc_date IS INITIAL ) .
      conversion necessary with lc_date -> Normally not possible
        CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
          EXPORTING
            date                 = lc_date
            foreign_amount       = lc_document_value
            foreign_currency     = lc_document_currency
            local_currency       = lc_local_currency
            rate                 = lc_rate_dec
          IMPORTING
          EXCHANGE_RATE        =
            local_amount         = lc_local_value
          EXCEPTIONS
            NO_RATE_FOUND        = 1
            OVERFLOW             = 2
            NO_FACTORS_FOUND     = 3
            NO_SPREAD_FOUND      = 4
            DERIVED_2_TIMES      = 5.
        IF sy-subrc NE 0.
      message a802 with lc_date lc_document_currency lc_local_currency
                        sy-subrc.
        ENDIF.
      ELSE.
      if conversion not possible -> assign target values
        lc_local_value = lc_document_value.
        lc_local_currency = lc_document_currency.
      ENDIF.
    ENDFORM.

    HI,
    Thanks so much the explanations.
    I just verified again on our dev system and the update rule for 0GR_QTY (Actual goods receipt quantity) include the following:
        perFORM QUANTITY_CONVERT
           USING    COMM_STRUCTURE-CPQUAOU
                    COMM_STRUCTURE-po_UNIT
                    COMM_STRUCTURE-base_uom
                    COMM_STRUCTURE-numerator
                    COMM_STRUCTURE-denomintr
           CHANGING RESULT
    Now, in the include, I also found:
    FORM QUANTITY_CONVERT
      USING    QC_SOURCE_VALUE
               QC_SOURCE_UNIT
               VALUE(QC_TARGET_UNIT)
               QC_UMREZ
               QC_UMREN
      CHANGING QC_TARGET_VALUE.
    i.  Does it mean it actually does quantity conversion?
    ii. If you have access to the INCLUDE I will appreciate some hints on what the subroutine QUANTITY_CONVERT is doing. It does not appear do to be saying anything about quantity conversion; but it is supposed to be doing something with the parameters being passed from the update routine.
    iii. In your response to #5, after all the computation in the INCLUDE, what comes back to the Update rule  i.e. what comes back to become the value of 0GR_QTY?
    Is it the u201CRESULT.u201D in the update rule or u201CQC_TARGET_VALUE.u201D in the subroutine in the INCLUDE.
    iv. So, am to create an Update rule for 0PSTNG_DATE and the source is BUDAT; and I need to write a routine using the include INCLUDE RS_BCT_MM_UPDATE_RULES.
    I looked through the INCLUDE and identified all the subroutines in this INCLUDE as follows:
    QUANTITY_CONVERT
    LOC_CURR_CONVERT
    GET_WEEK
    WEEK_DAY
    QUARTER_DAY
    --Does it mean that to use this subroutine, I can only use the USING parameters of one of these listed subroutines?
    --Also, does it mean that because 0PSTNG_DATE is a date, I can only use one of
    GET_WEEK
    WEEK_DAY
    QUARTER_DAY
    --Or, are there other includes to be used for 0PSTNG_DATE
    Thanks

  • Can anyone help me find the output option in Bridge CC?

    Can anyone help me find the output option in Bridge CC?

    http://helpx.adobe.com/bridge/kb/install-output-module-bridge-cc.html

  • Not Understanding the filter in Explain Plan - filter(NULL IS NOT NULL)

    Hi All,
    Request your help in understanding the below scenario. (I am not aware of teh application and table details. Just trying to help my friend)
    SQL> conn
    Enter user-name: [email protected]
    Enter password:
    Connected.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    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
    --Checking the count in PO_LINES
    SQL> select count(*) from po_lines;
      COUNT(*)
             0
    --PO_LINES is a synonym
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES';
    OBJECT_TYPE         OWNER
    SYNONYM             APPS
    --The synonym is pointing to PO.PO_LINES_ALL
    SQL> select * from user_synonyms where synonym_name = 'PO_LINES';
    SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
    PO_LINES                       PO                             PO_LINES_ALL
    --But when counting PO.PO_LINES_ALL I am getting different result
    SQL> select count(*) c from po.po_lines_all;
             C
          8828
    --Explain plan of teh original query is
    SQL> explain plan for
      2  select
      3  * from po_lines;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name         | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT   |              |     1 |   252 |     0   (0)|
    |*  1 |  FILTER            |              |       |       |            |
    |   2 |   TABLE ACCESS FULL| PO_LINES_ALL |  8796 |  2164K|   106   (4)|
    Predicate Information (identified by operation id):
       1 - filter(NULL IS NOT NULL)
    --Now the object PO.PO_LINES_ALL is TABLE, not an mview.
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES_ALL';
    OBJECT_TYPE         OWNER
    TABLE               POSeek your help in understanding what is happening here.
    Thanks in Advance,
    jeneesh

    Next time, prefix with APPS. when you show us the explain plan:
    SQL> explain plan for
      2  select
      3  * from apps.po_lines;  -- added the prefix of owner.Just like you prefixed with PO. when you showed us the query on PO_LINES_ALL. It ensures that you are using the synonym which you showed us.
    Btw. PO_LINES_ALL, could still be a VIEW given your overview of the situation.
    Anyway a filter "NULL IS NOT NULL" is indicative that the optimizer performed something called semantic query optimization (SQO).
    SQO is the process of deducing new predicates based upon a) existing predicates in your query (which there is none), b) added predicates to your query (eg. by a VPD policy function), and c) declared constraints on the tables invovled in your query.
    A typical example of when a "NOT is NOT NULL" predicate will show up is when for instance in the EMP table there is a declared constraint on EMPNO like this:
    check(EMPNO > 0)And your query would hold a predicate that is inconsistent with the constraint, for instance like this:
    select *
    from EMP
    where EMPNO <= 0Oracle will deduce that EMPNO cannot be both greater than zero (constraint) as well as smaller than or equal to zero (your query predicate), and will transform the query into:
    select *
    from EMP
    where EMPNO <= 0
      and NULL is NOT NULLThus preventing accessing the EMP table all together, and immediately returning this query with no data found.
    Edited by: Toon Koppelaars on Mar 15, 2010 7:17 AM

  • What is the base of Explain Plan?

    On what basis oracle generates explain plan? I mean, is it based on table structure which we are using in SQL query OR it is based on rows exists in table, Or something else.

    user2081225 wrote:
    On what basis oracle generates explain plan? I mean, is it based on table structure which we are using in SQL query OR it is based on rows exists in table, Or something else.SQL data is stored in specific data structures. Some SQL data will be indexed. These indexes are also stored in specific data structures.
    To retrieve data from these structures, you need a program (a series of executable commands that can find and retrieve the required data).
    A SQL query is human readable source code that means nothing to Oracle ito how to find the required rows. It needs to take that source code and compile it into binary machine-like code. In other words, it needs to create an executable program (called a cursor) that can be run to find the required rows.
    The execution plan is a human readable format of this program - it shows how the cursor will be executed.
    How does it construct the program?
    It has a set of modules that can do different things (ito data access). E.g. scan an entire table using a full table scan. Scan a unique index to find the address (rowid) of a row. Scan a non-unique indexes using a range scan and return a range of row addresses. Etc.
    It also has algorithms on how to combine these data retrieval methods. For example, hash joining the output of such operations. Merge joining the output of index scans. Using a nested loop, where the inner loop is executed for the data found by the outer loop. Etc.
    So the CBO dynamically builds a program (cursor) that consists of methods to get to the data required, and processing algorithms to glue these methods together into a logical process flow.
    It does this based on data (stats) it has about the tables and indexes (data volumes, distribution, etc), about the type of data structures used for the relevant tables and indexes (hash tables, iot's, b-trees, bitmaps, partitions, clusters..), and so on.
    The CBO is a pretty clever piece of software that dynamically writes data retrieval programs called cursors. And unfortunately this complexity is often underestimated and misunderstood.

  • Help to catch the output of a Transaction

    Hi,
    I have this issue and need help, I have a program lets say "ZPROGRAM", this programs calls a RFC "ZFUNC" this function must be able to send the parameters to execute a SAP standard transaction for example MB51, the function must send the plant number, storage location, and material number, then this RFC must catch the output of the report into an internal table so that i can work with the output in "ZPROGRAM", in other words what I see on screen as result of MB51 I need it in an internal table so that I can manupulate the data.
    I hope someone could tell me how to accomplish this.
    Thanks in advice.

    Hi,
       Pls try
        DATA list_tab TYPE TABLE OF abaplist.
        DATA vlist  LIKE  table of LISTZEILE WITH HEADER LINE.
        submit RM07DOCS
          with XXX
          EXPORTING LIST TO MEMORY
          and return .
          CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
              listobject = list_tab
            EXCEPTIONS
              not_found  = 1
              OTHERS     = 2.
       CALL FUNCTION 'LIST_TO_ASCI'
          EXPORTING
            list_index         = -1
          TABLES
            listasci           = vlist
            listobject         =list_tab
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
    Regards,
    Pole
    Edited by: Pole li on Jul 17, 2008 3:57 AM

  • Help needed in the output file

    Hi
    Here is my query,
    DECLARE
    vProduct VARCHAR2(100) := 'Prints';
    vProduct1 VARCHAR2(100) := 'Pk';
    vName     VARCHAR2(100) := 'Photos';
    vName1     VARCHAR2(100) := 'B';
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Product '||' '||'Name');
    DBMS_OUTPUT.PUT_LINE('----------------------');
    DBMS_OUTPUT.PUT_LINE(vProduct ||' '||vName);
    DBMS_OUTPUT.PUT_LINE(vProduct1 ||' '||vName1);
    END;
    Product Name
    Prints Photos
    Pk B
    But i need the output as like this
    Product Name
    Prints Photos
    Pk B
    With a tab space between each values even i have different lengths in the value.
    Is this possible ?

    Ok Rob Thanks..........
    Its worked fine

  • Help to edit the output of a method please

    Hi
    I have a piece of code which i need to change. Currently the method connects to a socket c, and reads in a string from a method called get(String), which returns a string, i however need to change this so that the method get(String) returns a list. I am not sure however how to go about changing this code so as to do this
    public void run() {
            try {
                BufferedReader i = new BufferedReader(new InputStreamReader(c.getInputStream()));
                DataOutputStream o = new DataOutputStream(c.getOutputStream());
                try {
                    while (true) {
                        String s = i.readLine();
                        if (s.startsWith("GET")) {
                            StringTokenizer t = new StringTokenizer(s, " ");
                            t.nextToken(); // discard GET
                            String p = t.nextToken();
                            String response = get(p);
                            o.writeBytes("HTTP/1.0 200 OK\nContent-Type: text/plain\nContent-Length: "
                             + (response.length() + 1)
                             + "\n\n"
                             + response + "\n");
                            break;
                } catch (Exception x) {
                    System.err.println("Error: " + x);
                    x.printStackTrace();
                    o.writeBytes(SAYWHAT + "Error: " + x);
                o.close();
            } catch (Exception x) {
                System.err.println("Error: " + x);
                x.printStackTrace();
        }Currently this method seperates the words in the string output by the get(String) method as far as i can see and writes this output to a HTTP address. I dont know how i could go about changing this so that instead of outputting a string, get(string) will output a list, which in turn will be output by this run() method to a HTTP address. I would welcome any help with this problem, as i dont know where to start.
    Thanks

    Thanks for the references, ive been looking through these for a while now but i cannot figure out how to do what i have to do. I have not been able to find a way to read in from an array, i found a ByteArrayInputStream but am not sure how this works. Does anybody know of a way to read in from an array using a BufferedReader or some similar construct?

  • Need help to format the output of the query.

    First of all i would like to say I m newbi in oracle query
    and of course thanks to read the thread.
    I have a problem formatting a query output.
    Actually the query is like the following :
    select a1
    ,b1
    ,c1
    from table
    where id.table=1
    UNION
    select a2
    ,b2
    ,c2
    from table2
    where id.table2=1
    order by 1;
    exit;
    my actual output
    a1 b1 c1
    a2 b2 c2
    a1 b1 c1
    a2 b2 c2
    my desired output
    a1 b1 c1
    a2 b2 c2
    a1 b1 c1
    a2 b2 c2
    So what i need is an empy row between the groups of results
    and to shift the union query.
    thanks in advance

    SQL>select * from t1;
            C1         C2         C3
             1          2          3
             2          3          4
             3          4          5
    SQL>select * from t2;
            C1         C2         C3
            30         40         50
            20         30         40
            10         20         30
    SQL>select c1,c2,c3
      2  from( select c1,c2,c3,1 flg
      3           from t1
      4           union all
      5           select c1,c2,c3,2
      6           from t2
      7           union all
      8           select null,null,null,1
      9           from dual)
    10  order by flg,c1,c2,c3 nulls last;
            C1         C2         C3
             1          2          3
             2          3          4
             3          4          5
    <br>
            10         20         30
            20         30         40
            30         40         50
    7 rows selected.
    Funny.......                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Plzz help me with the output of this code....

    hi all..
    plz check this code and tell me how to select one or more options from this Jlist and write the selected item into a text file....This code does that but the text file shows only one item (i tried using arry but din work) AND text file displays the item which is selected last time the code is interpreted..
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class mld extends JFrame implements ListSelectionListener, ActionListener
    {private JFrame    myframe = new JFrame("Select File");
                       private DefaultListModel listModel = new DefaultListModel();
         private JList list= new JList(listModel);
         private String selString = "select file name";
         private JButton selButton;
            public mld(){
         super("mld");
         addWindowListener(new WindowAdapter()
       {     public void windowClosing(WindowEvent ev) {dispose();     
                   System.exit(0);
              listModel.addElement("prog1");
    listModel.addElement("prog2");
         listModel.addElement("prog3");
         listModel.addElement("prog4");
         listModel.addElement("prog5");
         listModel.addElement("prog6");
         listModel.addElement("prog7");
         listModel.addElement("prog8");
         listModel.addElement("prog9");
         listModel.addElement("prog10");
         listModel.addElement("prog11");     
    listModel.addElement("prog12");
         list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    list.addListSelectionListener(this);
         JScrollPane listScrollPane = new JScrollPane(list);
         JButton selButton = new JButton(selString);
         selButton.setActionCommand(selString);
         selButton.addActionListener(this);
    //Create a panel that uses FlowLayout (the default).
         JPanel buttonPane = new JPanel();
         buttonPane.add(selButton);
         Container contentPane = getContentPane();
         contentPane.add(listScrollPane, BorderLayout.CENTER);
         contentPane.add(buttonPane, BorderLayout.SOUTH);
         pack();
         show();}
    public void valueChanged(ListSelectionEvent e) {}
    public void actionPerformed(ActionEvent e){
         String tmp = new String(list.getSelectedValue().toString());
    try{
    FileOutputStream fileOut = new FileOutputStream("temp.txt");
    fileOut.write(tmp.getBytes());
    fileOut.close();}
    catch (Exception e1)
    {                e1.printStackTrace();  }
    //*main method//
    public static void main(String s[]) {
         JFrame frame = new mld();
    try {
    Process p = Runtime.getRuntime().exec("notepad temp.txt ");
    p.waitFor();
    Process p1 = Runtime.getRuntime().exec("c:/Program Files/Microsoft Office/Office/outlook.EXE /c ipm.note /m [email protected] /a c:/temp.txt");
    catch(Exception e)
    {                e.printStackTrace();  }
    Thanx in advance
    bharthi

    replace
    FileOutputStream fs = new FileOutputStream("filename");
    with
    FileOutputStream fs = new FileOutputStream("filename",true);

  • Help in merging the output rtf/documents reports

    Hi,
    I am working with XML pub tool for a user requirement that 2 output reports(rtf documents) were genated using XML processor from 2 rtf templates, XML data files etc. No I need to merge the 2 output rtf/doc reports . Is there any function in XML publisher so that I can merge these output reports as one report.(Same as merging 2 documents in microsoft word)
    Thanks
    Raj

    You can merge/append 2 documents with a third party tools wihtout using XMLP publisher.
    HTH
    Shaun S

  • Need help with disabling the output excution command

    hey guys
    i'm doing an assignment in which user can input multiple lines. I'm using the scanner class. The problem i'm facing is that when user gives their input in multiple lines then it displays the asking input line even though it doesn't ask for new input because the pervious input stored in the memory. Please help me to disable it somehow. I understand the logic and everything but i can't find a way to disable that line. Here's my code:
    print("Please enter words to be converted into Swedish Chef or \"END\" to stop");
            inputText = input.nextLine();
            while (!inputText.equals ("END")  ) {
                // separate the text and punctuations
                removePunctuations();
                // translate all the input text
                for (int i = 0; i < inputWOP.length; i++ ) {
                   translateText(inputWOP);
    // display the translated text inculding all the punctuations
    printTranslatedText();
    System.out.println();
    /** the problem is on this line, logically it make sense that
    * this will be displayed until "END" isn't entered
    * but i want this line not to excute if there's multiple line input
    print("Please enter words to be converted into Swedish Chef or \"END\" to stop");
    inputText = input.nextLine();
    Please help me to solve this problem, thanks in advance!

    salubad,
    Do you really understand your logic? This is a classic while !EOF loop gone wrong... Examine your own code I'm sure you'll get it.
    /** the problem is on this line, //YEP
    logically it make sense that
    * this will be displayed until "END"
    isn't entered //DOES IT REALLY?
    * but i want this line not to excute if
    there's multiple line input //yep, just make it so.
    rint("Please enter words to be converted into Swedish
    Chef or \"END\" to stop");
    inputText = input.nextLine();
    Keith.

  • KERNEL PANIC! Nice folks of this forum, please help me interpret the log! pls, and thank you! =]

    Anonymous UUID:  
    72A893A3-300A-06CD-0FC0-53B0ADAB4CE0
    Tue Jan 28 18:22:49 2014
    panic(cpu 1 caller 0xffffff80060db94e): Kernel trap at 0xffffff80060a4960, type 14=page fault, registers:
    CR0: 0x0000000080010033, CR2: 0x0000000000000008, CR3: 0x00000002aae1e074, CR4: 0x00000000001606e0
    RAX: 0x0000000000000000, RBX: 0xffffff8027c21c18, RCX: 0xffffff800e8286a0, RDX: 0xffffff80066d0b30
    RSP: 0xffffff81d7cdb570, RBP: 0xffffff81d7cdb590, RSI: 0x00000000ffffffff, RDI: 0xffffff8027c21c18
    R8:  0x0000000000000001, R9:  0x00000000cccccccd, R10: 0xffffff80066d15f0, R11: 0x0000000000000011
    R12: 0xffffff801c657770, R13: 0x0000000000000000, R14: 0x000000000000007f, R15: 0xffffff8027c21c18
    RFL: 0x0000000000010203, RIP: 0xffffff80060a4960, CS:  0x0000000000000008, SS:  0x0000000000000010
    Fault CR2: 0x0000000000000008, Error code: 0x0000000000000002, Fault CPU: 0x1
    Backtrace (CPU 1), Frame : Return Address
    0xffffff81d7cdb200 : 0xffffff8006022f69
    0xffffff81d7cdb280 : 0xffffff80060db94e
    0xffffff81d7cdb450 : 0xffffff80060f2dc6
    0xffffff81d7cdb470 : 0xffffff80060a4960
    0xffffff81d7cdb590 : 0xffffff800608fbc8
    0xffffff81d7cdb640 : 0xffffff80060954d3
    0xffffff81d7cdb670 : 0xffffff800608ec7d
    0xffffff81d7cdb6a0 : 0xffffff800608decc
    0xffffff81d7cdb6e0 : 0xffffff80060af865
    0xffffff81d7cdb700 : 0xffffff8006018de1
    0xffffff81d7cdb750 : 0xffffff8006026db2
    0xffffff81d7cdb770 : 0xffffff8006026bce
    0xffffff81d7cdb7a0 : 0xffffff80060139b5
    0xffffff81d7cdb810 : 0xffffff8006026ed2
    0xffffff81d7cdb840 : 0xffffff800605f031
    0xffffff81d7cdb880 : 0xffffff80064b7158
    0xffffff81d7cdb8b0 : 0xffffff80064b11dd
    0xffffff81d7cdb910 : 0xffffff7f880674ca
    0xffffff81d7cdb930 : 0xffffff7f8807ccea
    0xffffff81d7cdb960 : 0xffffff7f880ec68b
    0xffffff81d7cdb980 : 0xffffff7f880e705d
    0xffffff81d7cdba20 : 0xffffff7f8806dab4
    0xffffff81d7cdba50 : 0xffffff7f8806dd6b
    0xffffff81d7cdba80 : 0xffffff7f880798a8
    0xffffff81d7cdbac0 : 0xffffff7f880ebd43
    0xffffff81d7cdbae0 : 0xffffff7f8806be85
    0xffffff81d7cdbb70 : 0xffffff80064cc61a
    0xffffff81d7cdbb90 : 0xffffff80064cd17e
    0xffffff81d7cdbbf0 : 0xffffff80064cabcf
    0xffffff81d7cdbd40 : 0xffffff80060b6088
    0xffffff81d7cdbe50 : 0xffffff8006026bb1
    0xffffff81d7cdbe80 : 0xffffff80060139b5
    0xffffff81d7cdbef0 : 0xffffff800601e003
    0xffffff81d7cdbf70 : 0xffffff80060c92ad
    0xffffff81d7cdbfb0 : 0xffffff80060f35e6
    Kernel Extensions in backtrace:
    com.apple.iokit.IOAcceleratorFamily2(98.9)[5D0EFFAC-FCC9-359B-9999-D92D122F3F50] @0xffffff7f88066000->0xffffff7f880cafff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[D7DDC654-8A3E-33FC-B5ED-E756535EBD4D]@0xffffff 7f866d1000
    dependency: com.apple.iokit.IOGraphicsFamily(2.4)[C193403C-110B-31D6-857E-5AFDB7868294]@0xf fffff7f8696d000
    com.apple.driver.AppleIntelHD5000Graphics(8.2)[32600E01-1824-32F0-9E54-3BD0B5AC1 559]@0xffffff7f880d8000->0xffffff7f88127fff
    dependency: com.apple.iokit.IOSurface(91)[BC96A900-DD9D-3F36-AFE6-EF88CB4B3607]@0xffffff7f8 7266000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[D7DDC654-8A3E-33FC-B5ED-E756535EBD4D]@0xffffff 7f866d1000
    dependency: com.apple.iokit.IOGraphicsFamily(2.4)[C193403C-110B-31D6-857E-5AFDB7868294]@0xf fffff7f8696d000
    dependency: com.apple.iokit.IOAcceleratorFamily2(98.9)[5D0EFFAC-FCC9-359B-9999-D92D122F3F50 ]@0xffffff7f88066000
    BSD process name corresponding to current thread: Evernote
    Mac OS version:
    13B3116
    Kernel version:
    Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64
    Kernel UUID: C51C3998-66EA-3C1B-A46E-90943DA76DF4
    Kernel slide:
    0x0000000005e00000
    Kernel text base: 0xffffff8006000000
    System model name: MacBookPro11,3 (Mac-2BD1B31983FE1663)
    System uptime in nanoseconds: 48426283248445
    last loaded kext at 47879933614493: com.apple.driver.AppleMikeyHIDDriver
    124 (addr 0xffffff7f88605000, size 20480)
    last unloaded kext at 40603360896596: com.apple.driver.AppleUSBCDC
    4.2.1b5 (addr 0xffffff7f88605000, size 16384)
    loaded kexts:
    com.sophos.kext.sav
    9.0.53
    com.sophos.nke.swi
    9.0.53
    com.apple.driver.AppleMikeyHIDDriver
    124
    com.apple.filesystems.smbfs
    2.0.0
    com.apple.driver.AppleHWSensor
    1.9.5d0
    com.apple.filesystems.autofs
    3.0
    com.apple.driver.AudioAUUC
    1.60
    com.apple.iokit.IOBluetoothSerialManager
    4.2.1f2
    com.apple.driver.ApplePlatformEnabler
    2.0.9d1
    com.apple.driver.AGPM
    100.14.14
    com.apple.driver.X86PlatformShim
    1.0.0
    com.apple.driver.AppleHDA
    2.5.8fc1
    com.apple.driver.AppleUpstreamUserClient
    3.5.13
    com.apple.iokit.IOUserEthernet
    1.0.0d1
    com.apple.GeForce
    8.2.0
    com.apple.Dont_Steal_Mac_OS_X
    7.0.0
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
    4.2.1f2
    com.apple.driver.AppleHWAccess
    1
    com.apple.driver.AppleSMCLMU
    2.0.4d1
    com.apple.driver.AppleCameraInterface
    4.20.0
    com.apple.driver.AppleMuxControl
    3.4.28
    com.apple.driver.AppleLPC
    1.7.0
    com.apple.driver.AppleThunderboltIP
    1.0.10
    com.apple.driver.AppleMCCSControl
    1.1.12
    com.apple.driver.AppleIntelHD5000Graphics
    8.2.0
    com.apple.driver.AppleIntelFramebufferAzul
    8.2.0
    com.apple.driver.AppleUSBTCButtons
    240.2
    com.apple.driver.AppleUSBTCKeyboard
    240.2
    com.apple.driver.AppleUSBCardReader
    3.4.0
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless
    1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib
    1.0.0d1
    com.apple.BootCache
    35
    com.apple.driver.AppleUSBHub
    660.4.0
    com.apple.driver.XsanFilter
    404
    com.apple.iokit.IOAHCIBlockStorage
    2.4.5
    com.apple.driver.AppleAHCIPort
    2.9.5
    com.apple.driver.AirPort.Brcm4360
    821.21.49
    com.apple.driver.AppleUSBXHCI
    660.4.2
    com.apple.driver.AppleSmartBatteryManager
    161.0.0
    com.apple.driver.AppleACPIButtons
    2.0
    com.apple.driver.AppleRTC
    2.0
    com.apple.driver.AppleHPET
    1.8
    com.apple.driver.AppleSMBIOS
    2.0
    com.apple.driver.AppleACPIEC
    2.0
    com.apple.driver.AppleAPIC
    1.7
    com.apple.nke.applicationfirewall
    153
    com.apple.security.quarantine
    3
    com.apple.kext.triggers
    1.0
    com.apple.iokit.IOSerialFamily
    10.0.7
    com.apple.driver.DspFuncLib
    2.5.8fc1
    com.apple.vecLib.kext
    1.0.0
    com.apple.iokit.IOAudioFamily
    1.9.4fc11
    com.apple.kext.OSvKernDSPLib
    1.14
    com.apple.iokit.IOBluetoothFamily
    4.2.1f2
    com.apple.nvidia.driver.NVDAGK100Hal
    8.2.0
    com.apple.nvidia.driver.NVDAResman
    8.2.0
    com.apple.iokit.IOAcceleratorFamily
    98.9
    com.apple.iokit.IOBluetoothHostControllerUSBTransport
    4.2.1f2
    com.apple.driver.AppleGraphicsControl
    3.4.28
    com.apple.driver.X86PlatformPlugin
    1.0.0
    com.apple.driver.AppleHDAController
    2.5.8fc1
    com.apple.iokit.IOHDAFamily
    2.5.8fc1
    com.apple.driver.IOPlatformPluginFamily
    5.7.0d1
    com.apple.driver.AppleBacklightExpert
    1.0.4
    com.apple.driver.AppleSMBusController
    1.0.11d1
    com.apple.driver.AppleSMC
    3.1.6d1
    com.apple.iokit.IOSurface
    91
    com.apple.iokit.IONDRVSupport
    2.4
    com.apple.AppleGraphicsDeviceControl
    3.4.28
    com.apple.iokit.IOAcceleratorFamily2
    98.9
    com.apple.iokit.IOGraphicsFamily
    2.4
    com.apple.driver.CoreStorage
    380
    com.apple.driver.AppleUSBMultitouch
    240.9
    com.apple.driver.AppleUSBMergeNub
    650.4.0
    com.apple.iokit.IOUSBHIDDriver
    660.4.0
    com.apple.driver.AppleThunderboltDPInAdapter
    3.1.2
    com.apple.driver.AppleThunderboltDPAdapterFamily
    3.1.2
    com.apple.driver.AppleThunderboltPCIDownAdapter
    1.4.3
    com.apple.iokit.IOSCSIBlockCommandsDevice
    3.6.5
    com.apple.iokit.IOUSBMassStorageClass
    3.6.0
    com.apple.iokit.IOSCSIArchitectureModelFamily
    3.6.5
    com.apple.driver.AppleUSBComposite
    656.4.1
    com.apple.iokit.IOUSBUserClient
    660.4.2
    com.apple.iokit.IOAHCIFamily
    2.6.0
    com.apple.driver.AppleThunderboltNHI
    1.9.8
    com.apple.iokit.IOThunderboltFamily
    3.2.3
    com.apple.iokit.IO80211Family
    600.34
    com.apple.driver.mDNSOffloadUserClient
    1.0.1b4
    com.apple.iokit.IONetworkingFamily
    3.2
    com.apple.iokit.IOUSBFamily
    660.4.2
    com.apple.driver.AppleEFINVRAM
    2.0
    com.apple.driver.AppleEFIRuntime
    2.0
    com.apple.iokit.IOHIDFamily
    2.0.0
    com.apple.iokit.IOSMBusFamily
    1.1
    com.apple.security.sandbox
    278.10
    com.apple.kext.AppleMatch
    1.0.0d1
    com.apple.security.TMSafetyNet
    7
    com.apple.driver.AppleKeyStore
    2
    com.apple.driver.DiskImages
    371.1
    com.apple.iokit.IOStorageFamily
    1.9
    com.apple.iokit.IOReportFamily
    23
    com.apple.driver.AppleFDEKeyStore
    28.30
    com.apple.driver.AppleACPIPlatform
    2.0
    com.apple.iokit.IOPCIFamily
    2.8
    com.apple.iokit.IOACPIFamily
    1.4
    com.apple.kec.corecrypto
    1.0
    com.apple.kec.pthread
    1
    Thanks in advance!!!

    I was having multiple kernel panics with the current version of Sophos with Mavericks, too.
    To the OP - use the Sophos uninstaller and your kernel panics should stop.
    Clinton

  • About explain plan

    Hello ALL,
    I have the following explain plan, can any body explain the meaning of this explain plan
    SELECT * FROM
    2 TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE','111'));
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
    | 0 | SELECT STATEMENT | | 401 | 25263 | | 751K|
    | 1 | MERGE JOIN SEMI | | 401 | 25263 | | 751K|
    | 2 | SORT JOIN | | 17M| 820M| 2108M| 75297 |
    | 3 | TABLE ACCESS FULL | TABLE1 | 17M| 820M| | 3520 |
    |* 4 | SORT UNIQUE | | 275M| 3412M| 10G| 676K|
    | 5 | VIEW | VW_NSO_1 | 275M| 3412M| | 3538 |
    |* 6 | HASH JOIN | | 275M| 7874M| | 3538 |
    |* 7 | TABLE ACCESS FULL| TABLE2 | 16 | 128 | | 2 |
    |* 8 | TABLE ACCESS FULL| TABLE1 | 17M| 360M| | 3520 |
    Predicate Information (identified by operation id):
    4 - access("TABLE1"."POSITION"="VW_NSO_1"."$nso_col_1")
    filter("TABLE1"."POSITION"="VW_NSO_1"."$nso_col_1")
    6 - access("TABLE2"."VERSION_NO"="TABLE1"."VERSION_NO")
    7 - filter("TABLE2"."STATIC_UPD_FLAG"='N')
    8 - filter("TABLE1"."DATETIME_INSERTED">TO_DATE('0004-01-01 00:00:00',
    'yyyy-mm-dd hh24:mi:ss'))
    Note: cpu costing is off
    26 rows selected.
    SQL>

    There is a section in the manual on interpreting the output of explain plan http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/ex_plan.htm#16972 Tom Kyte also discusses interpreting the plan http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:231814117467#7344298017927 (page down about halfway where he starts his book excerpt).
    Rows, bytes, and temp space are the cost-based optimizer's guess about the number of rows, bytes, and temp space that will be touched (or consumed) by the operation. The cost is an internal number that has no significance to you when you're reading an explain plan-- it does have some significance when you are examining an event 10046 trace.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • ITunes 10.6.1 and Squeezebox

    I can't get my ancient Squeezebox 3, using Logitech Media Server 7.7.2, to find new music in my iTunes 10.6.1 playlists. The Logitech program seems to be stuck in the way iTunes was 1-2 months ago. Is there some newly introduced incompatibility here?

  • MacBook has Lost contact with my HP wireless printer

    Suddenly I cannot print from my MacBook Air to my HP 6510 wireless printer although I have not actively changed anything.  Suggestions please!

  • How to initialize the index with "at new" command ??

    Hi All, I am facing a problem of Initializing the index . I want to Initialize the Index with the " at new " command within a loop but its not working. Otherwise,please tell me the way to put a flag on the first record with " at new " command. Please

  • Having problems upgrading from Panther to Tiger

    Hi there! I'm new to this place, but very desperate to find answers. I have been trying to upgrade from panther to tiger for the past week and have gotten a mess. I have to restore my old panther system after a panic kernal while trying to install ti

  • Ttoshiba lap top A135-2266 suddenly quit responding,now nothing works period

       computer frooze,only way i could get it 2 respond was 2 power off,when i power on,basicly the only thing that happened was power light,batter indicator,light showing it is running off of the power cord. it frooze up while on ebay,when i hooked up