The maximum value of a maximum value without making two querys of the same

Hi,
In the table cmp_lineas_cotizacion i need to take only rows with the maximum lc.mto_precio_venta of the maximum l.fec_ini_vigencia_costo of l.cod_producto, but I have the problem that cmp_lineas_cotizacion is a very load table with take to much resources of the database, I can't modify or agregate indexes, so I need a way to make this query more efficient. I want to find a way to replace the last 6 lines of this query and make it faster.
select b.segment1 || '.' || b.segment2 as ITEM,
        case when b.organization_id in (125,89,90,92,95,97,99,101,104,106,108,110,112,115,83,85,
                                                    87,88,91,93,94,96,98,100,102,103,107,109,111,113,114,116,
                                                    117,120,123,124,128,130,132,134,135,133,131,129,118,182)
                  then 1
             when b.organization_id in (105, 126)
                  then 2
        end as ZONE_ID,
        replace(l.mto_precio_venta,',','.') as STANDARD_RETAIL,
       'VEF' as STANDARD_RETAIL_CURRENCY,
        case when b.primary_unit_of_measure like '%KG%' then 'KG'
             when b.primary_unit_of_measure like '%Kg%' then 'KG'
             when b.primary_unit_of_measure like '%UND%' then 'EA'
             when b.primary_unit_of_measure = 'Kilogramo' then 'KG'
             when b.primary_unit_of_measure = 'Litro' then 'L'
             when b.primary_unit_of_measure = 'Unidad' then 'EA'
             else null
        end as STANDARD_UOM,
        case when l.Mto_precio_venta_cm_emp is not null then replace(l.Mto_precio_venta_cm_emp,',','.')
             else '0'
        end as SELLING_RETAIL,
        'VEF' as SELLING_RETAIL_CURRENCY,
         case   when b.PRIMARY_UNIT_OF_MEASURE like '%Barril%' then 'BA'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Bolsa%' then 'KG'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Bulto%' then 'BE'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Caja%' then 'CS'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Docena%' then 'CS'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Kg%' then 'CS'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Kilogramo%' then 'CS'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Litro%' then 'Po'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Paquete%' then 'PACK'
                when b.PRIMARY_UNIT_OF_MEASURE like '%Unidad%' then 'CS'
                else 'CS'
        end as SELLING_UOM,
        null as MULTI_UNITS,
        null as MULTI_UNIT_RETAIL,
        null as MULTI_UNIT_RETAIL_CURRENCY,
        null as MULTI_SELLING_UOM,
        null as LOCK_VERSION
from cmp_lineas_cotizacion l,
     inv.mtl_system_items_b b
where b.segment1 || '.' || b.segment2 = l.cod_producto
      and (l.cod_producto in ((select codigo
                             from tmp.viveres_vegetales)
                             UNION
                             (select codigo
                             from tmp.genericos)
                             UNION
                             (select codigo
                             from tmp.hijos_genericos)))
and l.fec_ini_vigencia_precio > to_date('01/09/2008','DD/MM/YYYY')
      and (b.segment1 || '.' || b.segment2, l.fec_ini_vigencia_costo, l.mto_precio_venta) in
                      select lc.cod_producto, max(lc.fec_ini_vigencia_costo), max(lc.mto_precio_venta)
                      from  cmp_lineas_cotizacion lc
                      where lc.fec_ini_vigencia_precio > to_date('01/09/2008','DD/MM/YYYY')
                      group by lc.cod_producto
                      )

Without table definitions, input data, and expected output, it's hard to test. But I would expect that analytic functions would be what you're after (assuming that omitting the "l.cod_producto in" clause from your main query in the subquery where you are getting the MAX values doesn't change any results). Something like
SELECT <<all your columns>>,
       l.fec_ini_vigencia_costo,
       l.mto_precio_venta,
       max(l.fec_ini_vigencia_costo) over (partition by l.cod_producto) max_vigencia_costo,
       max(l.mto_precio_venta) over (partition by l.cod_producto) max_precio_venta
  FROM <<the rest of your query>>will include the MAX values and the current row values without needing to hit the table a second time. Then you should be able to do
SELECT <<list of columns>>
  FROM (<<whole query from the last step>>)
WHERE fec_ini_vigencia_costo = max_vigencia_costo
   AND mto_precio_venta = max_precio_ventaJustin

Similar Messages

  • How can I get my audio to move down when I move my video up without making two separate moves?

    Hey
    I have moved to Premiere as a lot of the companies I edit for are now using it. Overall impression is GREAT especially CC vs 5.5 which I started in.
    In relation to my question, when I move my video track up a layer my audio stays on track 1 or whereever it started. This is really frustrating as it overwrites the exsiting audio when I move it.
    Is there are workaround other than moving the audio down first then moving the clip along, I find this slows me down a lot.
    Is this coming out in a new update, or is there a quick solution i missing?
    I am about to head into 8 days of fast turnaround multi cam editing so any help would be appreciated.
    Thanks
    Piers Faircloth Harding

    I understand that side of it, its a feature which I was used to in FCP and now I dont have it so was wondering if CC has this feature.
    In realation to audio not caring what layer it is on you are correct but if I want to shift it with my video to a different layer it is a labourous task when editing under pressure in time sensitive situations eg onsite VNRs for events where you have to have ambient bg or when you want ambient from b roll over talking to have to shift it down separately before moving your clip to avoid overwriting exsisting.

  • How to change the profile value in the pl/sql code without making change in the database

    How to change the profile value in the pl/sql code without making change in the database.

    I have program ,where if the profiles 'printer and nunber of copies ' are set at the user level, by default when the report completes the O/p will be sent to the printer mentioned in the set-up. but what user wants is
    if these Profiles are set for the user running this program automatic printing should not be done.

  • How to get the day as numeric value without formatting the date?

    Hello,
    to reduce the costs of a sql-statement I need to get the day of a date-value as number (to compare it to a numeric value) without any formatting. Every formatting results in a full table scan of the table with the date field. Is there any function to solve this problem?
    Oracle version is 11g.
    Thanks Carsten

    CarstenDD wrote:
    select T1.SYSID from T2,T1
    where T2.SysT1 = T1.SYSID
    and T2.Date1 < '01.03.2011' --German date format
    and to_number(to_char(T2.Date2,'DD')) = 1
    and T2.Inactive = 0
    The explain plan shows a full table scan on T2. With EXTRACT(DAY FROM T2.Date2) there is no difference.It probably would and should in any case.
    Look at your predicates, which of them would reduce the resultset to a fair size compared to the total number of records in the table?.
    - You may have a huge number of records when you say date less than
    - Of these perhaps one seventh have day = 1
    - My guess is that most have Inactive = 0
    Besides, you should not rely on implictit char to date conversion, always use TO_DATE
    How many records are in the table? - How many will that query return?
    Regards
    Peter

  • Any std funtion(s) for Zero-padded, 2 decimal value, without the deci point

    Hi,
    We want Zero-padded, two decimal value, without the decimal point. For example if it is 14.31, we need 001431.
    I have done "multiply" with 100 and "formatNumber" as '000000'
    SFIeld --> multiply * 100 --> formatNumber (000000) --> TField
    It works good for values with decimal like above 14.31, does it work for everything else too? I mean for 12 it is populating as 001200. Is this best approach? Is there any other std funtions or UDF sample available?
    Regards,
    N@v!n

    >
    N@v!n Kumar wrote:
    > Hi,
    >
    > We want Zero-padded, two decimal value, without the decimal point. For example if it is 14.31, we need 001431.
    > I have done "multiply" with 100 and "formatNumber" as '000000'
    >
    > SFIeld --> multiply * 100 --> formatNumber (000000) --> TField
    >
    > It works good for values with decimal like above 14.31, does it work for everything else too? I mean for 12 it is populating as 001200. Is this best approach? Is there any other std funtions or UDF sample available?
    >
    > Regards,
    > N@v!n
    public void convert_number(String[] FieldValue,ResultList result,Container container){
    FieldValue = FieldValue * 100;
    result.addValue(FieldValue);

  • How can you trim the contact field value without cloudconnector?

    How can you trim the contact field value without cloudconnector?

    You can add your contacts to segments, while right-clicking on the criteria you have added in segments, you will see the option for Merge, Intersect & Trim.
    See the attached URL, it might help you .
    Merge, Intersect, Trim

  • Display the 3rd hieghest value without using rowid

    HI All,
    Can any one help me how to display the 3rd hieghest valuer without using a ROWID..
    Thanks
    Basava

    Frank, using ROWNUM = 1 instead of DISTINCT could be a bit faster:
    SQL> SET LINESIZE 132
    SQL> EXPLAIN PLAN FOR
      2  WITH got_r_num AS (
      3                     SELECT  DISTINCT sal,
      4                                      DENSE_RANK() OVER(ORDER BY sal DESC NULLS LAST) AS r_num
      5                       FROM  scott.emp
      6                    )
      7  SELECT  sal
      8    FROM  got_r_num
      9    WHERE r_num = 3
    10  /
    Explained.
    SQL> @?\RDBMS\ADMIN\UTLXPLS
    PLAN_TABLE_OUTPUT
    Plan hash value: 436395657
    | Id  | Operation                 | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT          |      |     9 |   234 |     5  (40)| 00:00:01 |
    |*  1 |  VIEW                     |      |     9 |   234 |     5  (40)| 00:00:01 |
    |   2 |   HASH UNIQUE             |      |     9 |    36 |     5  (40)| 00:00:01 |
    |*  3 |    WINDOW SORT PUSHED RANK|      |     9 |    36 |     5  (40)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL     | EMP  |    14 |    56 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - filter("R_NUM"=3)
       3 - filter(DENSE_RANK() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC
                  NULLS LAST)<=3)
    18 rows selected.
    SQL> EXPLAIN PLAN FOR
      2  WITH got_r_num AS (
      3                     SELECT  sal,
      4                             DENSE_RANK() OVER(ORDER BY sal DESC NULLS LAST) AS r_num
      5                       FROM  scott.emp
      6                    )
      7  SELECT  sal
      8    FROM  got_r_num
      9    WHERE r_num = 3
    10      AND ROWNUM = 1
    11  /
    Explained.
    SQL> @?\RDBMS\ADMIN\UTLXPLS
    PLAN_TABLE_OUTPUT
    Plan hash value: 21859616
    | Id  | Operation                 | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT          |      |     1 |    26 |     4  (25)| 00:00:01 |
    |*  1 |  COUNT STOPKEY            |      |       |       |            |          |
    |*  2 |   VIEW                    |      |    14 |   364 |     4  (25)| 00:00:01 |
    |*  3 |    WINDOW SORT PUSHED RANK|      |    14 |    56 |     4  (25)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL     | EMP  |    14 |    56 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM=1)
       2 - filter("R_NUM"=3)
       3 - filter(DENSE_RANK() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC
                  NULLS LAST)<=3)
    19 rows selected.
    SQL> SY.

  • How to change the text color of a label by using RGB values without changing the background colour?

    xCode interface builder:
    When I try to change the color property of a label's text by using the RGB values, the background color also changes to the same value automatically.
    in other words:
    While setting the RGB values for text colour of labels, the background colour also changes unless we use the sliders.
    How to make sure that only the color of text changes and not the background?

    You can simply do this.
        [labelname setTextColor:[UIColor colorWithRed:38/255.0f green:171/255.0f blue:226/255.0f alpha:1.0f]];

  • Querying on a value and using that to pull other data in the same query

    I am having some issues pulling the correct data in a query. There is a table that houses application decision data that has a certain decision code in it, WA, for a particular population of applicants. These applicants also may have other records in the same table with different decision codes. Some applicants do NOT have WA as a decision code at all. What I need to do is pull anyone whose maximum sequence number in the table is associated with the WA decision code, then list all other decision codes that are also associated with the same applicant. These do not necessarily need pivoted, so long as I can pull all the records for a person whose highest sequence number is associated with WA and all of the other decision codes for that applicant for the same term code and application number also appear as rows in the output.
    I do not have the rights in Oracle to create tables, so please pardon if this code to make the table is incorrect or doesn't show up here as code. This is not the entire SARAPPD table framework, just the pertinent columns, along with some data to put in them.
    DROP TABLE SARAPPD;
    CREATE TABLE SARAPPD
    (PIDM              NUMBER(8),
    TERM_CODE_ENTRY   VARCHAR2(6 CHAR),
    APDC_CODE         VARCHAR2(2 CHAR),
    APPL_NO        NUMBER(2),
    SEQ_NO             NUMBER(2));
    INSERT INTO SARAPPD VALUES (12345,'201280','WA',1,4);
    INSERT INTO SARAPPD VALUES (12345,'201280','RE',1,3);
    INSERT INTO SARAPPD VALUES (12345,'201280','AC',1,2);
    INSERT INTO SARAPPD VALUES (23456,'201280','RE',1,2);
    INSERT INTO SARAPPD VALUES (23456,'201280','WA',1,3);
    INSERT INTO SARAPPD VALUES (23456,'201280','SC',1,1);
    INSERT INTO SARAPPD VALUES (34567,'201280','AC',1,1);
    INSERT INTO SARAPPD VALUES (45678,'201210','AC',2,1);
    INSERT INTO SARAPPD VALUES (45678,'201280','AC',1,2);
    INSERT INTO SARAPPD VALUES (45678,'201280','WA',1,3);
    INSERT INTO SARAPPD VALUES (56789,'201210','SC',1,2);
    INSERT INTO SARAPPD VALUES (56789,'201210','WA',1,3);
    COMMIT;I have attempted to get the data with a query similar to the following:
    WITH CURR_ADMIT AS
          SELECT   C.SEQ_NO "CURR_ADMIT_SEQ_NO",
                            C.PIDM "CURR_ADMIT_PIDM",
                            C.TERM_CODE_ENTRY "CURR_ADMIT_TERM",
                            C.APDC_CODE "CURR_ADMIT_APDC",
                            C.APPL_NO "CURR_ADMIT_APPNO"
                              FROM SARAPPD C
                              WHERE C.TERM_CODE_ENTRY IN ('201210','201280')
                              AND C.APDC_CODE='WA'
                             AND C.SEQ_NO=(select MAX(d.seq_no)
                                                   FROM   sarappd d
                                                   WHERE   d.pidm = C.pidm
                                                   AND d.term_code_entry = C._term_code_entry)
    select sarappd.pidm,
           sarappd.term_code_entry,
           sarappd.apdc_code,
           curr_admit.CURR_ADMIT_SEQ_NO,
           sarappd.appl_no,
           sarappd.seq_no
    from sarappd,curr_admit
    WHERE sarappd.pidm=curr_admit.PIDM
    and sarappd.term_code_entry=curr_admit.TERM_CODE_ENTRY
    AND sarappd.appl_no=curr_admit.APPL_NOIt pulls the people who have WA decision codes, but does not include any other records if there are other decision codes. I have gone into the user front end of the database and verified the information. What is in the output is correct, but it doesn't have other decision codes for that person for the same term and application number.
    Thanks in advance for any assistance that you might be able to provide. I am doing the best I can to describe what I need.
    Michelle Craig
    Data Coordinator
    Admissions Operations and Transfer Systems
    Kent State University

    Hi, Michelle,
    903509 wrote:
    I do not have the rights in Oracle to create tables, so please pardon if this code to make the table is incorrect or doesn't show up here as code. This is not the entire SARAPPD table framework, just the pertinent columns, along with some data to put in them. You really ought to get the necessary privileges, in a schema that doesn't have the power to do much harm, in a development database. If you're expected to develop code, you need to be able to fabricate test data.
    Until you get those privileges, you can post sample data in the form of a WITH clause, like this:
    WITH     sarappd    AS
         SELECT 12345 AS pidm, '201280' AS term_code_entry, 'WA' AS apdc_code , 1 AS appl_no, 4 AS seq_no     FROM dual UNION ALL
         SELECT 12345,           '201280',                    'RE',               1,             3                 FROM dual UNION ALL
         SELECT 12345,           '201280',                  'AC',            1,          2               FROM dual UNION ALL
    ... I have attempted to get the data with a query similar to the following:
    WITH CURR_ADMIT AS
          SELECT   C.SEQ_NO "CURR_ADMIT_SEQ_NO",
    C.PIDM "CURR_ADMIT_PIDM",
    C.TERM_CODE_ENTRY "CURR_ADMIT_TERM",
    C.APDC_CODE "CURR_ADMIT_APDC",
    C.APPL_NO "CURR_ADMIT_APPNO"
    FROM SARAPPD C
    WHERE C.TERM_CODE_ENTRY IN ('201210','201280')
    AND C.APDC_CODE='WA'
    AND C.SEQ_NO=(select MAX(d.seq_no)
    FROM   sarappd d
    WHERE   d.pidm = C.pidm
    AND d.term_code_entry = C._term_code_entry)
    Are you sure this is what you're actually running? There are errors. such as referencing a column called termcode_entry (starting with an underscore) at the end of the fragment above. Make sure what you post is accurate.
    Here's one way to do what you requested
    WITH     got_last_values  AS
         SELECT  sarappd.*     -- or list all the columns you want
         ,     FIRST_VALUE (seq_no)    OVER ( PARTITION BY  pidm
                                        ORDER BY      seq_no     DESC
                                  )           AS last_seq_no
         ,     FIRST_VALUE (apdc_code) OVER ( PARTITION BY  pidm
                                        ORDER BY      seq_no     DESC
                                  )           AS last_apdc_code
         FROM    sarappd
         WHERE     term_code_entry     IN ( '201210'
                           , '201280'
    SELECT     pidm
    ,     term_code_entry
    ,     apdc_code
    ,     last_seq_no
    ,     appl_no
    ,     seq_no
    FROM     got_last_values
    WHERE     last_apdc_code     = 'WA'
    ;Don't forget to post the results you want from the sample data given.
    This is the output I get from the sample data you posted:
    `     PIDM TERM_C AP LAST_SEQ_NO    APPL_NO     SEQ_NO
         23456 201280 WA           3          1          3
         23456 201280 RE           3          1          2
         23456 201280 SC           3          1          1
         45678 201280 WA           3          1          3
         45678 201280 AC           3          1          2
         45678 201210 AC           3          2          1
         56789 201210 WA           3          1          3
         56789 201210 SC           3          1          2I assume that the combination (pidm, seq_no) is unique.
    There's an analytic LAST_VALUE function as well as FIRST_VALUE. It's simpler (if less intuitive) to use FIRST_VALUE in this problem because of the default windowing in analytic functions that have an ORDER BY clause.

  • How can I stay on the same line  when inputting values in the CLI?

    The title is a bit vague i know :) but i have this issue which isn't really a problem but it would be better if I can solve it.
    Intro)
    I've made this simple addition (and more options but thats not relevant) application for kids in my spare time so that they can train their maths in school and compare their results with other students which is saved in the database using the hypersonic DB that comes with the JBoss application server.
    Now so far so good, but i'm having an issue with the Scanner (I think, but i doubt its because of the CLI) , when i enter a number or text it works and exceptions will be catched etc but when i press the enter key without anything entered the input value wil be displayed a line below and that's not what I want. I want it to stay in the same line.
    Sample CLI output:
    bla application
    ***By: deAppel***
    Ver: 31/10/2007
    Your name:     deAppel
    Your class:     MasterClass
    How many sums you want to make? 14
    Time: 22:03:27
    1: 32 + 40 =     72
    2: 38 + 19 =     57
    3: 5 + 57 =     62
    4: 30 + 20 =     1
    5: 57 + 54 =     2
    6: 33 + 17 =     3
    7: 38 + 54 =     4
    8: 23 + 23 =     5
    9: 48 + 47 =     95
    10: 29 + 55 =     6
    11: 48 + 11 =     7
    12: 1 + 40 =     41
    13: 46 + 35 =     91
    14: 23 + 52 =     75
    Answer 1:      72     You answered:      72     (good)
    Answer 2:      57     You answered:      57     (good)
    Answer 3:      62     You answered:      62     (good)
    Answer 4:      50     You answered:      1     (wrong)
    Answer 5:      111     You answered:      2     (wrong)
    Answer 6:      50     You answered:      3     (wrong)
    Answer 7:      92     You answered:      4     (wrong)
    Answer 8:      46     You answered:      5     (wrong)
    Answer 9:      95     You answered:      95     (good)
    Answer 10:      84     You answered:      6     (wrong)
    Answer 11:      59     You answered:      7     (wrong)
    Answer 12:      41     You answered:      41     (good)
    Answer 13:      81     You answered:      91     (wrong)
    Answer 14:      75     You answered:      75     (good)
    EndTime: 22:04:18
    Total good: 6
    Total wrong: 8
    Total sums answered: 14
    Final score: 42.857143%
    Upload score? (yes/no): no
    Compare score from other users? (yes/no): no
    Want to try again? (yes/no): no
    ********Made by: deAppel @ http://www.link removed cause it doesnt matter .com*********
    ************The application will close within 5 seconds*************
    To sum it up for those that don't like to read my post:
    1: 32 + 40 = 72
    2: 38 + 19 =
    whitespace <-- this happens because of the enter
    whitespace <-- this happens because of the enter
    57
    3: 5 + 57 = 62
    I want the input to stay in the same line unless you have typed something. I feel silly for not knowing how to handle this.
    Hm.. i'll tried to solve it myself but it seems that im unable to do that.
    /me takes a quick coffee break and will look at the code again after that *

    paulcw wrote:
    It sounds like you want either a CURSES implementation (I believe there's one for Java), or just move to a GUI.I was planning to create a GUI for it eventually, but i just wanted to solve this one first and make sure everything works the way i want it too. I'll take a look at the CURSES implementation thanks.

  • Dynamically Set Subreport Background Color to the Same Value as Main Report Background Color

    I have a report that contains a subreport.  The main report has groupings in it.  I am dynamically setting the background color of the group rows based on an expression.  That part is working fine.  The problem that I am having is that
    I don't know how to get the subreport to "inherit" the background color of the grouping that holds it.
    Basically, I have different row shadings on my report differentiating the groupings except for the rows where the subreport shows.
    How do I go about setting the subreport background color to equal it's contaiing grouping's background color?  Thanks in advance for any and all assistance provided.

    The parameter method given by gpshukla will send the info to the subreport, but you don't need the color parameter in the main report, only the subreport. The trick is in setting the value of that parameter.
    Right-click the cell with the embedded subreport, you can select subreport properties.
    Select Parameters and add a parameter.
    The name column is the name of the parameter in the subreport (color) and value is the value to set it to.
    Set name to "color" (no quotes).
    Set Value to the same expression used to set the background color for the row.
    In the subreport, click the design surface to select the report (not header or footer).
    In the properties pane, select background color and choose expression from the dropdown.
    Type =Parameters!color.Value into the expression builder.
    This will work assuming that background color in the main report row will not change without also refreshing the subreport.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

  • Is it possible to store a multiple indexes for the same value extractor?

    I ran into a situation where there were different queries that I was interested in doing that might have benefitted from having several indexes, sorted differently, but for the same ValueExtractor() instance.
    Is this good practice, is it recommended, and is there a clean way to do it? It seemed like the only way I could logically "trick" the system into it would be passing some sort of "query type" constant into the ValueExtractor when it was created, and then making the equals and hashCode() methods on the ValueExtractor delegate to the constant for equality, but this seemed like a massive hack.

    Hi Kris,
    First, try without each value extractor and see how the different queries compare in performance. You may find that you need only one. If you find otherwise, please let us know because it may indicate a good area for additional optimizations.
    Second, you are correct that the value extractor is the key of the index, and thus to have two indexes on the same value, you will need two different value extractors (i.e. the hashcode/equals comment you made.)
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!

  • Po Creation Date and Orader Datate are holding the same values or diffrent?

    Hi All,
    Please clarify on weather the PO Creation_Date at header level and Po Order Date at the Summary level both are having the same data or different.
    Thanks,
    Sathya.

    Sorry, but it's difficult to describe ... I'm not sure if I can recreate this on ApEx-Site, but I take a try.
    Without pagination report is much slower than before.
    The diffrence between the two output version is that the column
    NVL(AVG(preisnext),AVG(preiscurrent)) - NVL(AVG(preiscurrent),AVG(preisnext)) Entwicklung
    is computed as 0 in the using-items-version (wich is not correct).
    I found out that when I replace the NULL-columns in the subquery (NULL preiscurrent // NULL preisnext) with static values (e.g. 0) it works again, but with average function the result is not correct.
    Hoped that someone got this problem, too.
    Just as I thought, I don't get the problem with a simple example version (http://apex.oracle.com/pls/otn/f?p=51163) :-|
    And the strange thing is that it works when I started application for the first time this morning, but after changing Input Values it went wrong. (Meanwhile I logged out and in again to be sure that cache is cleared but no effects).
    Edited by: user11884435 on 10.09.2009 01:31
    Meanwhile I suspect that problem got something to do with source of an item: when it's static it's O.K.; when it's based on a query (SELECT TO_DATE(:P1_DATUM_NEU,'dd.mm.yyyy') - 7 FROM dual;) then it goes wrong ... seems that the subselect returns no rows because of this.
    ...to be continued ;-)
    Edited by: user11884435 on 10.09.2009 02:44

  • How to pass a numeric value without its format to a subsequence?

    I have a sequence with a numeric parameter that is interpreted as a 16-bit bit mask. The numeric format of the parameter of that sequence is therefore "%#.16b".
    I also have a Sequence Call step in a second sequence (in the same file) that calls this first sequence. That second sequence passes literal values for that bit mask in the Sequence Call. My specific problem at this point is that, while debugging, I don't see the parameters in the numeric format I explicitly specified for them, but rather in one of three possible formats:
    - Literal values seem to come with a "system"-wide (maybe sequence-file-specific?) default format, which is decimal instead of binary.
    - Variable values (e.g. from the Locals) have their specific (and also explicitly defined) numeric format, which can be anything instead of binary.
    - If I don't pass a value but use the parameter default, this default is shown in the parameter's actual numeric format, binary. This is the only case that works as intended.
    How do I get the parameters to *always* keep the numeric format I specified for that sequence?
    The attached file tries to reproduce the problem and the intended result using only Sequence Calls and Message Popups. My version is TestStand 3.1f1.

    I just want to debug my subsequence and see its parameter represented as "0b0000000000011010" when I supply a literal value of 26.
    Ok, I try to be more explicit and show my problem using your suggestion: (The resulting sequence file is attached.)
    - Create a new sequence file.
    - Insert a new sequence "Sequence".
    - In "Sequence", create a parameter "Parameter" of type "Number".
    - Change the numeric format of "Parameter" to Binary with a minimum of 16 digits and *without radix*, ie. "%.16b". (In the other sequence file I used "%#.16b".)
    -> Intention: I want to see the supplied parameter value in this numeric format when debugging or converting to a string using Str().
    - Still in "Sequence", create a local "Local" of type "Number".
    - Change the numeric format of "Local" to the same as above, "%.16b".
    -> Intention: I want to demonstrate your way here, which actually works (I can use it as the "reference string" of the yet-to-be-defined message box), but does in an indirect way what I want to do directly using only sequence parameters.
    - Insert a "Statement" step in "Sequence".
    - Of "Statement", "Edit Expression" and use "Locals.Local = Parameters.Parameter" as the expression.
    - Insert a "Message Popup" step in "Sequence".
    - Of "Message Popup", do "Edit Message Settings", and use the following expression as the Message Expression:
    "I have this: " + Str(Parameters.Parameter) + "\n" +
    "I want this: " + Str(Locals.Local)
    - Insert a "SequenceCall" step in MainSequence.
    - Point "SequenceCall" to sequence "Sequence" of the current file and supply exactly the literal value 26 for the parameter.
    - In "MainSequence", create a local "Local" of type "Number".
    - Change the numeric format of this "Local" to something very dangerous, eg. "%9.16o".
    - Assign the exact numeric value 4616 to this "Local" variable.
    -> Intention: I want to demonstrate that there are cases where a propagation of numeric formats to subsequences can actually be more than a mere nuisance.
    - In "MainSequence", insert a second Sequence Call step, "SequenceCall_2".
    - Let "SequenceCall_2" call the same sequence "Sequence", but supply Locals.Local for the parameter.
    - Now run the sequence file in "Single Pass" mode.
    - In the first popup, you see that I get the (binary!) representation 0000000000011010 only for the local variable, but I also want it for the parameter value.
    - In the second popup, you see that I get the (octal!) representation 0000000000011010 for the parameter value, which would be correct (for what I want) if I had supplied the decimal literal 26 again. You see that the binary representation is something entirely different here!
    I hope you now get the point. Thanks for answering!
    Attachments:
    numeric-format-02c.seq ‏35 KB

Maybe you are looking for