Account Query is taking longtime and not giving desired results

Hi,
I'm trying to run the following query to get code combination id for last six months with 1)no activity in gl_je_lines
2) Sum of begin balance and PTD is zero
Her's query :
select
cc.segment3 SEGMENT
from apps.gl_code_combinations cc,
apps.gl_balances bal,
apps.fnd_flex_values_vl ffvl,
apps.fnd_flex_value_sets ffvs,
(select period_name
from apps.gl_periods
where period_set_name ='abc Calendar'
and to_date(period_name,'Mon-YY') between add_months(sysdate,(6*-1)-1) and sysdate) p
where cc.CODE_COMBINATION_ID = bal.CODE_COMBINATION_ID
and ffvl.FLEX_VALUE = cc.segment3
and ffvl.FLEX_VALUE_SET_ID = ffvs.flex_value_set_id
and ffvs.flex_value_set_id = 2222222
and bal.SET_OF_BOOKS_ID =555
and cc.CHART_OF_ACCOUNTS_ID = 11111
and bal.period_name = p.period_name
and ffvl.ENABLED_FLAG = 'Y'
and ffvl.END_DATE_ACTIVE is null
and bal.TEMPLATE_ID IS NULL
and bal.actual_flag='A'
and bal.currency_code 'STAT'
and ffvl.creation_date <= add_months(sysdate,(6*-1)-1)
and cc.SEGMENT3 not in (
select
distinct gcc.SEGMENT3
from apps.gl_je_lines l
, apps.gl_code_Combinations gcc,
(select period_name
from apps.gl_periods
where period_set_name ='abc Calendar'
and end_date > add_months(last_day(sysdate),-1) and end_date <= last_day(sysdate)) lp
where l.code_combination_id = gcc.code_combination_id
and gcc.CHART_OF_ACCOUNTS_ID = 11111
and l.period_name=lp.period_name
and l.set_of_books_id = 555
and l.status='P')
group by cc.SEGMENT3
HAVING sum(abs(nvl(bal.BEGIN_BALANCE_DR,0))-abs(nvl(bal.BEGIN_BALANCE_CR,0))+abs(nvl(bal.PERIOD_NET_DR,0))-abs(nvl(bal.PERIOD_NET_CR,0))) = 0--------------------------------------------------------------------------------
Here's Explain Plan
Operation Node Cost IO Cost CPU Cost Cardinality Object Name Options Object Type Optimizer
SELECT STATEMENT 5155 5094 554583434 1 ALL_ROWS
FILTER
HASH (GROUP BY) 5155 5094 554583434 1 GROUP BY
FILTER
TABLE ACCESS (BY INDEX ROWID) 4 4 31301 1 GL_BALANCES BY INDEX ROWID TABLE ANALYZED
NESTED LOOPS 18 18 427467 1
MERGE JOIN (CARTESIAN) 14 14 396166 1 CARTESIAN
TABLE ACCESS (BY INDEX ROWID) 4 4 49409 1 GL_CODE_COMBINATIONS BY INDEX ROWID TABLE ANALYZED
NESTED LOOPS 8 8 82677 1
NESTED LOOPS 4 4 33268 1
NESTED LOOPS 4 4 31368 1
INDEX (UNIQUE SCAN) 1 1 8171 1 FND_FLEX_VALUE_SETS_U1 UNIQUE SCAN INDEX (UNIQUE) ANALYZED
TABLE ACCESS (BY INDEX ROWID) 3 3 23196 1 FND_FLEX_VALUES BY INDEX ROWID TABLE ANALYZED
INDEX (RANGE SCAN) 2 2 15293 1 FND_FLEX_VALUES_N3 RANGE SCAN INDEX ANALYZED
INDEX (UNIQUE SCAN) 0 0 1900 1 FND_FLEX_VALUES_TL_U1 UNIQUE SCAN INDEX (UNIQUE) ANALYZED
INDEX (RANGE SCAN) 2 2 33113 4 GL_CODE_COMBINATIONS_N3 RANGE SCAN INDEX ANALYZED
FILTER
TABLE ACCESS (BY INDEX ROWID) 20 20 163416 1 GL_JE_LINES BY INDEX ROWID TABLE ANALYZED
NESTED LOOPS 5136 5076 545022343 1
MERGE JOIN (CARTESIAN) 5103 5043 544739760 4 CARTESIAN
TABLE ACCESS (BY INDEX ROWID) 5 5 37587 1 GL_PERIODS BY INDEX ROWID TABLE ANALYZED
INDEX (RANGE SCAN) 2 2 15043 4 GL_PERIODS_N2 RANGE SCAN INDEX ANALYZED
BUFFER (SORT) 5098 5038 544702173 7 SORT
TABLE ACCESS (FULL) 5098 5038 544702173 7 GL_CODE_COMBINATIONS FULL TABLE ANALYZED
INDEX (RANGE SCAN) 3 3 29414 36 GL_JE_LINES_N1 RANGE SCAN INDEX ANALYZED
BUFFER (SORT) 10 10 346757 1 SORT
INDEX (FULL SCAN) 6 6 313489 1 GL_PERIODS_U1 FULL SCAN INDEX (UNIQUE) ANALYZED
INDEX (RANGE SCAN) 2 2 15493 1 GL_BALANCES_N1 RANGE SCAN INDEX ANALYZEDThis query is taking two hrs to get results :
How to tune this query to get results faster

Hi,
170 posts and still do not know how to use {noformat}{noformat} tags?
Please read <a href="https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002">How do I ask a question on the forums?</a>
If you have a performance issue have a look at <a href="https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360003">How to improve the performance of my query? / My query is running slow. </a>
Additionally when you put some code please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
Also consider closing some of your questions when someone is answering. Looking at your profile:
Handle:      user518071 
Status Level:      Newbie
Registered:      Jun 30, 2006
Total Posts:      170
Total Questions:      92 (58 unresolved) it still looks that you have 58 unresolved questions. Are they really all unresolved?
Regards.
Al

Similar Messages

  • SPEL not giving desired result

    Hi ALL,
    SPEL
    *${oa.TestPVO1.xxDisable}* on Disable Property for a button
    In CO
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    am.invokeMethod("hide");
    In AM
    public void hide()
    OAViewObject disvo = (OAViewObject)getTestPVO1();
    if (!disvo.isPreparedForExecution())
    disvo.executeQuery();
    Row drow = disvo.createRow();//.getCurrentRow();
    disvo.insertRow(drow);
    drow.setAttribute("xxDisable", Boolean.FALSE);
    NOT giving desired o/p to disable the button
    Thanks,
    Sombit.
    Edited by: Sombit on Oct 1, 2009 7:33 AM

    Try assigning the SPEL value in the *VORowImpl.
    First, in order to assign a value to SPEL, you'll need to create a custom VO. Here's a sample query I've used to create my VO to pull data pertainining to if an Attribute should be mandatory/rendered.
    SELECT min(descriptive_flex_context_code) descriptive_flex_context_code, min(Enabled) Enabled, min(END_USER_COLUMN_NAME) END_USER_COLUMN_NAME, min(required_flag) required_flag, min(application_column_name) application_column_name,
    min(xxx.LOV) LOV
    from
    (SELECT descriptive_flex_context_code,'Y' Enabled, END_USER_COLUMN_NAME, required_flag, application_column_name,
    decode(ffvv.flex_value,null,'N','Y') LOV
    FROM FND_DESCR_FLEX_COL_USAGE_VL fdfc,
    fnd_flex_values_vl ffvv
    WHERE (fdfc.APPLICATION_ID=20045)
    and (fdfc.DESCRIPTIVE_FLEXFIELD_NAME LIKE 'SPL Account Map')
    and fdfc.enabled_flag = 'Y'
    and fdfc.display_flag = 'Y'
    and fdfc.application_column_name = 'ATTRIBUTE5'
    and ffvv.flex_value_set_id(+) = fdfc.flex_value_set_id
    and rownum = 1) xxx
    Once the VO is created, I created several transient "boolean" attributes in my VO. These attributes will be assigned a value based on code I place in my *VORowImpl since this is the file which controls attribute assignments.
    But before that, in my *VOImpl, I've defined a custom method which is used to execute the VO from my AM.
    public class Ref5PVOImpl extends OAViewObjectImpl
    * This is the default constructor (do not remove)
    public Ref5PVOImpl()
    public void initRef5PVO()
    // setWhereClause("descriptive_flex_context_code in (select vendor_name from spl_account_map where cont_cd = :1)");
    setWhereClauseParams(null); //Always reset
    // setWhereClauseParam(0, acct);
    // System.out.println("value_selected customer>> "+acct);
    executeQuery();
    In my *VORowImpl, I've added custom code to my Attribute methods so that they return the proper values when invoked...
    public String getMakeRequired()
    if (getRequiredFlag()!= null)
    if ("Y".equals(getRequiredFlag()))
    //if(getMessageChoiceAttribute()==null)
    System.out.println("Required returned yes");
    return "yes";
    else
    System.out.println("Required returned no");
    return "no";
    else
    return "no"; //poplist will be disabled - DFF is not configured
    public Boolean getOptionRender()
    if (getLov()!= null)
    // In this method check if the Message Text Input is valid
    if ("N".equals(getLov()))
    System.out.println("OptionRender returned true "+ getLov());
    return Boolean.TRUE; //text input will be enabled if no LOV exists
    else
    System.out.println("OptionRender returned false "+ getLov());
    return Boolean.FALSE; //text input will be disabled if LOV exists
    else
    return Boolean.FALSE; //text input will be disabled - DFF is not configured
    Then add your SPEL directive into your field's Property inpector...
    ${oa.Ref5PVO1.MakeRequired}
    ${oa.Ref5PVO1.OptionRender}

  • Group by Query not giving desired results

    Hi,
    I've a requirement to find minimum month based on status:
    The following query is giving error :
    SELECT
              b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
              MIN(a.period_name)
    FROM     table a,
         table b
    WHERE     a.app_id     =     b.app_id
    AND          b.app_name      =     'NAME1'
    AND          a.book_id     =     &book_id
    AND          a.status      =      'O'
    GROUP BY      b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
    for ex: in the above query if I've four records with status 'O' and period_name as 'May-12', 'Jun-12','Jul-12' ,'Aug-12' then I need to pick 'May'
    Thanks,
    Kiran

    Hi, Kiran,
    user518071 wrote:
    Hi,
    I've a requirement to find minimum month based on status:
    The following query is giving error :
    SELECT
              b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
              MIN(a.period_name)
    FROM     table a,
         table b
    WHERE     a.app_id     =     b.app_id
    AND          b.app_name      =     'NAME1'
    AND          a.book_id     =     &book_id
    AND          a.status      =      'O'
    GROUP BY      b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
    for ex: in the above query if I've four records with status 'O' and period_name as 'May-12', 'Jun-12','Jul-12' ,'Aug-12' then I need to pick 'May'
    Thanks,
    KiranIt looks like you're almost there.
    If period_name is a DATE, then
    MIN (a.period_name)is finidng the earliest period name, such as 5 May 2012 17:03:49. If you just want to see 'May 2012', then change that to
    TO_CHAR ( MIN (a.period_name)
            , 'Mon YYYY'
            )If a.period_name is a VARCHAR2, then change it to a DATE. The best way to do this is permanently. There is no reason to store date information in VARCHAR2 columns. Oracle supplies DATE columns; there's no extra cost for using them. DATE columns were designed for storing date information, use them to do that.
    if you must keep your date information in VARCHAR2 a column, then use TO_DATE in the query. It will be slow, and you'll have run-time errors if any of the information is in the wrong format. That's what happens when you store date information in VARCHAR2 columns.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • Am.getOADBTransaction().getOrgId() not giving desired result

    Hello,
    I am trying to query Operating Unit in controller of one OAF page.
    Code I tried was
    am.getOADBTransaction().getOrgId(), but it returns -1.
    The responsibility user selects is assigned a Global Security Profile, which has been added only one Operating Unit. So
    I was expecting to get id of that operating unit, but does not work.
    What API should be used in EBS 12 with Multi-Org, to query one or more operating units attached with the responsibility.
    Also when I run
    select * from Per_Security_Profiles on that instance, for the Global security profile in question I see in the table
    organization_id as NULL, though in the forms UI, I can see one operating unit added to this Global Security Profile.
    regards, Yora

    hey,
    If u want the header to get printed once in the main window make a table in that u will have header,main area and footer.
    IF u dont want the header to repeat put the haeder in the header section else if u want the header to repeat then put it in the main area.
    U can check the additional events such as only on first page like that to suffice your requirements.

  • Price = Sales / Volume ... FOREACH not giving desired results

    This should be easy but I am tearing my hair out... I want to use an IP formula to calculate Sales Price by Gross Sales / Sales Volume.
    We use an account model where CMROW = '000030' means Sales Volume (stored in key figure A0QTYVAR0), CMROW = '000050' means Gross Sales (stored in key figure 0AMOUNT). The formula is:
    FOREACH PLANVER.
      IF PLANVER = '#'.
         FOREACH CALYEAR.
             IF CALYEAR = '2008'.
                FOREACH SHIPTO.
                   SALES_VOL = 0.
                   GROSS_SALES = 0.
                   FOREACH CMROW.
                      FOREACH INFOPROV.
                            SALES_VOL = SALES_VOL + { A0QTYVAR0, '2008', INFOPROV, SHIPTO, '000030', '#' }.
                            GROSS_SALES = GROSS_SALES + { 0AMOUNT, '2008', INFOPROV, SHIPTO, '000050', '#'}.
                      ENDFOR.
                   ENDFOR.
                  MESSAGE I000(38) WITH 'SHIPTO = ' SHIPTO.
                  MESSAGE I000(38) WITH 'GROSS_SALES = ' GROSS_SALES 'SALES_VOL = ' SALES_VOL.
                  { 0AMOUNT, V_TARGETYEAR, 'A2APSBUP1', SHIPTO, '002000', V_PLANVER } = GROSS_SALES / SALES_VOL.
                ENDFOR.  
             ENDIF.
          ENDFOR.
       ENDIF.
    ENDFOR.
    When I run it I get output like:
    SHIPTO = 0005000053
    GROSS_SALES = 2,9 SALES_VOL = 0,0
    GROSS_SALES = 0,0 SALES_VOL = 1,8
    SHIPTO = 0005000149
    GROSS_SALES = 2,9 SALES_VOL = 0,0
    GROSS_SALES = 0,0 SALES_VOL = 2,1
    etc. and the price written to the planning cube is always zero, since variables GROSS_SALES and SALES_VOL are never non-zero at the same time.
    What am I doing wrong?!

    Hi,
    Please try this, and let me know your outputs...
    Supose the following: FTBCH {KF, 0CALYEAR, 0CMROW, 0INFOPROV, PLANVER}
    V_TARGETYEAR as input from user
    V_PLANVER as inpur from user.
    SALES_VOL = 0.
    GROSS_SALES = 0.
    FOREACH CALYEAR, CMROW, INFOPROV.
      IF CALYEAR = '2008'.
         SALES_VOL = SALES_VOL + { A0QTYVAR0, CALYEAR, '000030', 'ZIC_SOURCE', #}.
         GROSS_SALES = GROSS_SALES + { 0AMOUNT, CALYEAR, '000050', 'ZIC_SOURCE', #}.
       ENDIF.
    ENDFOR.
    MESSAGE I000(38) WITH 'GROSS_SALES = ' GROSS_SALES 'SALES_VOL = ' SALES_VOL.
    { 0AMOUNT, V_TARGETYEAR, 'A2APSBUP1', '002000', V_PLANVER } = GROSS_SALES / SALES_VOL.

  • If statement is not giving desired result..

    i want to connct a java program to sql database only if a condition is met..
    n im using if statemnt for this..
    if(condition)
    try
    Class.forName(driver);
    but this program is connecting without meeting the condition...
    what could be wrong?

    Rooty,
    Check whether you have made any typo mistake like semicolon after IF condition. This may cause problem.
    I mean,
    if(condition)*;*
    }This should be,
    if(condition)
    }Other possibility is "=" instead of "==".
    should be
    if(a==b)Thanks
    Umesh Bongale

  • Its not at all startning and not giving any kind of error msg, and i restared pc many times and uninstall and installed many times, but still its not opening

    .its not at all startning and not giving any kind of error msg, and i restared pc many times and uninstall and installed many times, but still its not opening

    Also, if you downloaded earlier in the week, make sure you have the 37.0.1 updated that was released on Friday (I think).
    If needed, I suggest installing a slightly different way the next time:
    '''Clean Reinstall'''
    We use this name, but it's not about removing your settings, it's about making sure the program files are clean. As described below, this process does not disturb your existing settings. Do NOT uninstall Firefox, that's not needed.
    (1) Download a fresh installer for Firefox 37.0.1 from https://www.mozilla.org/firefox/all/ to a convenient location. (Scroll down to your preferred language.)
    (2) Exit out of Firefox (if applicable).
    (3) Rename the program folder
    ''(64-bit Windows folder names)''
    C:\Program Files (x86)\Mozilla Firefox
    to
    C:\Program Files (x86)\OldFirefox
    ''(32-bit Windows folder names)''
    C:\Program Files\Mozilla Firefox
    to
    C:\Program Files\OldFirefox
    (4) Run the installer you downloaded in #1. It should automatically connect to your existing settings.
    Any difference?
    Note: Some plugins may exist only in that OldFirefox folder. If something essential is missing, look in these folders:
    * \OldFirefox\Plugins
    * \OldFirefox\browser\plugins

  • HT5312 Forgot answers to security ?s and not giving me optin for rescue email what do I do

    Forgot answers to security ?s and not giving me optin for rescue email what do I do?

    Didn't the link to contact the iTunes Store staff in the 'Additional Information' section of that article work for you? If you don't already have a valid rescue email address, only Apple itself can assist with recovering lost answers.
    (88524)

  • Query getting Hung Up and Application giving me TimeOut exception

    Hello Guys,
    I have an ASP.NET MVC5 application using database SQL Server 2013.
    I have stored procedure with multiple steps.
    I am facing a strange problem where in when I run a stored procedure that has multiple steps one of the query from the stored procedure hungs up in between the process and my application gives me a Timeout Exception.
    When I run the query in a New Query window in MSSQL it just takes 3 seconds to run and gives me desired results.
    IMPORTANT : The table from which I am running select statement is having 3 million records, it has additional 2 Inner Joins with both tables having additional 1 million records
    In the procedure at a specific step I am trying to count the number of records that have a specific Product as follows:-
    SELECT COUNT(sp.ProductId) AS NumberOfProducts
    FROM SoldProducts AS sp
    INNER JOIN Products AS p ON p.ProductId = sp.ProductId
    INNER JOIN ProductTypes AS pt ON pt.ProductTypeId = p.ProductTypeId
    WHERE (pt.ProductCode = @ProductCode) AND (sp.ProductSoldTimeStamp >= @StartDate) AND (sp.ProductSoldTimeStamp <= @EndDate)
    Query doesn't move forward from this step.
    Thanks in adavance.

    I am facing a strange problem where in when I run a stored procedure that has multiple steps one of the query from the stored procedure hungs up in between the process and my application gives me a Timeout Exception.
    When I run the query in a New Query window in MSSQL it just takes 3 seconds to run and gives me desired results.
    Slow in the Application, Fast in SSMS?
    José Diz     Belo Horizonte, MG - Brasil

  • Simple Query working on 10G and not working on 11gR2 after upgrade

    Hi Folks,
    This is the first time i am posting the query in this Blog.
    I have a small issue which preventing the UAT Sigoff.
    Simple query working fine on 10.2.0.1 and after upgrade to 11.2.0.1 its error out
    10.2.0.4:
    =====
    SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
    COUNT(*)
    1
    SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001;
    COUNT(*)
    1
    SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
    ATTRIBUTE1
    00001
    11.2.0.1:
    =====
    SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1
    ERROR at line 1:
    ORA-01722: invalid number
    SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001
    ERROR at line 1:
    ORA-01722: invalid number
    SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='1';
    no rows selected
    SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
    COUNT(*)
    1
    SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
    ATTRIBUTE1
    00001
    ++++++++++++++++++++++++++++++++++++++++++++++
    SQL > desc APPS.HZ_PARTIES
    Name Type
    ======== ======
    ATTRIBUTE1 VARCHAR2(150)
    ++++++++++++++++++++++++++++++++++++++++++++++
    Changes:
    Recently i upgraded the DB from 10.2.0.4 to 11.2.0.1
    Query:
    1.If the type of that row is VARCHAR,why it is working in 10.2.0.4 and why not working in 11.2.0.1
    2.after upgrade i analyzed the table with "analyze table " query for all AP,AR,GL,HR,BEN,APPS Schemas--Is it got impact if we run analyze table.
    Please provide me the answer for above two questions or refer the document is also well enough to understand.Based on the Answer client will sigoff to-day.
    Thanks,
    P Kumar

    WhiteHat wrote:
    the issue has already been identified: in oracle versions prior to 11, there was an implicit conversion of numbers to characters. your database has a character field which you are attempting to compare to a number.
    i.e. the string '000001' is not in any way equivalent to the number 1. but Oracle 10 converts '000001' to a number because you are asking it to compare to the number you have provided.
    version 11 doesn't do this anymore (and rightly so).
    the issue is with the bad code design. you can either: use characters in the predicate (where field = 'parameter') or you can do a conversion of the field prior to comparing (where to_num(field) = parameter).
    I would suggest that you should fix your code and don't assume that '000001' = 1I don't think that the above is completely correct, and a simple demonstration will show why. First, a simple table on Oracle Database 10.2.0.4:
    CREATE TABLE T1(C1 VARCHAR2(20));
    INSERT INTO T1 VALUES ('1');
    INSERT INTO T1 VALUES ('0001');
    COMMIT;A select from the above table, relying on implicit data type conversion:
    SELECT
    FROM
      T1
    WHERE
      C1=1;
    C1
    1
    0001Technically, the second row should not have been returned as an exact match. Why was it returned, let's take a look at the actual execution plan:
    SELECT
    FROM
      TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    SQL_ID  g6gvbpsgj1dvf, child number 0
    SELECT   * FROM   T1 WHERE   C1=1
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |       |       |     2 (100)|          |
    |*  1 |  TABLE ACCESS FULL| T1   |     2 |    24 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(TO_NUMBER("C1")=1)
    Note
       - dynamic sampling used for this statementNotice that the VARCHAR2 column was converted to a NUMBER, so if there was any data in that column that could not be converted to a number (or NULL), we should receive an error (unless the bad rows are already removed due to another predicate in the WHERE clause). For example:
    INSERT INTO T1 VALUES ('.0001.');
    SELECT
    FROM
      T1
    WHERE
      C1=1;
    SQL> SELECT
      2    *
      3  FROM
      4    T1
      5  WHERE
      6    C1=1;
    ERROR:
    ORA-01722: invalid numberNow the same test on Oracle Database 11.1.0.7:
    CREATE TABLE T1(C1 VARCHAR2(20));
    INSERT INTO T1 VALUES ('1');
    INSERT INTO T1 VALUES ('0001');
    COMMIT;
    SELECT
    FROM
      T1
    WHERE
      C1=1;
    C1
    1
    0001
    SELECT
    FROM
      TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    SQL_ID  g6gvbpsgj1dvf, child number 0
    SELECT   * FROM   T1 WHERE   C1=1
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |       |       |     2 (100)|          |
    |*  1 |  TABLE ACCESS FULL| T1   |     2 |    24 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(TO_NUMBER("C1")=1)
    Note
       - dynamic sampling used for this statement
    INSERT INTO T1 VALUES ('.0001.');
    SELECT
    FROM
      T1
    WHERE
      C1=1;
    SQL> SELECT
      2    *
      3  FROM
      4    T1
      5  WHERE
      6    C1=1;
    ERROR:
    ORA-01722: invalid numberAs you can see, exactly the same actual execution plan, and the same end result.
    The OP needs to determine if non-numeric data now exists in the column. Was the database characterset possibly changed during/after the upgrade?
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • How to get EXTMUX to pulse only when taking samples, and not on LocalMUX Change? (E Series Board)

    I am using the 6031E series board. The EXTMUX is setup to pulse on each convert pulse. While taking data, I am getting a pulse on the EXTMUX for each sample taken, and a pulse for each time the 6031E switches its own internal mux. Is there anyway to only have the EXTMUX line pulse ONLY when a sample is taken, and not when the internal mux switches?

    If you are reading the DAQ-STC manual, the signal I am talking about is the EXTMUX. If you are reading the PCI E Series manuals, the signal I am talking about is called SCANCLK (just to make things easier to understand, I guess??). The EXTMUX is setup through the MITE, and will pulse after every convert signal. My problem is that it also pulses when the internal mux changes as well.
    So (for simplicity), if I wanted 2 channels, with 5 samples on each channel, and a mux outside the card on each line, the EXTMUX signal would sync the external hardware with the card/software.
    In theory I would expect 10 pulses on the EXTMUX/SCANCLK pin, but in reality I get 12 pulses. If I had 3 channels, 5 samples per channel, (Expected 15 pulses) I end up getting 18 pu
    lses in reality. This throws off any kind of sync to the outside world.

  • Goto link query is not giving exact results

    Hi Folks
    I am having issue with GOTO query.
    My main query gives details of Employee seperation in particular year.
    For this query i have goto query.
    When i am checking the details of goto query ,it is giving incorrect results.
    Your help is appreciated.
    Thanks & Regards,
    Hari Reddy

    Hi Hari,
        Check in RSBBS, whether you specified the receiver query correctly...
    Check the link:
    [http://help.sap.com/saphelp_nw04/helpdata/en/99/08629bd3e41d418530c6849df303c9/content.htm]
        Hope this helps you.
    Regards,
    Yokesh.

  • Query not showing desired result

    Hi All,
    DB :-10.2.0.3
    I am using following query to extarct the backuppice, which falls between the dates specified by query. I am really amazed, why it's not giving me the expected results.
    select handle, to_char(start_time, 'dd-mon-yy hh24:mi:ss') "start_time" , to_char(completion_time, ' dd-mon-yy hh24:mi:ss') "end_time" from
    v$backup_piece where
    to_char(start_time,'dd-mon-yy hh24:mi:ss') >'27-oct-10 23:00:00'
    and
    to_char(completion_time,'dd-mon-yy hh24:mi:ss')<'28-oct-10 04:20:53'
    Results truncated, just to fit in this window.
    23:02:25
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0c                         27-sep-10 23:02:39           27-sep-10
    23:02:40
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_ctl_l1_t730854174_s32554_p1.rmn        27-sep-10 23:02:58           27-sep-10
    23:02:59
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0d                         27-sep-10 23:03:02           27-sep-10
    23:03:02
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_arc_l1_t730854220_s32556_p1.rmn        27-sep-10 23:03:41           27-sep-10
    23:03:44
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0e                         27-sep-10 23:03:51           27-sep-10
    23:03:51
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733532449_s33531_p1.rmn        27-oct-10 23:00:50           27-oct-10
    23:36:00
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733534566_s33532_p1.rmn        27-oct-10 23:36:07           27-oct-10
    23:48:38
    HANDLE                                                                                start_time                  end_time
    /data/oracle/LNEVRPP1/backup/arc2adsm/LNEVRPP1_arc_l0_t733536053_s33534_p1.rmn        28-oct-10 00:00:54           28-oct-10
    00:01:13
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-00                         28-oct-10 00:01:22           28-oct-10
    00:01:23
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733535322_s33533_p1.rmn        27-oct-10 23:48:43           28-oct-10
    00:20:06
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733537209_s33536_p1.rmn        28-oct-10 00:20:10           28-oct-10
    00:33:44
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-01                         28-oct-10 00:33:47           28-oct-10
    00:33:48
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_ctl_l0_t733538041_s33538_p1.rmn        28-oct-10 00:34:04           28-oct-10
    00:34:04
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-02                         28-oct-10 00:34:06           28-oct-10
    00:34:07

    Hi
    Try:
    select handle, to_char(start_time, 'dd-mon-yy hh24:mi:ss') "start_time" , to_char(completion_time, ' dd-mon-yy hh24:mi:ss') "end_time"
    from v$backup_piece
    where start_time > to_date ('27-oct-10 23:00:00','dd-mon-yy hh24:mi:ss')
    and completion_time < to_date ('28-oct-10 23:00:00','dd-mon-yy hh24:mi:ss')
    Regards,
    Tycho

  • % Change is not giving correct results.

    Hi,
    I am using Ago Function to calculate Current month cx count , previous month cx count, present month acct count, previous month acct count and in the report parameter selecting Reporting Month as DEC 09. The results are coming perfectly fine... but when I create % Change Previous Month Cx count and % change Previous month Account count, It is not showing the correct results and getting only 0% listed even if the Difference is huge and should be around 10% ...
    The code written to calculate % change is :
    CASE WHEN ("EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" = 0) AND NOT "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL AND "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" <> 0 THEN 100.0 WHEN ("EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" = 0) AND ("EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" = 0) THEN 0.0 WHEN "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL AND NOT "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL AND "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" <> 0 THEN -(100.0) ELSE 100.0 * ("EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" - "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count") / "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" END
    Can some one tell me what I need to do in order to get the desired results.
    I am using a time dimension with the following hierarchy ( Year - Month - Period_ID) joined with the Reporting Table Fact which has count of cx and Count of Accts.

    We have two assets one acquired on 01/04/2014 and another on 26/04/2014.  Everything else is same for both assets like asset class , keys etc.
    Now here are two calculations.
    System is giving calculation ok , what should we do so that for both assets we are left with same scrap value (1047)  (and not 1119.68 as in last line )
    Can anyone help how to get value in last field of screen shot given below asset vale date or it is always blank.
    wanted to add something in our case DEP to the DAY is also ticked in dep key.
    regards
    Sanjeev Mehndiratta

  • The dashboard propmt not showing desired results

    Hi,
    I have propmt created using this condition.But it is not showing me the desired results.The code seems to be correct.any help plz...
    case when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 0 and 30 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL2,CURRENT_DATE) between 0 and 30 then '30 days'
    when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 31 and 60 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL2,CURRENT_DATE) between 31 and 60 then ' last 60 days'
    when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 61 and 90 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 61 and 90 then 'last 90 days'
    else '> 90 and max 100 Days' end

    Hi,
    Create a dummy column for the below code
    case when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 0 and 30 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL2,CURRENT_DATE) between 0 and 30 then '30 days'
    when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 31 and 60 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL2,CURRENT_DATE) between 31 and 60 then ' last 60 days'
    when TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 61 and 90 or TimeStampDiff(SQL_TSI_DAY,"TB1".CL1,CURRENT_DATE) between 61 and 90 then 'last 90 days'
    else '> 90 and max 100 Days' endfilter it as is prompted for that column after giving filter as is prompted you can hide that column or remove it.
    Save the report
    Assign points and close thread, if your question is answered....
    Cheers,
    Aravind

Maybe you are looking for