The procedure is not running no compilatin error please help

Dear Sir,
I have this procedure, when I am trying to execute it, it shows me busy cursor nothing happens i was trying for 6 hours nothing happening.
I am not able to trace out what is happening
please help
regards
sanat
CREATE OR REPLACE procedure rate_Calc is
--declare
sdate date := to_date('01-04-2004','dd-mm-yyyy');
edate date := sysdate;
p_amt number;
d_amt number;
i_qty number;
r_qty number;
d_qty number;
d_rate number;
aa number;
begin
delete from avg_rate;
commit;
insert into avg_rate(select to_date('31-03-2004','dd-mm-yyyy'), item_mast.item_code, item_mast.curr_rate from item_mast);
for rec1 in (select item_code from item_mast
) loop
sdate := to_date('01-04-2004','dd-mm-yyyy');
while (sdate < edate ) loop
begin
select nvl(sum(qty_accepted),0) into r_qty from rece_mast a, rece_det b where a.tran_no = b.tran_no and
a.tran_date < sdate and item_code = rec1.item_code;
exception when no_data_found then r_qty := 0;
when others then r_qty := 0;
end;
begin
select nvl(sum(issue_qty),0) into i_qty
from issu_mast a, issu_det b where a.tran_no = b.tran_no and
a.tran_date < sdate and item_code = rec1.item_code;
exception when no_data_found then i_qty := 0;
when others then i_qty := 0;
end;
begin
select nvl(item_rate * (r_qty - i_qty),0) into p_amt from avg_rate
where item_code = rec1.item_code and avg_date = sdate -1 ;
exception when no_data_found then p_amt := 0;
when others then p_amt := 0;
end;
begin
select nvl(sum(qty_accepted * item_rate),0), nvl(SUM(qty_accepted),0) into d_amt, d_qty
from rece_mast a, rece_det b where a.tran_no = b.tran_no and
a.tran_date = sdate and item_code = rec1.item_code;
exception when no_data_found then d_amt := 0;d_qty:=0;
when others then d_amt := 0;d_qty:=0;
end;
begin
d_rate := (p_amt + d_amt) / (r_qty + d_qty - i_qty);
exception when value_error then
d_rate := 0;
when others then
d_rate:=0;
end;
insert into avg_rate (avg_date, item_code, item_rate) values (sdate, rec1.item_code,d_rate);
sdate := sdate +1;
end loop;
end loop;
commit;
end;
/

Two possibilities:
1. Some other process is using the avg_rate table and the delete statement is having to wait until that other process is finished.
2. There is so much to do that it will take several hours to finish. How many rows are in item_mast? Because for every row in item_mast you are inserting over 2000 rows into avg_rate. Also do rece_mast and issu_mast have an index on item_code? If not you're doing a full table scan on those tables for every row you insert into avg_rate. Do rece_det and issu_det have indexes on tran_no? If not then you're doing a full table scan on those for every row you insert.
So if there are 1 million rows in item_mast, you're inserting 2 billion rows into avg_rate. And if this is not the first time it's been run you're also deleting 2 billion rows. That could take a lot longer than 6 hours.

Similar Messages

  • HT203196 My macbook air 13inch got shutdown 3 times by itself. I tried installing SMC package as suggested but my computer is telling the update is not required. Could you please help me on fixing this issue. Thanks.

    My macbook air 13inch got shutdown 3 times by itself. I tried installing SMC package as suggested but my computer is telling the update is not required. Could you please help me on fixing this issue. Thanks.

    What version of OS X are you using? Exactly which MBA model do you have?

  • My iphone in the evening yesterday vibrated continuously and went off am charging is not charging the phone is not switching on again. Please help me

    My iphone in the evening yesterday vibrated continuously and went off am charging is not charging the phone is not switching on again. Please help me

    well in thatcase, i need another help .
    thanks for your instant reply.
    i have currently bought a new laptop (windows 8) and my iphone is not being recognized by itunes.
    because i have no backup on my previous laptop, i downloaded touchcopy but even touch copy is not recognizing my iphone.

  • TS3694 i keep getting an error code 1015 and i have tried all the steps that apple has provided. the phone is not jailbroken. Can someone please help me

    i have an roor code 1015 can someone please help me

    So you're not trying to downgrade iOS?
    Make sure itunes is up to date then try restoring via recovery mode. Follow the link below to do this:
    http://support.apple.com/kb/ht1808
    Hope this helps

  • TS1369 My iphone 4 showed itunes with connector, tried to restore came back with error.  Now shows the apple & will not do anything else.  Please help!

    My iphone 4 did a update this morning. Ever since it has showed itunes with connector.  Connected to itunes tried to restore.  Came back with error now only shows the apple sign.  Please help!

    iPhone is in recovery mode.
    http://support.apple.com/kb/HT1808

  • Can not run ant build. Please help me!

    Please help me. Thks U very much in advance
    I've installed java Webservice 1.2 included Ant 1.5 (I haven't installed any
    Ant version before)
    When I run Ant in cmd, the following error occur:
    D:\java\doc\jwstutorial12\examples\gs>ant build
    Exception in thread "main" java.lang.NoClassDefFoundError: Files\j2sdk_nb\j2sdk1
    /4/2\lib\tools/jar;C:\jwsdp-1/2\apache-ant\//\server\lib\catalina-ant/jar;C:\jws
    dp-1/2\apache-ant\//\jaxp\lib\jaxp-api/jar;C:\jwsdp-1/2\apache-ant\//\jaxp\lib\e
    ndorsed\sax/jar;C:\jwsdp-1/2\apache-ant\//\jaxp\lib\endorsed\dom/jar;C:\jwsdp-1/
    2\apache-ant\//\jaxp\lib\endorsed\xercesImpl/jar;C:\jwsdp-1/2\apache-ant\//\jaxp
    \lib\endorsed\xsltc/jar;C:\jwsdp-1/2\apache-ant\//\jaxp\lib\endorsed\xalan/jar;C
    :\jwsdp-1/2\apache-ant\lib\optional/jar;C:\jwsdp-1/2\apache-ant\lib\ant/jar;
    My computer: windows 2000 Adv Server installed:
    1. j2sdk1.4.2 with Netbean IDE 3.5. Installed dir:
         C:\Program Files\j2sdk_nb\j2sdk1.4.2
    2. Java WebService 1.2. Installed dir:
         C:\jwsdp-1.2
    3. My computer environment variables
    ALLUSERSPROFILE=C:\Documents and Settings\All Users
    ANT_HOME=C:\jwsdp-1.2\apache-ant
    APPDATA=C:\Documents and Settings\Administrator\Application Data
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=NHV
    ComSpec=C:\WINNT\system32\cmd.exe
    HOMEDRIVE=C:
    HOMEPATH=\
    include=E:\Program Files\Microsoft Visual Studio\VC98\include
    JAVA_HOME=C:\Program Files\j2sdk_nb\j2sdk1.4.2
    lib=E:\Program Files\Microsoft Visual Studio\VC98\lib
    LOGONSERVER=\\NHV
    NUMBER_OF_PROCESSORS=1
    OS=Windows_NT
    Os2LibPath=C:\WINNT\system32\os2\dll;
    Path=C:\orant\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\orant\jdk
    \bin;C:\jwsdp-1.2\jwsdp-shared\bin;C:\jwsdp-1.2\bin;C:\Program Files\j2sdk_nb\j2
    sdk1.4.2\bin;C:\jwsdp-1.2\apache-ant\bin;E:\Program Files\Microsoft Visual Studi
    o\Common\Tools\WinNT;E:\Program Files\Microsoft Visual Studio\Common\Tools;E:\Pr
    ogram Files\Microsoft Visual Studio\VC98\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 3, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0803
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SystemDrive=C:
    SystemRoot=C:\WINNT
    TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
    TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
    USERDOMAIN=NHV
    USERNAME=administrator
    USERPROFILE=C:\Documents and Settings\Administrator
    windir=C:\WINNT

    I have had the same problem as above and spent quite a few nights pulling hair out over it. Adding/removing quotes in the environment var and in the ant batch file didn't seem to work though.
    I added and echo line to spit out the antRun command and found the LOCALCLASSPATH var was stuffed.
    Rather than piss around any further I just wrote a batch file to generate an equivilant variable called JWSDP_ClassPath (for want of a better name).
    The batch file code was simply (line by line to make it easier to read):
    set JWSDP_CLASSPATH="C:\Program Files\Sun\s1studio_jdk\j2sdk1.4.1_02\lib\tools.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\server\lib\catalina-ant.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\jaxp-api.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\endorsed\xsltc.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\endorsed\xercesImpl.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\endorsed\xalan.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\endorsed\sax.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\jaxp\lib\endorsed\dom.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\apache-ant\lib\optional.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\java\jwsdp-1.3\apache-ant\lib\ant.jar";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\Program Files\Sun\s1studio_jdk\j2sdk1.4.1_02\lib";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\Java\jwsdp-1.3\common\lib";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\Java\jwsdp-1.3\apache-ant\lib";
    set JWSDP_CLASSPATH=%JWSDP_CLASSPATH%"C:\Java\jwsdp-1.3\server\lib";
    I then call this before the antRun command and use JWSDP_CLASSPATH rather than LOCALCLASSPATH in the ant.bat, eg:
    call set_JWSDP_CLASSPATH
    :runAnt
    java -cp %JWSDP_CLASSPATH% "-Dant.home=%ANT_HOME%" "-Djwsdp.home=%ANT_HOME%\.." %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
    This will obviously need to be customised to the install paths on the PC it is run on....
    Anyway hope this helps someone if the above more simle solutions do not.
    BJL
    PS 'carn the LIONS - 4 in a row!!

  • Macbook Pro Fan Continues Running After download Error -- Please Help so Loud

    Hello,
    I recently tried to download the Citrix reciever application onto my Macbook pro. The installation was taking an excessive period of time and it was obvious that something had gone wrong in the download because it had taken several hours and was stuck at a certain step. I tried to cancel the installation but it wouldn't allow me. So I force quit the installation and thought that it was shut down, but I was mistaken. The next time I opened my computer the fan was running at an increased rate and was very loud and the computer was heating up. I tried to restart the computer and it said that the program was still trying to download and that the computer could not be shut down until completed. I got frustrated and basically forced a power down by signing out and holding the power button or something of that nature till it shut down. I waited overnight and then powered it back up but nothing had changed and the fan was still running like crazy but it says the program is not trying to install anymore though. I checked the activity level and CPU but nothing is out of ordinary of high. The program is not anywhere on my computer either so I have no idea what is going on and cannot figure out how to stop this fan running like this. It is draining my battery, overheating my computer and is annoying too.
    Any help, hints or ideas would be greatly appreciated or I will be forced to visit the apple store for some help I guess.
    Thanks,

    Unfortunately, spoke way to early.  The fan issue is still a big problem.  From the second the machine is turned on, the fan cranks up.  Frankly, I think this is overheating the machine to some extent (running the fan at max speeds when it's not even warm).  Additionally, the noise caused by this has only gotten worse, and now it is even making a "whistling sound."  Looks like I'm going to be making the trek to the Genious Bar, but based on comments by others on this issue I am not optimistic about a fix.

  • CRM order giving the document could not be saved exception! Please help!

    Hi Experts,
       I am changing the status of a order using CRM_STATUS_CHANGE_EXTERN and CRM_STATUS_CHANGE_INTERN.
       After this I call CRM_ORDER_INITIALIZE and the BAPI_BUSPROCESSND_SAVE.
       Finally commit.
               CALL FUNCTION 'CRM_ORDER_INITIALIZE'
                  EXPORTING
                    it_guids_to_init  = lt_crmd_guids
                    iv_init_frame_log = 'X'
                    iv_keep_lock      = 'X'
                  EXCEPTIONS
                    error_occurred    = 1
                    OTHERS            = 2.
                ls_obj_save-guid = v_header_guid.
                append ls_obj_save TO lt_obj_save.
                CALL FUNCTION 'BAPI_BUSPROCESSND_SAVE'
                   EXPORTING
                    UPDATE_TASK_LOCAL       = 'X'  "commented. Taking default
                     SAVE_FRAME_LOG          = 'X'
                   IMPORTING
                     LOG_HANDLE              = lv_log_handle
                    TABLES
                      OBJECTS_TO_SAVE         =  lt_obj_save
                      SAVED_OBJECTS           =  lt_obj_saved
                      RETURN                  =  lt_return.
        The function BAPI_BUSPROCESSND_SAVE is returning error: The document could not be saved in it_return. I am not getting any other details. What am I doing wrong? Please help!
    Thanks & Regards
    Gopal

    Hi Robert,
       The SPRO settings seems to be fine.
       The problem is that the order is not getting saved whenever there is backward status change. However if I see the item status via tcode "crmd_order" then it actually shows the new status. In other words status is changing but still order is not getting saved.
       When I debugged the code I found that first It has successfully executed the FM CRM_STATUS_CHANGE_EXTERN and then when CRM_ORDER SAVE is called the parameter et_saved_objects is empty. I am passing header Guid in  it_objects_to_save. If order is saved properly then et_saved_objects should be filled with order guid.
    CALL FUNCTION 'CRM_ORDER_SAVE'
                   EXPORTING
                     it_objects_to_save = lt_save
                   IMPORTING
                     et_saved_objects   = lt_saved_obj
                   EXCEPTIONS
                     document_not_saved = 1
                     OTHERS             = 2.
    On further debugging inside CRM_ORDER SAVE I found that the FM CRM_EVENT_PASS_INFO_EXE_OW returns lt_events empty. That means the given guid  is not registered for saving. Why is this so?
      are there objects registered for saving
        call function 'CRM_EVENT_PASS_INFO_EXE_OW'
          exporting
            iv_exetime     = gc_event_exec_time-save_order
            iv_order_guid  = ls_object_to_save
            iv_obj_kind    = gc_object_kind-orderadm_h
          importing
            et_event_calls = lt_events
          exceptions
            others         = 99.
        if lt_events is initial.
          delete ct_objects_to_save.
          continue.
        endif.
       The problem is when the order is not getting saved the status change is not getting transferred to BW or BI.
       What could be the issue?
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Apr 7, 2011 5:59 AM
    Edited by: gopalkrishna baliga on Apr 7, 2011 6:09 AM

  • I have just moved from using Windows all my life to Mac OS Lion. My accounting software "Tally" does not run on it. Please help !

    I have just moved from using Windows all my life to buying a Mac Book Pro running on OS Lion. But my accounting softwares Tally 7.2 and Tally 9 do not run on it.
    I just learnt that the software platform of Tally Accounting softwares are specific to Windows only.
    I need to run the accounting software, Mail and several spread sheets and documents at the same time.
    Is there some way I can do this on the Mac Lion OS?
    Help solicited !

    Yes, you can share files across a network as long as the network server is setup so your Mac can connect to it. See Mac OS X 10.7 Help: Connect to shared computers and file servers on a network, Mac OS X 10.7 Help: Connect your Mac directly to a Windows computer, Mac OS X 10.7 Help: Connect to a Mac from a Windows computer, and Mac OS X 10.7 Help: Connect to shared computers and servers using a network address.

  • I updated my iPad 4 iOS 8.0.2 and the camera does not work, ... Please help

    I updated my iPad 4 iOS 8.0.2 and the camera does not work and hangs and unconnected, .... Please help me in this question,... Thanks in advance

    You're welcome, but I didn't do anything. Try closing the camera app completely and reset your iPad and maybe that will help.
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Adobe Application Manager says Update Failed and the patch is not applicable for me. PLEASE HELP!

    As the title said, that's my dilemma. I have the OS X Yosemite update (worst mistake of my life) on the iMac. Photoshop CS6 was acting much slower and crashed a couple of times, so I tried to update it. However the Adobe Application Manager was uncooperative and said that the update failed. If there are any other things you need to know in order to fix the problem, tell me. Just please, please HELP ME.

    which update are you trying to install? What is the current version you have?
    Keeping Photoshop is Up-To-Date: http://adobe.ly/PS-Up-To-Date

  • I went to update my dads iphone 4 and it stopped working about halfway through when i rebooted my computer itunes said i had to restore and it stopped also now the phone will not turn on at all please help before my dad kills me

    someone please help me

    What is currently showing on the screen?
    Have you tried a reset by pressing and holding the Home and Sleep/Wake buttons?
    In the future, it might be best to leave other peoples devices alone.

  • My iMac G5 will not run Hardware Test. Please help!!

    I need to run a hardware test for two reason:
    1. ethernet stopped working [airport does work]
    2. if the computer falls asleep it won't wake up
    So, I want to find out if it's a hardware or software issue. Problem is, when i try to boot up the Hardware Test nothing happens. The computer starts up normally as if I didn't have the disk in at all.
    I am following the instructions in the Hardware test "Read Me" file...put the OS X install disk in & restart holding down the "D" button. The startup screen flashes 2 different colors of grey and then just boots up normally. If I try holding "option" when I restart I get to a screen with the hard drive & the disk as choices to boot, but if I choose the disk I get a really weird screen of text talking about kernel panic & a bunch of stuff I don't know about on top of the grey crash screen telling me to restart.
    So after this long-winded question does anyone have any idea what I should do? THANKS!!

    Try using Disk Utility:
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk.

  • When I add audio file to iTune library from my computor the fine does not add/ open in iTune.please help

    problem in adding files to iTune library as mentioes in subject

    Try transferring/copy to 3rd party apps like OPlayer.

  • Help with case number :0185603779 not resolved.  Can someone please help me??????????????

    I have Adobe Digital Edition 2.0 on my computer.  I am receiving a message that it has stopped working.
    I had contacted Adobe previously, but the issue was not resolved.  Can you please help me?????????????

    I concur with dwb's assessment. See:
    Mac Maintenance Quick Assist,
    Mac OS X speed FAQ,
    Speeding up Macs,
    Macintosh OS X Routine Maintenance,
    Essential Mac Maintenance: Get set up,
    Essential Mac Maintenance: Rev up your routines,
    Maintaining OS X, 
    Five Mac maintenance myths, and
    Myths of required versus not required maintenance for Mac OS X for information.

Maybe you are looking for

  • SOS: module /TMWFLOW/CHECK_PRJ_CONS: No export system for productive client

    HI, gurus: when activating Change request manager in project, i met an error: Message from function module /TMWFLOW/CHECK_PRJ_CONS: No export system for PRD-100 (PRD is productive system) hwo to fix it? hi, the problem has been fix, it is due to a in

  • Can I recover my tabs and tab groups if "Restore previous session" fails? Is there a back-up option that I can retrieve them from?

    So I would like to be able to hit a "save now" button and have my current session be saved within my mozilla account. Is this possible? In the past I have closed Mozilla with restore previous session active, but it has not saved my session. I would l

  • Jprofiler setup

    All, I am trying to use jprofiler on one of our BEA weblogic servers and is having trouble starting weblogic service after installing jprofiler, if anyone can help that would be appreicated. I went through the jprofiler integration wizard to choose l

  • Multi-Language RIA

    HI, I need to develope an RIA in flex with multiple language support. When user select the desired language through list of languages, all the text of application must convert to that specific language. I will use either Cairngorm or Mate framework t

  • Does Migration Licenses Include Upgrade of CUCM, UCCX, IMP, CUC?

    Hi, Does migration licenses include the upgrade of CUCM, UCCX, IMP and CUC from BE6K? The customer said that they currently have expired UCSS, but they purchased migrations licenses to v10.5. They purchased these items below. They are running v8.6 CU