A view, function and TO_DATE causing an error.

I have the following statement which calls a view, VW_DIST_RPT_WORK_LIST which in turn calls a function which returns either 'Null' or a date string e.g. '07 Oct 2003' as a VARCHAR2 (alias PROJECTED_DELIVERY_DATE).
Statement:
SELECT CUSTOMER_NAME, PROTOCOL_REFERENCE, SHIPPING_REFERENCE, CUSTOMER_REFERENCE, COUNTRY, PROJECTED_DELIVERY_DATE, STATUS, NOTES,
TO_DATE(PROJECTED_DELIVERY_DATE)
FROM VW_DIST_RPT_WORK_LIST
WHERE EXPECTED_DESP_DT IS NOT NULL
AND UPPER(PROJECTED_DELIVERY_DATE) NOT LIKE('NULL%')
AND EXPECTED_DESP_DT <= TO_DATE('07/10/2003', 'DD/MM/YYYY')
AND TO_DATE(PROJECTED_DELIVERY_DATE) <= TO_DATE('31/12/2003', 'DD/MM/YYYY') --< Problem here
I need to be able to specify a date filter on the PROJECTED_DELIVERY_DATE field and hence used the TO_DATE(PROJECTED_DELIVERY_DATE) <= TO_DATE('31/12/2003', 'DD/MM/YYYY') but this is generating an ORA-01858: a non-numeric character was found where a numeric character was expected.
I think the problem lies with the fact that this field can contain 'Null' which cannot be converted to a date using TO_DATE. I've tried adding a NOT LIKE ('NULL%') statement to catch any nulls which may be creeping in bu this doesn't solve the problem.
I've added TO_DATE(PROJECTED_DELIVERY_DATE) to the select above to determine if the nulls are being caught and if the TO_DATE in performing the conversion correctly which it is on both counts.
Any ideas anyone ?

The answer provided above by Monika will work for this situation. However, you should seriously think whether you should be using a string for date datatype. Ideally, you should rewrite the function that returns PROJECTED_DELIVERY_DATE and change the return type to DATE. The least you should do is to return NULL (instead of the string 'NULL') from the function. Oracle handles nulls perfectly, there is no reason you should write code to handle nulls;
One more thing. Looking at the type of error you are receiving, it seems that you are using rule based optimizer. Why do I think so? Because, in rule based optimizer, the conditions are evaluated in a specific order (viz, bottoms-up for AND clauses). To show this, look at the following simple demonstration. I did this in Oracle 8.1.6 (also in 9.2.0.4.0 on Windows).
-- Check the database version
select * from v$version;
BANNER
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
PL/SQL Release 8.1.6.1.0 - Production
CORE 8.1.6.0.0 Production
TNS for Solaris: Version 8.1.6.0.0 - Production
NLSRTL Version 3.4.0.0.0 - Production
-- Create the test table
create table test (a number(2));
insert into test(a) values (0);
insert into test(a) values (1);
insert into test(a) values (2);
insert into test(a) values (3);
insert into test(a) values (4);
insert into test(a) values (5);
insert into test(a) values (6);
insert into test(a) values (7);
commit;
-- See that I have not analyzed the table. This will make use of RULE based optimizer
select * from test
where a > 0
and 1/a < .25;
and 1/a < .25
ERROR at line 3:
ORA-01476: divisor is equal to zero
-- Look at the query clause. Even though I specifically asked for records where a is positive
-- the evaluation path of rule based optimizer started at the bottom and as it evaluated the
-- first row with a=0, and caused an error.
-- Now look at the query below. I just re-arranged the conditions so that a > 0 is evaluated
-- first. As a result, the row with a=0 is ignored and the query executes without any problem.
select * from test
where 1/a < .25
and a > 0;
A
5
6
7
-- Now I analyze the table to create statistics. This will make the query use the
-- cost based optimizer (since optimizer goal is set to CHOOSE)
analyze table test compute statistics;
Table analyzed.
-- Now I issue the erring query. See it executes without any problem. This indicates that
-- the cost based optimizer was intelligent enough to evaluate the proper path instead of
-- looking only at the syntax.
select * from test
where a > 0
and 1/a < .25;
A
5
6
7
Does the above example seem familiar to your case? Even though you had the AND UPPER(PROJECTED_DELIVERY_DATE) NOT LIKE('NULL%') in your query, a record with PROJECTED_DELIVERY_DATE = 'NULL' was evaluated first and that caused the error.
Summary
1. Use dates for dates and strings for strings
2. Use cost based optimizer
Thanks
Suman

Similar Messages

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • PLSQL and to_date query returning error...

    I'm sure this has something to do with a conversion which I'm not understanding however :
    Metric_date field is a DATE type field in the database.
    DECLARE
    disknum NUMBER;
    diskcost NUMBER;
    fystart VARCHAR(20):='01-JUN-'||(:FINANCE_FY-1);
    fyend VARCHAR(20):='31-MAY-'||:FINANCE_FY;
    BEGIN
    select metric_value into disknum from
       (SELECT metric_value from core_metrics where metric_subname='TIER_1_DISK_NUMBER' and metric_date between to_date(fystart,'DD-MON-YYYY') and to_date(fyend,'DD-MON-YYYY')  order by metric_date DESC)
    where rownum=1;
    select metric_value into diskcost from
    (SELECT metric_value from core_metrics where metric_subname='TIER_1_COST_PER_DISK' and metric_date between to_date(fystart,'DD-MON-YYYY') and to_date(fyend,'DD-MON-YYYY') order by metric_date DESC)
    where rownum=1;
    RETURN to_char((disknum*diskcost)/5,'$999,999,999');
    END;When executed I get
    Error computing item source value for page item P17_VMAX_TIER1_DISK_COST_SUM.
    ORA-01840: input value not long enough for date format
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: WWV_FLOW_FORMS.ITEM_SOURCE_ERR
    ora_sqlcode: -1840
    ora_sqlerrm: ORA-01840: input value not long enough for date format
    component.type: APEX_APPLICATION_PAGE_ITEMS
    component.id: 14284527609957008
    component.name: P17_VMAX_TIER1_DISK_COST_SUM
    error_backtrace:
    ORA-06512: at line 8
    ORA-06512: at line 19
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 966
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 992
    ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 503
    ORA-06512: at "APEX_040100.WWV_FLOW_FORMS", line 611Edited by: bostonmacosx on Mar 28, 2013 2:42 PM

    Thanks for all the help and I'm close to getting this nailed down:
    DECLARE
    defnumber NUMBER:=0;
    disknum NUMBER;
    diskcost NUMBER;
    fystart VARCHAR(20):='01-JUN-'||(:FINANCE_FY-1);
    fyend VARCHAR(20):='31-MAY-'||:FINANCE_FY;
    BEGIN
    if :FINANCE_FY is NULL THEN
    return 'hello';
    end if;
    select metric_value into disknum from
       (SELECT metric_value from core_metrics where metric_subname='TIER_1_DISK_NUMBER' and metric_date between to_date(fystart,'DD-MON-YYYY') and to_date(fyend,'DD-MON-YYYY')  order by metric_date DESC)
    where rownum=1;
    select metric_value into diskcost from
    (SELECT metric_value from core_metrics where metric_subname='TIER_1_COST_PER_DISK' and metric_date between to_date(fystart,'DD-MON-YYYY') and to_date(fyend,'DD-MON-YYYY') order by metric_date DESC)
    where rownum=1;
    RETURN to_char((disknum*diskcost)/5,'$999,999,999');
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
        return disknum;
    END; What I am running into though is that I want to return some text if :Finance_FY is not set to let the user know what is happening. However the RETURN is not allowing me to return anything except one of my variables....in fact I can't even RETURN defnumber.
    I thought I could return a string or a number.
    The above is a function for a Page Item of type "Display Only"
    The error I get is
    Error computing item source value for page item P17_VMAX_OTHER_THAN_DISK.
    ORA-06502: PL/SQL: numeric or value error
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: WWV_FLOW_FORMS.ITEM_SOURCE_ERR
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error
    component.type: APEX_APPLICATION_PAGE_ITEMS
    component.id: 14298319812267057
    component.name: P17_VMAX_OTHER_THAN_DISK
    error_backtrace:
    ORA-06512: at line 3
    ORA-06512: at line 7
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 966
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 992
    ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 503
    ORA-06512: at "APEX_040100.WWV_FLOW_FORMS", line 611

  • I am trying to edit my website using the copy and paste function and am getting an error message that says my browser will not allow this function.. what do I do? thanks!

    I am trying to do a simple copy and paste function while editing my website and I am getting an error message that says that my browser will not allow this function.. how can I override this?
    thanks
    Doug Snyder

    You need to set Copy'n'Paste security policies for that domain in Firefox.
    AllowClipboard Helper will help you do that. <br />
    https://addons.mozilla.org/en-US/firefox/addon/allowclipboard-helper/

  • To_number function and the "invalid number" error

    Dear all,
    I have searched the forum for threads relating to the ORA-01722: invalid number error, could not find the answer I am looking for.
    What I was trying to do was
    select * from table1 where to_number(field1) > 1000
    field1 is a varchar2 data type.
    I tried all sorts of things i.e using fmt, nls params as defined in the documentation, nothing worked.
    Though the practical problem was solved by
    select * from table1 where field1 > '1000'
    I would still like to know why this error occurs. Can someone help ?
    Regards
    Crusoe

    I think the database engine should simply return the rows that successfully convert to number and meet the where condition Oracle does not work in that way ;)
    Then try this...
    Just you need to add the below where clause to your source query. as this will retrieve only the number, to_number should work without any problem.
    But still you have to create a subquery to escape the invalid number error.
    PRAZY@11gR1> select * from tablea;
    FIELD1
    123
    123.345
    45
    AVC
    23.234.234
    ABC.234
    345.45
    7 rows selected.
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select to_number(field1) from tablea where  rtrim(trim(regexp_replace(field1,'\.','',1,1)),'0123456789') is null;
    TO_NUMBER(FIELD1)
                  123
              123.345
                   45
               345.45
    4 rows selected.
    Elapsed: 00:00:00.01Regards,
    Prazy
    Edited by: Prazy on Mar 23, 2010 4:00 PM

  • Trying to find unused tables by views,function, and proc?

    I come up with lists of unused table through given script
    SELECT
    SCHEMA_NAME(t.schema_id)
    as SchemaName,
    t.name as
    TableName
    FROM   sys.tables
    t
    WHERE  is_ms_shipped
    = 0
    AND NOT
    EXISTS (SELECT
    FROM   sys.sql_expression_dependencies
    d
    WHERE  d.referenced_entity_name
    = t.name
    AND ((
    is_ambiguous = 1
    or is_caller_dependent=1)
    OR
    d.referenced_id
    = t.object_id) 
    result:
    dbo temp_bandfix
    dbo ClientParty_AXClient_back
    dbo EmployeeParty_AXEmployee_back
    dbo CUSTTABLE
    dbo sysdiagrams
    dbo ConcurClientList
    I have list of procs, Vws, and FN in DB
    I am thinking to add sub query on the above script and see dependency on procs, views and FN to make sure those tables are not used at all  in database before dropping them.
    Looking for help on this issue???

    Use SQL Server Profiler to run a trace on your database. You can let it run for a week or longer if you'd like to. Then once it is done you can upload the results to an SQL table. Then you can use a join to the query you have above to see if there are any
    tables not being accessed. This is probably the best method for determining if a table is unused, as the Profiler will log events anytime someone runs a transaction against a table.
    Jordan Johnson

  • Causing Runtime error

    Hi,
    I am getting the Following runtime error, can u please tell me the cause for this.
    What happened?                                                                                |
    The exception 'CX_WD_CONTEXT' was raised, but it was not caught anywhere along
    the call hierarchy.
    Since exceptions represent error situations and this error was not
    adequately responded to, the running ABAP program
    'CL_WDR_CONTEXT_ELEMENT========CP' has to be
    terminated.
    What can you do?
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_WD_CONTEXT', was not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Element Is Not (or No Longer) Bound to a Node
    Error analysis                                                                                |
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_WD_CONTEXT', was not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Element Is Not (or No Longer) Bound to a Node
    How to correct the error
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "UNCAUGHT_EXCEPTION" "CX_WD_CONTEXT"
    "CL_WDR_CONTEXT_ELEMENT========CP" or "CL_WDR_CONTEXT_ELEMENT========CM00I"
    "IF_WD_CONTEXT_ELEMENT~GET_INDEX"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.           
    Information on where terminated
    Termination occurred in the ABAP program "CL_WDR_CONTEXT_ELEMENT========CP" -
    in "IF_WD_CONTEXT_ELEMENT~GET_INDEX".
    The main program was "SAPMHTTP ".
    In the source code you have the termination point in line 4
    of the (Include) program "CL_WDR_CONTEXT_ELEMENT========CM00I".
    Source Code Extract
    Line
    SourceCde
    1
    method if_wd_context_element~get_index .
    2
    3
    if me->node is not bound.
    >>>>>
    raise exception type cx_wd_context exporting textid = cx_wd_context=>element_not_bound.
    5
    endif.
    6
    7
    read table node->collection with key table_line = me transporting no fields.
    8
    assert sy-subrc = 0.
    9
    my_index = sy-tabix.
    |   10|endmethod.                      
    Thanks In advance.
    Mary

    Hi Mary
    It is clearly saying the elements are not bound to the node and you are trying to access the node..
    i.e. you have not binded internal table to the node.
    Abhi

  • UPPER Indexes cause select ERROR!

    I downloaded Oracle 10g and installed it on a windows 2003 server. When I created UPPER indexes on a table, and the table has many rows, SELECT statement failed.
    for example:
    DROP TABLE TestTab;
    CREATE     TABLE     TestTab(
         id          NUMBER(9)     DEFAULT 1 NULL,
         name          VARCHAR2(32)     NULL,
         address          VARCHAR2(64)     NULL,
         PRIMARY     KEY     (id)
    DROP INDEX TestTab_01;
    CREATE     INDEX     TestTab_01 ON TestTab(UPPER(name));
    DROP INDEX TestTab_02;
    CREATE     INDEX     TestTab_02 ON TestTab(UPPER(address));
    create or replace procedure ADDDATA
    IS
    lCount     NUMBER;
    BEGIN
    lCount := 1;
    LOOP
    INSERT INTO TESTTAB VALUES(lCount, TO_CHAR(lCount, '00000'), TO_CHAR(lCount, '00000'));
    lCount := lCount + 1;
    IF lCount >= 80000 THEN
    EXIT;
    END IF;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    RAISE;
    END;
    EXEC ADDDATA;
    SELECT COUNT(*) FROM TestTab;
    SELECT id FROM TestTab WHERE (UPPER(name) = ' 00100' OR UPPER(name) = ' 00101' OR UPPER(name) = ' 00102'
    OR UPPER(address) = ' 00105' OR UPPER(address) = ' 00106') ORDER BY id;
    ID
    100
    101
    102
    SELECT id FROM TestTab WHERE (UPPER(address) = ' 00105' OR UPPER(address) = ' 00106' OR UPPER(name) = ' 00100' OR UPPER(name) = ' 00101' OR UPPER(name) = ' 00102') ORDER BY id;
    ID
    105
    106
    It looks like that the first index could be used and the second index couldn't be used and indexes caused select errors.

    indexes caused select errors. Which errors ? I did exactly what you posted, and these are the results :
    TEST@db102 SQL> SELECT id FROM TestTab WHERE (UPPER(name) = ' 00100' OR UPPER(name) = ' 00101' OR UPPER(name) = ' 00102'
    OR UPPER(address) = ' 00105' OR UPPER(address) = ' 00106') ORDER BY id;  2
                 ID
                100
                101
                102
                105
                106
    TEST@db102 SQL> SELECT id FROM TestTab WHERE (UPPER(address) = ' 00105' OR UPPER(address) = ' 00106' OR UPPER(name) = ' 00100'
    OR UPPER(name) = ' 00101' OR UPPER(name) = ' 00102') ORDER BY id;
                 ID
                100
                101
                102
                105
                106
    TEST@db102 SQL> select count(*) from testtab;
           COUNT(*)
              79999
    TEST@db102 SQL>                                                                                    

  • Bad performance due to the use of AGO and TO_DATE time series functions

    Hi all,
    I'm building an OBI EE Project on top of a 1TB DW, and i'm facing major performance problems due to the use of the AGO and TO_DATE time series functions in some of the Metrics included on the reports. I discovered that when a report with one of those metrics is submited to the DB, the resulting query/explain plan is just awful!... Apparently OBI EE is asking the DB to send everything it needs to do the calculations itself. The CPU cost goes to the roof!
    I've tried new indexes, updated statistics, MV's, but the result remains the same, i.e., if you happen to use AGO or TO_DATE in the report you'll get lousy query time...
    Please advise, if you have come across the same problem.
    Thanks in advance.

    Nico,
    Combining the solution to view the data in dense form (http://gerardnico.com/wiki/dat/obiee/bi_server/design/obiee_densification_design_preservation_dimension), and the use of the lag function (http://gerardnico.com/wiki/dat/obiee/presentation_service/obiee_period_to_period_lag_lead_function) appears to be the best solution for us.
    Thanks very much.

  • Error While uploading the Function and Function_BP

    Hello,
    I am getting the following error while uploading the Functions and Funtions_BP using the Rule Upload functions.
    com.virsa.cc.comp.Function_upload.onActionUploadFunc(Function_upload.java:302) com.virsa.cc.comp.wdp.InternalFunction_upload.wdInvokeEventHandler(InternalFunction_upload.java:150) com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321) com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713) com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666) com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250) com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) javax.servlet.http.HttpServlet.service(HttpServlet.java:760) javax.servlet.http.HttpServlet.service(HttpServlet.java:853) com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) java.security.AccessController.doPrivileged(Native Method) com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    The files which i am uploading the file from the Best practises only.
    What is the reason for this error?
    Did any one get this error?
    Regards,
    Kumar Rayudu
    Edited by: Kumar Rayudu on Aug 4, 2009 12:32 PM

    Hello Kumar,
    Have you uploaded the SAP text and object files? Upload them first and then try to upload functions.
    Harleen
    SAP GRC RIG

  • TS1424 everytime i try to download an app from itunes, or to 'view all' the apps listed, the error says; 'We could not complete your iTunes Store reuest. The network connection was reset' I used both my desktop and laptop both on Windows 7 Pro, & net is f

    everytime i try to download an app from itunes, or to 'view all' the apps listed, the error says; 'We could not complete your iTunes Store reuest. The network connection was reset' I used both my desktop and laptop both on Windows 7 Pro, & net is fine. please help. is there soemthing wrong with apple store temporarily?

    The latest message is: 'We could not complete your iTunes Store request. The network connection was reset.'
    In between, I got a messge about verifying my payment method. When I tried to submit the details, I kept getting a mmessage stating that my payment method was declined (my card is not near it's expiration date, and works fine).
    Argh!

  • Create sequence, function and view all at once -script or something similar

    Hi I would like to know in what way can I write a script or something like that which would define names for a sequence, function and a view in the beginning (for example TEST_SEQ, TEST_FJ, TEST_VIEW...) and after that create this sequence, function and view with definitions like
    CREATE SEQUENCE  TEST_SEQ
    MINVALUE 1 MAXVALUE 999999999999999999999999999
    INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE;
    create or replace FUNCTION TEST_FJ RETURN NUMBER AS
    tmp number;
    BEGIN
    select TEST_SEQ.NEXTVAL  into tmp from dual
    RETURN tmp;
    END TEST_FJ;
    and so on...
    In the end I would also like to grant some rights on these objects I just created:
    grant select on TEST_SEQ to public;
    grant execute on TEST_FJ to public;
    So my question is how to package all these things together so I can execute them from a single file in SQL Developer, and if i need to change the names of these tables I want do it in one place in the beginning of this script (or something like a script, I'm not sure what)...
    Thanks in advance!

    hi,
    hope help you...
    this is my basic generic solution...
    create or replace procedure createSequence( psequenceName in varchar2 ) is
    begin
    execute immediate 'create sequence ' || psequenceName ;
    execute immediate 'grant select on ' || psequenceName || ' to public ';
    end ;
    create or replace function getNextVal( psequenceName in varchar2 ) return number is
    queryText varchar2(100) := 'select <sequence_name>.nextval into :next_value from DUAL' ;
    next_value number ;
    begin
    queryText := replace(queryText,'<sequence_name>',psequenceName);
    execute immediate queryText into next_value ;
    return( next_value ) ;
    end ;
    Edited by: edogt on Nov 27, 2008 5:33 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM

  • Error with view link and ADF table Tree

    Hello
    ( Note: View objects are created based on static data but not from database tables)
    I created two view objects "SuiteViewObject" and "FamilyViewObject" which are based on static data( stored in collection) but not on database entity. A veiw link "SuiteFamilyViewLink" is created from the above two view objects. An ADFTreeTable is created from the above view objects and view link. When run the jspx page containing ADFTreeTable, following error is occured in the browser.
    JBO-30003: The application pool (staticviewobjects.staticappLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26016: Cannot set user query to view "FamilyViewObj2" because it is a destination in a view link
    Any help on the above error message.?
    Thanks in Advance
    Kristi
    Bangalore
    Message was edited by:
    user576892

    Hello
    The above error is coming becuase view link's SQL query expects tables. But in my case I dont have tables, view objects are created from static data source(collection).
    How to create a view link from view objects which are created based on static data source(collection)?

  • Apex 4.1 Custom error function and page rendering

    Hi
    I have setup a demo application at http://apex.oracle.com/pls/apex/f?p=19820:1 which is a simple testing application for testing of the apex_error_handling_example function Patrick wolf put into Oracle documentation. I have setup a error on the page rendering of page 2 in the application. The error process contain this simple error code declare
    v_id number;
    begin
    select 'x' as one into v_id from dual;
    end;
    which generate plsql numeric or value error. The process is running before regions on page rendering on page 2. I have also created the same error process on page processing before DML processing on the page. When i insert apex_error_handling_example into the application level and run the application the error is not caught and the page is rendered as nothing was wrong. When the page is submitted the error function is executed and work correct.
    When i remove the error function from the application the error is caught and displayed on the APEX error page with the detail link for drill down to show more about the error.
    Any which can tell what is wrong with the setup i have done. The error function apex_error_handling_example setup is simply a copy/paste from the documentation with some few debug message put into a logging table.
    kindest regards
    jon

    Hi
    Yes, when you submit the page the page processing is displaying the error message inline, but it does not show the same error on page rendering for page 2, if i remove the custom error function it will show the error on APEX separate error page. The debug output from the page 1 is as following:
    0.12084     0.00345     ...metadata, fetch items     4     
    5
         0.12431     0.00146     Show page template header     4     
    2
         0.12576     0.00152     Rendering form open tag and internal values     4     
    2
         0.12728     0.00034     Computation point: After Header     4     
    1
         0.12767     0.00040     Processes - point: AFTER_HEADER     4     
    1
         0.12801     0.00508     ...Process "Fetch Row from DEMO_CUSTOMERS" - Type: DML_FETCH_ROW     4     
    8
         0.13312     0.00242     ...Execute Statement: begin begin select ROWID,"CUSTOMER_ID","CUST_FIRST_NAME","CUST_LAST_NAME","CUST_STREET_ADDRESS1","CUST_STREET_ADDRESS2","CUST_CITY","CUST_STATE","CUST_POSTAL_CODE","PHONE_NUMBER1","PHONE_NUMBER2","CREDIT_LIMIT","CUST_EMAIL" into wwv_flow.g_column_values(1),wwv_flow.g_column_values(2),wwv_flow.g_column_values(3),wwv_flow.g_column_values(4),wwv_flow.g_column_values(5),wwv_flow.g_column_values(6),wwv_flow.g_column_values(7),wwv_flow.g_column_values(8),wwv_flow.g_column_values(9),wwv_flow.g_column_values(10),wwv_flow.g_column_values(11),wwv_flow.g_column_values(12),wwv_flow.g_column_values(13) from "OLE1923"."DEMO_CUSTOMERS" where "ROWID" = :p_rowid; end; end;     4     
    4
         0.13552     0.00038     Computation point: Before Box Body     4     
    1
         0.13590     0.00032     Processes - point: BEFORE_BOX_BODY     4     
    0
         0.13621     0.00051     ...Process "gen error" - Type: PLSQL     4     
    1
         0.13672     0.00142     ...Execute Statement: begin declare v_id number; begin select 'x' as one into v_id from dual; end; end;     4     
    2
         0.13814     0.00052     Add error onto error stack     4     
    1
         0.13866     0.00048     ...Error data:     4     
    1
         0.13914     0.00048     ......message: ORA-06502: PL/SQL: numeric or value error: character to number conversion error     4     
    1
         0.13962     0.00049     ......additional_info: ORA-06502: PL/SQL: numeric or value error: character to number conversion error     4     
    1
         0.14011     0.00048     ......display_location: ON_ERROR_PAGE     4     
    1
         0.14059     0.00047     ......is_internal_error: false     4     
    1
         0.14106     0.00073     ......ora_sqlcode: -6502     4     
    1
         0.14179     0.00048     ......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error     4     
    1
         0.14227     0.00049     ......error_backtrace: ORA-06512: at line 6 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 966 ORA-06512: at "SYS.WWV_DBMS_SQL", line 992 ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 649 ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 129      4     
    1
         0.14276     0.00050     ......component.type: APEX_APPLICATION_PAGE_PROCESS     4     
    1
         0.14326     0.00079     ......component.id: 64815543714133426115     4     
    1
         0.14405     0.00058     ......component.name: gen error     4     
    1
         0.14463     0.00067     ...Execute Error Handling Callout defined on Page or Application Level     4     
    1
         0.14530     0.00184     ...Execute Statement: begin declare l_error wwv_flow_error.t_error; begin l_error := wwv_flow_error.g_error; wwv_flow_error.g_error_result := apex_error_handling_example ( p_error => l_error ); end; end;     4     
    3
         0.14714     0.00055     ......Values changed by callout:     4     
    1
         0.14769     0.00049     .........message: MY.....MY ERROR PL/SQL: numeric or value error: character to number conversion error     4     
    1
         0.14818     0.00065     .........display_location: INLINE_IN_NOTIFICATION     4     
    1
         0.14883     0.00331     Region: Form on DEMO_CUSTOMERS     4     
    5
         0.15214     0.00174     Item: P2_ROWID NATIVE_HIDDEN     4     
    3
         0.15388     0.00090     Item: P2_CUSTOMER_ID NATIVE_NUMBER_FIELD
    The debug output show that the custom error function is running and changing the display location from ON_ERROR_PAGE to INLINE_IN_NOTIFICATION, but there is something going wrong in this processing.
    jon

  • RenderToTexture with RectangleTexture causes Runtime Error and presents black screen

    Problem Description:
    Please see RTTtest.as first(https://bugbase.adobe.com/index.cfm?event=bug&id=3776210), run time error occurs on iOS devices ( I have test two devices: iPad2 and iPhone 5 )
    Error: Error #3604: Sampler 0 binds a texture that is also bound for render to texture.
    at flash.display3D::Context3D/drawTriangles()
    at RTTtest/RenderTT()[C:\RTTtest\src\RTTtest.as:274]
    at RTTtest/_OnEnterFrame()[C:\RTTtest\src\RTTtest.as:243]
    Lines between 159~189 present some of my testing results, some are correct and the others are incorrect.
    In addition, I also have test "On AIR Simulator" and nexus 7 2013, the error does not produces.
    Steps to Reproduce:
    1. directly executes the RTTtest.as on iPhone 5.
    will see the error ( on debug mode )
    2. Commenting line:169-170, and un-comment line:172-178 does not produce error.
    Actual Result:
    if ignoring the error, the render texture presents black, therefore the screen presents black.
    Expected Result:
    The testing program draws two triangles, the one is blue, and the other is red.
    Test Configuration
    My Hardware and Environment details:
    Build environment:
    Intel Core i7 CPU 930, 8.0 GB RAM, FlashBuilder 4.7, Windows 7 64-bits
    Testing device environment
    iPhone 5, iOS version 7.1.1 (11D201)

    Please provide us with your Event Viewer administrative logs by following these steps:
    Press the Win key + "R" and type eventvwr>enter
    Expand Custom Views
    Click Administrative Events
    Right click Administrative Events
    Save all Events in Custom View As...
    Save them in a folder where you will remember which folder and save as Errors.evtx
    Go to where you saved Errors.evtx
    Right click Errors.evtx -> send to -> compressed (zipped) folder
    Upload the .zip file to Onedrive or a file sharing service and put a link to it in your next post
    If you have updated to win 8.1 and you get the error message "the system cannot find the file specified" it is a known problem.  The work around is
    to edit the registry.  If you are not comfortable doing this DONT.  If you are, backup the key before you do
    Press Win+"R" and input regedit
    Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels. Delete "Microsoft-Windows-DxpTaskRingtone/Analytic"
    Wanikiya and Dyami--Team Zigzag

Maybe you are looking for