Function error:  Too many records

I have writing a function that needs to return the total count of a sql statement. It will divide two calculated columns to get an average. I have two versions. Version 1 compiled successfully and I am trying to either run it in Reports or in the database and call it. I get an error stating that the function returns too many records. I understand that is a rule for stored functions but how can I modify the code to get it return one value for each time it is called?
Here is the main calculation. SUM(date1-date2) / (date1-date2) = Avg of Days
version1:
create or replace FUNCTION CALC_OVER_AGE
RETURN NUMBER IS
days_between NUMBER;
days_over NUMBER;
begin
select (determination_dt - Filed_dt), SUM(determination_dt - Filed_dt) into days_between, days_over
from w_all_cases_mv
where (determination_dt - Filed_dt) > 60
and ;
return (days_between/days_over);
END CALC_OVER_AGE;
version2:
CREATE OR REPLACE FUNCTION CALC_OVER_AGE (pCaseType VARCHAR2)
RETURN PLS_INTEGER IS
v_days_between W_ALL_CASES_MV.DAYS_BETWEEN%TYPE;
v_total NUMBER;
days_over NUMBER;
i PLS_INTEGER;
BEGIN
SELECT COUNT(*)
INTO i
FROM tab
WHERE case_type_cd = pCaseType
AND determination_dt - Filed_dt > 60;
IF i <> 0 THEN
select SUM(determination_dt-Filed_dt), days_between
into v_total, v_days_between
from tab
where determination_dt - Filed_dt > 60;
RETURN v_total/v_days_between;
ELSE
RETURN 0;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN 0;
END CALC_OVER_AGE;

Table Structure:
WB_CASE_NR NUMBER(10)
RESPONDENT_TYPE_CD VARCHAR2(10)
INV_LOCAL_CASE_NR VARCHAR2(14)
CASE_TYPE_CD VARCHAR2(10)
FILED_DT DATE
FINAL_DTRMNTN_DT DATE
REPORTING_NR VARCHAR2(7)
INVESTIGATOR_NAME VARCHAR2(22)
OSHA_CD VARCHAR2(5)
FEDERAL_STATE VARCHAR2(1)
RESPONDENT_NM VARCHAR2(100)
DAYS_BETWEEN NUMBER
LAST_NM VARCHAR2(20)
FIRST_NM VARCHAR2(20)
DETERMINATION_DT DATE
DETERMINATION_TYPE_CD VARCHAR2(2)
FINAL_IND_CD VARCHAR2(1)
DESCRIPTION VARCHAR2(400)
DETERMINATION_ID NUMBER(10)
ALLEGATION_CD VARCHAR2(1)
ALGDESCRIPTION VARCHAR2(50)
Output is for Reports, I am trying to get the last calculation, which is the Average Days. The reports is grouped on Case Types and has several bucket counts for each like this.
Case Type Count All Completed Pending Over Age Avg Days
A 5 3 4 2 15
Z 10 7 6 3 30
4 8 3 5 4 22
To get the Avg Days, the Over Age calculation is used as well as the Days Between (Determination_Dt - Filed_Dt). That is the (date1-date2) example that I gave in my first post. So the calcuation would be the SUM(Days_Between) / Days_Between.

Similar Messages

  • Unable to load the following resource: Error: too many columns- form won't

    Hi ..
    Can you please suggest on the following error, which i am facing the issue while opening data form in Hyperion Planning 11.1.1.4 .
    Unable to load the following resource: Error: too many columns- form won't
    Regards,
    Vasu

    It is something around 256 if I am not mistaken, I dread to think what a form with 700 columns is like to work with.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Report timing out, "Too many records"

    I am using CR XIR2 with a univers that I created to run an inverntory report. The report works fine in the designer but when I go to run it from the CR Server It times out. (Very quickly).  If I put filters and only pull a subset of the data the report works fine. This issue is there should not be too many records. Where can I check to make sure that there are no limitations set and I can get all of the records? I have set the parameters for the Universe to no limit records or time to execute. Is there any place else I can check? or any other ideas?
    Thanks

    What viewer do you use?
    If the viewer is ADHTML, you are using the RAS (Report Application Server). In that case, you need to set the number of (db) records to read in the RAS properties on the CMC.
    If the viewer is DHTML, Java or ActiveX, you are using the CR Page Server. You will need to set the number of db records to read in the Cryatal Reports Page Server properties on the CMC.

  • OLE or COM Processing error : Too many fields defined

    i have created a excel workbook  format in data integrator and defined the fields in it, when i tried to run a simple job extracting data from spreadsheet ,  i am getting following error OLE or COM Processing error : <Too many fields defined>.
    all i have in the spreadsheet is 18 rows and 35 columns of data, can any help how to solve this problem. i have used query transform for extracting and loading the data in to a table
    Edited by: Rakesh Chittineni on Apr 1, 2010 3:45 AM

    I have Solved the problem my friend suggestion.
    The excel file i was trying to access is from WEBI report which was saved as .xls format and then then made some modifications to the spreadsheet.
    What i did was i deleted the unused columns, i.e my spread sheet has data upto AQ column so i deleted remaining cells.
    and while  defining the  excel file format i selected the option workbook and selected the proper sheet and in the other options i have chosen column range and also check the box ( extended range) now i could over come the error OLE or COM processing error
    Edited by: Rakesh Chittineni on Apr 1, 2010 9:44 PM

  • [ASUS UX Series] *ERROR* too many voltage retries, give up

    Hello,
    I get the following errormessage when booting my UX32VD:
    "[drm:intel_dp_start_link_train] *ERROR* too many voltage retries, give up"
    What does this mean? Kernel: 3.14.1-1.
    Last edited by Lax Lexis (2014-04-27 15:37:01)

    I have the same issue, as do others; see https://bbs.archlinux.org/viewtopic.php?id=177595. But I haven't found any answers anywhere, nor any real cause for concern.

  • 0ASSET_AFAB Errors - too many error records update terminated

    too many error records update terminated -
    – It says too many error records as I have set an allowance of 10000 erroneous records in an attempt to get the transactional loads to work as they are dependant on this extracting successfully. This brought through over 10000 erroneous records.
    Regards
    Helpful answeres are surely rewarded

    Hi Voodi / Sorabh,
    Message Text: Too many error records - update Terminated
    ID: RSM2
    NO: 706
    Message Text: Error in the update
    ID: RSAR
    ID: 119
    Thanks in advance.

  • Master data failed with  error `too many duplicate records'

    Dear all
    below is error message
                Data records for package 1 selected in PSA -                                             
                error                                                 4 in the update
    LOng text is giving as below
    Error              4 in the update
    Message no. RSAR119
    Diagnosis
    The update delivered the error code                                                   4.
    Procedure
    You can find further information on this error in the error message of the update.
    WOrking on BI - 7.0
    any solutions
    Thanks
    satish .a

    Hi,
    Go through these threads, they have same issue:
    Master data load: Duplicate Records
    Re: Master data info object - duplicate records
    Re: duplicate records in master data info object
    Regards
    Raj Rai

  • Flex Time error: Too many disk I/) tasks (Elastic Audio)...

    I've been using flex time to take a sample in straight time and make it swing, but I've been having playback issues. I get two different error windows 1) Extreme compress factor detected during playback (Elastic Audio) (-10025) and 2) Too many disk I/O tasks (Elastic Audio). Also, I occasionally get a loud static sound when playing the sample. I don't have this issue when in Flex mode if I only loop the sample twice, but if I try to loop it more than twice, I'll get the errors and/or the static sound. At no point do the stretches make the audio color red, so I don't think I'm over-stretching or over-compressing the audio Is there any way to solve this? Does flex time have limitations to the number of markers used?

    Yeah, the I/O error is because you're basically pushing it too hard, it can't read what you're doing fast enough to process it. I got this the other day when I was trying to use flex within a take folder over multiple comped takes.
    If you want to swing the audio, why don't you cut it into regions, send it to the EXS 24 and then quantise the samples with swing in the piano roll. That way you're not putting so much pressure on the processor.

  • IDVD false error "too many menus"

    When I attempt to copy and paste a large menu tree, iDVD reports a false error message as below:
    Too many menus
    The maximum number of menus in an iDVD project is 99. No more menus can be created.
    However, I have < 20 menus, and I'm copying a tree with ~ 6 + 5 small movies. 
    After I've generated this error, it will sometimes prevent me from creating submenus normally (Project->Create Submenu) until I restart iDVD, issuing the same error message when I attempt to create the submenu. 
    My end result will be a DVD with about 30 submenus, each containing some text and a short video.
    I appreciate any advice on how to work around or fix this problem. . thanks!
    Peter

    Hi Peter
    Just a wild guess
    Can it be so that You included SlideShows - as I get it they can cont. 99 photos each and that this no. has some relation to Chapter handling.
    May be there is some problem related to this
    • max 99 Photos per SlideShow
    • max 99 Chapters per DVD ?
    • max 99 Menus per DVD
    I would try - Rebuilding a new project and see when or what makes it to react with this Error message.
    Yours just thinking - Bengt W

  • Special Ledger Roll up: too many records created in receiver table

    Hello,
    When I execute roll up from 1 special ledger to another special ledger (leaving out a number of fields) 4 records (postings) are selected but in the receiver table there are 92 records created (4*23) so 88 records too many. For each selected record in the sender table 7 records contain only 0 amounts and have an incorrect RPMAX value (starting with 16 till 336). The 8th record has an amount and has the correct RPMAX value: 352). In Sender and Receiver Ledger fiscal year variant Daily Balance is assigned (= each day is a period). Any hint how to prevent the empty records?

    Installing the patch, re- importing the SAP Provisioning framework (I selected 'update') and recreating the jobs didn't yield any result.
    When examining pass 'ReadABAPRoles' of Job 'AS ABAP - Initial Load' -> tab 'source', there are no scripts used .
    After applying the patch we decided anyway to verify the scripts (sap_getRoles, sap_getUserRepositories) in our Identity Center after those of 'Note 1398312 - SAP NW IdM Provisioning Framework for SAP Systems' , and they are different
    File size of SAP Provisioning Framework_Folder.mcc of SP3 Patch 0 and Patch 1 are also exactly the same.
    Opening file SAP Provisioning Framework_Folder.mcc with Wordpad : searched for 'sap_getRoles'  :
    <GLOBALSCRIPT>
    <SCRIPTREVISIONNUMBER/>
    <SCRIPTLASTCHANGE>2009-05-07 08:00:23.54</SCRIPTLASTCHANGE>
    <SCRIPTLANGUAGE>JScript</SCRIPTLANGUAGE>
    <SCRIPTID>30</SCRIPTID>
    <SCRIPTDEFINITION> ... string was too long to copy
    paste ... </SCRIPTDEFINITION>
    <SCRIPTLOCKDATE/>
    <SCRIPTHASH>0940f540423630687449f52159cdb5d9</SCRIPTHASH>
    <SCRIPTDESCRIPTION/>
    <SCRIPTNAME>sap_getRoles</SCRIPTNAME>
    <SCRIPTLOCKSTATE>0</SCRIPTLOCKSTATE>
    -> Script last change 2009-05-07 08:00:23.54 -> that's no update !
    So I assume the updates mentioned in Note 1398312 aren't included in SP3 Patch 1. Manually replaced the current scripts with those of the note and re- tested : no luck. Same issue.
    Thanks again for the help,
    Kevin

  • ALE settings error   "Too many recipients found for message type" urgent

    Hi all ,
    please help me to solve this issue !!!!!!!!
    i done with ale settings .
    in the bd64 , orders message type is used in 2 different model view for 2 different systems
    when i create po it is giving error in output "Too many recipients found for message type ORDERS in the ALE model"
    how can i rectify this error.
    Thanks

    Hi,
    Try to redefine your distribution model to have both receivers of your message type ORDERS in one "model view".
    Regards,
    Jakub

  • ALE error  "Too many recipients "

    Hi all ,
    please help me to solve this issue !!!!!!!!
    i done with ale settings .
    in the bd64 , orders message type is used in 2 different model view for 2 different systems
    when i create po it is giving error in output "Too many recipients found for message type ORDERS in the ALE model"
    how can i rectify this error.
    Thanks

    Hi,
    Please refer the link below:
    http://www.jt77.com/CRM/related-discussion-6255.html
    Thanks,
    Sriram Ponna.

  • WL10 Compiler executable.exec error "too many open files" deploying ear

    When I try to deploy an ear containing a web module and some ejb modules, I obtain this error:
    <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, MB-ADM_EAR [archive: /wl/wlments/MB-ADM_EAR/MB-ADM_EAR.ear], to Cluster1 .>
    Task 1 initiated: [Deployer:149026]deploy application MB-ADM_EAR on Cluster1.
    Task 1 failed: [Deployer:149026]deploy application MB-ADM_EAR on Cluster1.
    Target state: deploy failed on Cluster Cluster1
    java.io.IOException: Compiler failed executable.exec:
    /wl/servers/MS1/cache/EJBCompilerCache/-1dj0waj53cbu8/it/apps/ejbs/core/ExSvc_167qnt_Impl.java:17: error while writing it.apps.ejbs.core.ExSvc_167qnt_Impl: /wl/servers/MS1/cache/EJBCompilerCache/-1dj0waj53cbu8/it/apps/ejbs/core/ExSvc_167qnt_Impl.class (Too many open files)If i split the ear in two parts, web in one ear and ejbs in another ear, deploy is succesfull.
    Do you have any idea of what is happening?
    Below the environment specifications:
    JVM Version: jrockit_150_11
    JVM Heap: 512
    Web Logic: 10.0.1.0
    Server: Hewlett Packard DL585 G2
    OS: Linux / 2.6.5-7.287.3.PTF.345489.1-smp
    Thank you, bye,
    Marco

    Hello Marco.
    When you try to deploy an EAR weblogic server at the time of deployment unjar's it and compiles the files and so on. Every Operating system has a limit on how many number of files can be opened by a process. If your EAR is big then the number of files which WLS will unjar will also be large hence you hit the limit. By splitting your ear into 2, you are splitting wls task into smaller parts, which means the number of files it unjars at a time is less.
    The following note tells what needs to be done to avert this issue.
    http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14772/weblogic_server_issues.htm#CHDGFFHD

  • Internal error: Too many points in plot

    Labview keeps crashing and upon relaunch I get a message saying "... an internal error or crash occurred at plotsupp.cpp, line 4049"
    The failure log generated is:
    #Date: Thu, Sep 13, 2007 3:37:07 PM
    #OSName: Windows NT
    #OSVers: 5.1
    #AppName: LabVIEW
    #Version: 8.5
    #AppKind: FDS
    #AppModDate: 07/25/2007 00:07 GMT
    c:\builds\penguin\labview\branches\Jupiter\dev\source\panel\plotsupp.cpp(4049) : DWarn: too many points in plot
    $Id: //labview/branches/Jupiter/dev/source/panel/plotsupp.cpp#52 $
    0x007D3BDF - LabVIEW <unknown> + 0
    0x007D60B2 - LabVIEW <unknown> + 0
    0x0130124B - LabVIEW <unknown> + 0
    0x011DE932 - LabVIEW <unknown> + 0
    0x0123B148 - LabVIEW <unknown> + 0
    0x011DE932 - LabVIEW <unknown> + 0
    0x0067001A - LabVIEW <unknown> + 0
    0x007C379B - LabVIEW <unknown> + 0
    0x00B185C9 - LabVIEW <unknown> + 0
    0x00B188DA - LabVIEW <unknown> + 0
    0x00B18C4D - LabVIEW <unknown> + 0
    0x005E1855 - LabVIEW <unknown> + 0
    0x0049C139 - LabVIEW <unknown> + 0
    0x0049A981 - LabVIEW <unknown> + 0
    0x0049C1EC - LabVIEW <unknown> + 0
    0x00405678 - LabVIEW <unknown> + 0
    0x0040599B - LabVIEW <unknown> + 0
    0x0045CFF6 - LabVIEW <unknown> + 0
    0x00505D85 - LabVIEW <unknown> + 0
    0x00505FAB - LabVIEW <unknown> + 0
    0x00505FF0 - LabVIEW <unknown> + 0
    0x0149415F - LabVIEW <unknown> + 0
    0x7C816FD7 - kernel32 <unknown> + 0
    0x00000000 - LabVIEW <unknown> + 0

    Yes, while the program is running and consistently it seems to happen shortly after selecting the  "ECG Chart" tab, I get the Microsoft error message (Error1.png attached) and after acknowledging the error Labview goes bye bye.
    Upon restarting Labview I get the "previous internal error" message (Error2.png attached) and the error log file is generated (lvlog10-04-07-13-48-17.txt attached).
    I don't know if it will help since you probably can't run the VI's without the ECG monitoring hardware (a device manufactured by Active Corp. communicating with my PC serially via a COM port), but I will go ahead and attach all of the related subVI's in the ensuing post.
    msavina
    Attachments:
    lvlog10-04-07-13-48-17.txt ‏3 KB
    Error1.png ‏10 KB
    Error2.png ‏6 KB

  • Custom Office 2007 Doc Service Errors: Too many, ignored; Filtering Failed

    Hi...
    We are running SES 10.1.8.4 with the MS Office 2007 workaround outlined at: http://blogs.oracle.com/searchtech/
    While indexing production files, a number of the following errors were logged (cleansed to hide actual paths, files names, servers, etc.):
    ERROR crawler_5 1114 files inside zip file, Too many, ignored: /.../46629_bin
    ERROR crawler_5 EQG-30123: Filtering failed for "http://someserver/somefile.docx&lang=en"; trace information:
    1114 files inside zip file, Too many, ignored: /.../46629_bin
    It appears like all these errors are for docx files. This could just be a coincidence. We have very limited access to the files themselves due to confidentiality.
    In reading the README file for the MS Office 2007 document service, ZIP is one of the required document types for this workaround. Specifically,
    the OfficeX files are XML packaged in zip format, so you must tell SES to index zip files
    Is the custom MS Office 2007 document service not able to index certain docx files?
    Are these files too large and/or complex for indexing?
    Any guidance is appreciated.
    Thanks!

    More information. All the documents that throw this error are between 9.5 - 13.5 MB in size.

Maybe you are looking for

  • SCHEDULING AGREEMENT AND SCHEDULING LINE CREATION

    Hello Guys, I trying creating a scheduling agreement(SA) for vendor & material combination. I have created a Scheduling agreement in ME31L then maintained in ME38. In ME38 i have also mentioned the delivery date. when i am checking EKKO for Purchasin

  • How to insert Keywords in a PDF file?

    Hi to all, excuse in advance for my english. I want insert a Keyword in the PDF properties, How can I do? My problem is that I already developed a plug-in with Adobe SDK 9, Can I include the XMP sdk now? and How ? Thanks a lot

  • Weird Macbook Pro Unibody Trackpad problem

    Okay, this has been bothering me for a while. I have a 2 year old Unibody 15" Macbook pro, with the glass trackpad. I used the laptop for a year, and it was perfect. One day I was sitting on the couch with the computer next to me and I push the track

  • LR4.4 won't tether to my Canon 50D or 7D; Win7 64 bit

    Hey all, I had LR3.6, never tried to tether.  I upgraded and now have LR4.4.  I tried tethering my 50D and my 7D, LR wont recognize either camera at all.  EOS Utility works fine.  Same cameras, same cables work on a fresh LR 4.4 install on my wife's

  • Exit/minimize block is blacked out

    I have ms W8 and after the latest firefox upgrade a few days ago the exit minimize box in the upper lefthand corner of the page is blocked and I cannot see and graphics on common sites such as facebook and Mozilla support when going to this sites thr