Why is the second procedure in my package not working??

Hi I have a package that I want to run every 15 minutes. When I try to run the procedures manually and each one seperately they work. But when I put together these procedures in a package, the second procedure does not work or not updating the table. Any idea why this is creating a problem??
PROCEDURE UPDATE_CS_ACTIVITY is the one in the below package that does not seems working .. but when i run the procedure manually it works fine.
Any help in this regard is greatly appreciated...
Thanx in advance
Here is the Package code:
CREATE OR REPLACE PACKAGE BODY UPDATE_ACTIVITY AS
CSREWORK NUMBER(4);
CSTRACKOUT NUMBER(4);
STARTDATE VARCHAR2(20);
ENDDATE VARCHAR2(20);
PROCEDURE INSERTVALUES IS
BEGIN
DELETE FROM 2DAY_ACTIVITY;
IF SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),12,2) > 18
THEN
STARTDATE := '18:30:00';
INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
FROM "ACT_1DAY_VIEW" "ACT_VIEW"
GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
INSERT INTO WAFER_2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
FROM "ACT_1DAY_VIEW" "ACT_VIEW"
GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
COMMIT;
ELSE
     STARTDATE := '06:30:00';
     INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
FROM "ACT_1DAY_VIEW" "ACT_VIEW"
GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
FROM "ACT_1DAY_VIEW" "ACT_VIEW"
GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
     COMMIT;
END IF;
END INSERTVALUES;
PROCEDURE UPDATE_CS_ACTIVITY AS
BEGIN
INSERT INTO CS_ACTIVITY(STAGESTEPPROD, RESOURCES, CSTRACKOUT, CSREWORK) select MAX(stagestepprod),MAX(resources), max(cstrackout) ,max(csrework) from 2day_activity group by 2DAY_ACTIVITY.stagestepprod,2DAY_ACTIVITY.resources;
COMMIT;
END UPDATE_CS_ACTIVITY;
END UPDATE_ACTIVITY;

You have create global variables CSREWORK and CSTRACKOUT
in your package.
Your have then selected the
max(cstrackout) ,max(csrework) which would probably pick these variables up.
Rename your variables to v_CSREWORK and v_CSTRACKOUT or remove altogether as no sign they are being used which should fix that problem. The normal naming standard for oracle is to name variables with a v_ and parameters with a p_ to prevent problems with naming.

Similar Messages

  • Why do the trusted face in smart lock not working in lollipop 5.0.2?

    Hello everyone. I tried to lock my phone with face lock. but failed. Here is what I did.First I open settings  then  security   then smart lock   then  trusted face  . After that I set it up. All done , then I improve the face matching. SO the trusted face feature is turned ON . But when I open my phone it doesn't open it with face but with my previous Pattern. Why is this happening? Am I missing something? On kit kat this feature was working well, but with lollipop it doesn't. Why?Anybody can help and thanks.

    Hello Quester. Thanks for your respond. I've checked Trust agents.  And smart Lock is already checked. The face unlock feature is still not working.Any other suggestions please.Thanks.

  • Why are the additional effects on Photo Booth not working?

    I upgraded my OS to Mountain Lion a few hours ago and I tried out the Photo Booth and found out that the first page of effects (the new ones) were not working. Is there any way to fix this?

    Maybe this will help:
    https://discussions.apple.com/message/15680562#15680562
    https://discussions.apple.com/message/15716945#15716945
    Monitor the "More Like This" box (top right) and maybe you'll find a thread that solves your proble.

  • Why is the maps app on my ipad not working properly ?

    It opens OK but can't find my location once and a while.
    Then getting directions between to points doesn't work.
    Any idea's ?
    ipad 1
    version 4.3.3
    (Also its getting slower and the battery life goes down.)

        We want you to always have working apps linton37. I'm sorry you're having issues. Have you tried to remove the apps and redownload them back to your phone? They may need updating so they can work with your phone. I would also try accessing them on the data network to ensure its not your home wifi blocking those apps.
    Kinquana_VZW
    Follow us on Twitter @vzwsupport

  • Why is the search on my mail app not working?

    I just bought the new iPod touch 5th generation. I synced it with my iTunes, transferring all the apps I had on my old 3rd generation iPod touch. Everything works fine, except the search on my mail app. When I type in some keyword to search, and click the "all" label, it won't actually search all my email content, only the subjects and senders. Any way to fix this?

    No. From the Users Guide it only searchs mail for:
    Mail—To, From, and Subject fields of all accounts (the text of messages isn’t searched)

  • Why are the adjustment layers in my actions not working? (mac osx)

    I've just 'upgraded' to CC, and noticed that actions that alter Curves or levels adjustment layers do not play back correctly.
    The Action itself contains the right steps but nothing happens to the adjustment or the image. I use this a lot for my work and I really need some help
    I have a mac 10.7

    Are these actions you recorded in a previous version of photoshop?
    Did you try recording the action(s) in photoshop cc?
    Have you installed the 14.1.1 update for photoshop cc?
    Does it make any difference if you disable the Generator plugin under Photoshop>Preferences>Plug-Ins>Enable Generator?

  • Why are the ports on my macbook pro not working?

    I have a 2.4GHz intel core i5 Processor with 4 GB memory fully up to date lion processing system and no matter what I do I can not get my usb ports to work. They both worked a few months back, but after a while one of the 2 ports gave out still produced power but it didnt see anything in there which was fine I moved my cooling pad to that slot and used the other for my wireless mouse but just recently the last of the 2 slots gave out and now I have 2 ports that emit power but dont ever read when I put something in the slot. I have been hitting up youtube and the internet in general and have yet to find a solution.

    I suggest an appointment at an Apple store genius bar.
    Ciao.

  • Why is the Pages app for iPad Mini not working?

    For the last few days I have been having major issues with the word processing application Pages for the iPad. It is taking a very long time to show me my documents, then it takes just as long to open up documents. Then when it finally opens up the document I have selected; the entire functionality is extremely slow and sluggish.
    I turned the iPad on and off several times to see if that would help. I deleted the pages app. I even freed up some extra space on the iPad. None of these things have resolved anything.
    If it is at all relevant I am using the most recent version of Pages (especially since I re-downloaded it). I am also using the latest version of iOS 8 on the iPad. My iPad is synched to iCloud. I have a maximum storage capacity of 20 gb (to which I have only used 675 kb). I am using the first generation iPad Mini (which is the very first iPad mini)
    What could be the problem?
    Should I reset the factory settings of the entire iPad? I'm at a loss of how to resolve this.

    The problem may be due to slow internet access to icloud where the document is being stored and saved.
    Try creating a new document which is not on iCloud to see how the performance is.

  • HT4972 After the process stops due to a "corrupted" download of the new iOS file, why does the second try repeat the ten-hour backup process?

    After the process stops due to a "corrupted" download of the new iOS file, why does the second try repeat the ten-hour backup process? I am doing this on the latest iTunes, and a Windows XP computer.

    After the process stops due to a "corrupted" download of the new iOS file, why does the second try repeat the ten-hour backup process? I am doing this on the latest iTunes, and a Windows XP computer.

  • Why my ipod touch 5g crashes, it does not work and the touch after a type is loaded and will be locked?

    why my ipod touch 5g crashes, it does not work and the touch after a type is loaded and will be locked?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:       
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Why is the music on my iPod randomly not letting me play? all my good ones are the ones I purchased won't play, my storage is fine. I tap on the song but it skips to a completly different song on iPod but not laptop

    Why is the music on my iPod randomly not letting me play? all my good ones are the ones I purchased won't play, my storage is fine. I tap on the song but it skips to a completly different song on iPod but not laptop. For example both versions of Til' I Collapse by Eminem won't play on my iPod but on laptop, same with Born this Way by Lady Gaga

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • HT1451 Why do the song names and cd name not show up on the IPod Shuffle?

    Why do the song names and cd name not show up on the Shuffle?

    MysticChyk wrote:
    Why do the song names and cd name not show up on the Shuffle?
    Err this is no longer April 1st you know.
    The iPod Shuffle has never had a 'display' on which track names can be shown. See http://www.apple.com/ipod-shuffle/ if you want an iPod which does have a display on which you can see the tracks names and even the album cover art then look instead at the bigger and more expensive iPod Nano http://www.apple.com/ipod-nano/ or iPod Touch http://www.apple.com/ipod-touch/
    PS. The current iPod Shuffle even though it has no display on which it can show the track names can read them out loud to you using a voice-synthesiser this is the VoiceOver feature described on the iPod Shuffle product page I listed above.

  • I have tried to reinstall CS3 extended student version to my new comuter from the dvd and also from the web download but it does not work - I get the information that the server does not work- why. How should I do?

    I have tried to reinstall CS3 extended student version to my new comuter from the dvd and also from the web download but it does not work - I get the information that the server does not work- why. How should I do?

    Well the error message is in Swedish but says: The installation program database is damaged. Please contact the Adobe support (which is a hard thing to do!!). I use Windows 7 Home Premium with service pack 1.
    Från: Mylenium 
    Skickat: den 29 december 2014 16:48
    Till: Tony Bohman
    Ämne:  I have tried to reinstall CS3 extended student version to my new comuter from the dvd and also from the web download but it does not work - I get the information that the server does not work- why. How should I do?
    I have tried to reinstall CS3 extended student version to my new comuter from the dvd and also from the web download but it does not work - I get the information that the server does not work- why. How should I do?
    created by Mylenium <https://forums.adobe.com/people/Mylenium>  in Downloading, Installing, Setting Up - View the full discussion <https://forums.adobe.com/message/7050595#7050595>

  • HT1338 why the map in iphone 5 its not working here United Arab Emirates

    why the map in iphone 5 its not working here United Arab Emirates

    Am having same problem with my iphone 5 ... i can't use facebook and weather app only ... other apps are working perfectly fine ... my phone is on fw 6.0.2 and i think its my firmware problem let me know how did u resolved your's?

  • Why are the options for "When Firefox starts" NOT clickable in Firefox 5? I want to choose "Windows and tabs that where opened last time you accessed the net" but Firefox won't let me.

    In the previous version of Firefox one could choose to save tabs so that when Firefox opened, all the tabs from the previous sessions appeared. This was done in Settings > Options > General > Startup. In the menu for the "When Firefox Starts" one had the option for "Windows and tabs that where opened last time you accessed the net." in Firefox 5.0, this menu is gray and not clickable. Help, please?

    ''Why are the options for "When Firefox starts" NOT clickable in Firefox 5?"
    Possibly you are not saving your "browsing history" which is what the session history is tied into.
    '''Not saving History''' -- check your settings for '''Tools > options > Privacy'''', make sure you are not clearing more than just cache in "Settings for Clearing History"
    * http://img232.imageshack.us/img232/4928/clearcachew.png
    * clearing your history at end of session, cache is the only one you would want to clear at end of session, if you don't want to lose things
    There are several things that are related to private browsing and not saving History
    * Private Browsing Ctrl+Shift+P
    * You selected "Never remember history" in first drop-down of Tools > Options Privacy and all of the check marks disappear (See picture above)
    * "Permanent private browsing mode" was check-marked under "Use custom settings for history" in the first drop-down of Tools > options > Privacy (see picture above)

Maybe you are looking for