This SQL  script is not running properly

The following is SQL script which I want to run.When I am running individual statements , all the statements are working. But When I am running script as a whole, its not working.
what might be the problem with following script
--the following table is created with list of Singapore Holidays
set define off
drop table exclude_date;
create table exclude_date as
select 2007 as year#, 1 month#, 1 day#, 'New Year Day' as name# from dual union all
select 2007 as year#, 1 month#, 2 day#, 'New Year Day' as name# from dual union all
select 2007 as year#, 2 month#, 18 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 2 month#, 19 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 2 month#, 20 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 4 month#, 6 day#, 'Good Friday' as name# from dual union all
select 2007 as year#, 5 month#, 1 day#, 'Labour Day' as name# from dual union all
select 2007 as year#, 5 month#, 31 day#, 'Vesak Day' as name# from dual union all
select 2007 as year#, 8 month#, 9 day#, 'National Day' as name# from dual union all
select 2007 as year#, 10 month#, 13 day#, 'Hari Raya Puasa' as name# from dual union all
select 2007 as year#, 11 month#, 8 day#, 'Deepavali' as name# from dual union all
select 2007 as year#, 12 month#, 20 day#, 'Hari Raya Hji' as name# from dual union all
select 2007 as year#, 12 month#, 25 day#, 'Christmas Day' as name# from dual ;
show errors;
drop type DateList;
--This statement creates type of DateList for the function all_date_list which return DateList
create or replace type DateList as table of date;
show errors;
--the following function returns list of working dates  between two dates excluding SAT , SUN and Singapore Holidays
drop function all_date_list;
create or replace function all_date_list(p_start date, p_end date)
RETURN DateList
PIPELINED
IS
curdate date:=p_start;
exclude number;
BEGIN
WHILE curdate <= p_end
LOOP
BEGIN
select 1
into exclude
from exclude_date
where to_date(year#||lpad(month#,2,0)||lpad(day#,2,0),'YYYYMMDD')=trunc(curdate) --excluding unworked days
or mod(to_char(curdate,'j'),7) in (5,6); --excluding week-end
EXCEPTION WHEN NO_DATA_FOUND THEN PIPE ROW( curdate );
WHEN OTHERS THEN NULL;
END;
curdate:=curdate+1;
END LOOP;
RETURN;
END;
show errors;
--the following function returns number of working days  between two dates excluding SAT , SUN and Singapore Holidays
drop function WorkingDays;
CREATE OR REPLACE function WorkingDays(msgSentDate Date) return NUMBER is
noOfWokingDays number;
begin
select count(*) into noOfWokingDays from table(all_date_list(msgSentDate,sysdate));
return noOfWokingDays;
end;
show errors;

--the following table is created with list of Singapore Holidays
set define off
drop table exclude_date;
create table exclude_date as
select 2007 as year#, 1 month#, 1 day#, 'New Year Day' as name# from dual union all
select 2007 as year#, 1 month#, 2 day#, 'New Year Day' as name# from dual union all
select 2007 as year#, 2 month#, 18 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 2 month#, 19 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 2 month#, 20 day#, 'Chinese New Year' as name# from dual union all
select 2007 as year#, 4 month#, 6 day#, 'Good Friday' as name# from dual union all
select 2007 as year#, 5 month#, 1 day#, 'Labour Day' as name# from dual union all
select 2007 as year#, 5 month#, 31 day#, 'Vesak Day' as name# from dual union all
select 2007 as year#, 8 month#, 9 day#, 'National Day' as name# from dual union all
select 2007 as year#, 10 month#, 13 day#, 'Hari Raya Puasa' as name# from dual union all
select 2007 as year#, 11 month#, 8 day#, 'Deepavali' as name# from dual union all
select 2007 as year#, 12 month#, 20 day#, 'Hari Raya Hji' as name# from dual union all
select 2007 as year#, 12 month#, 25 day#, 'Christmas Day' as name# from dual ;
drop type DateList;
create or replace type DateList as table of date;
--the following function returns list of working dates  between two dates excluding SAT , SUN and Singapore Holidays
drop function all_date_list;
create or replace function all_date_list(p_start date, p_end date)
RETURN DateList
PIPELINED
IS
curdate date:=p_start;
exclude number;
BEGIN
WHILE curdate <= p_end
LOOP
BEGIN
select 1
into exclude
from exclude_date
where to_date(year#||lpad(month#,2,0)||lpad(day#,2,0),'YYYYMMDD')=trunc(curdate) --excluding unworked days
or mod(to_char(curdate,'j'),7) in (5,6); --excluding week-end
EXCEPTION WHEN NO_DATA_FOUND THEN PIPE ROW( curdate );
WHEN OTHERS THEN NULL;
END;
curdate:=curdate+1;
END LOOP;
RETURN;
END;
show errors;
--the following function returns number of working days  between two dates excluding SAT , SUN and Singapore Holidays
drop function WorkingDays;
CREATE OR REPLACE function WorkingDays(msgSentDate Date) return NUMBER is
noOfWokingDays number;
begin
select count(*) into noOfWokingDays from table(all_date_list(msgSentDate,sysdate));
return noOfWokingDays;
end;
show errors;
commit;
The above script is not working properly.Last two fuctions are not executing.
What might be the error?

Similar Messages

  • UTLRP script is not running properly

    database version 8.1.7.4.1
    windows 2000 server
    UTLRP script is hanging up .
    What can be the reasons?

    my problem has been solved .
    Actually there was inconsistency in archive mode operation.
    log_mode was archivelog (v$database view)
    sql> archive log list
    Database log mode Archive Mode
    Automatic archival Disabled
    Archive destination d:\oracle\ora81\RDBMS
    Oldest online log sequence 586
    Current log sequence 588
    I want development database in noarchive mode so I have altered database for
    noarchivelog.
    Now utlrp has completed it's operation.
    Anyway thanks Satish
    Cheers
    Arun

  • I have bought a iPhone 4 , yesterday . I heard that iOS 7 is not running properly on iPhone 4 , so I have decided to upgrade it to 6.1.2 . Please help to do this.

    I have bought a iPhone 4 , yesterday . I heard that iOS 7 is not running properly on iPhone 4 , so I have decided to upgrade it to 6.1.2 . Please help to do this.

    YOU CAN'T.
    If you upgrade your phone you can only upgrade to iOS 7 and that is it.  You can only ever update to the lastest available software, which in this case is iOS 7.  You either upgrade to this or not at all because you can't upgrade to anything else.

  • Vz protect not running properly

    I have the latest version, but it is not running properly (just keeps scanning).
    How can I fix this? Should I uninstall and then reinstall? Is there a charge to do that?

    hello lhill123, maybe that's an issue with hardware acceleration - first please try [[Upgrade your graphics drivers to use hardware acceleration and WebGL|updating your graphics driver]], or in case this doesn't solve the issue or there is no new version available at the moment, start firefox into safemode '''by pressing the shift key while the application is launching''' & disable hardware acceleration in the firefox ''menu ≡ > options > advanced > general'' (that setting will take a restart of the browser to take effect).
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • I defined custom action but it is not running properly.

    Hi,
    I defined custom action but it is not running properly.
    I deployed in MII (System Management --> Custom Actions)
    When i use it as an action in a transaction error below generated.
    Errors
    [ERROR]: STEP EXCEPTION (Custom_Action_0) : Item 'Custom_Action_0' is not an Action
    [ERROR]: STEP EXCEPTION (Custom_Action_0) : Item 'Custom_Action_0' is not an Action
    Custom action code is below.
    package com.wipro.action;
    import com.sap.xmii.xacute.actions.ActionReflectionBase;
    import com.sap.xmii.xacute.core.ILog;
    import com.sap.xmii.xacute.core.Transaction;
    @author cemil.bozlagan
    public class CustomAction extends ActionReflectionBase {
        private String strFirstInput;
        private String strSecondInput;
        private String strOutString;
        public CustomAction() {
            strFirstInput = "";
            strSecondInput = "";
            strOutString = "";
        @Override
        public String GetIconPath() {
            return "/com/wipro/action/resources/icons/CustomAction.png";
        @Override
        public void Invoke(Transaction trx, ILog ilog) {
            try {
                strOutString = strFirstInput + strSecondInput;
                // This varaible is defined in ActionReflectionBase class
                _success = true;
            } catch (Exception e) {
                _success = false;
        public String getFirstInput() {
            return strFirstInput;
        public void setFirstInput(String strFirstInput) {
            this.strFirstInput = strFirstInput;
        public String getSecondInput() {
            return strSecondInput;
        public void setSecondInput(String strSecondInput) {
            this.strSecondInput = strSecondInput;
        public String getOutString() {
            return strOutString;
        @Override
        public boolean isConfigurable() {
            return false;
    How can i solve this problem?
    Thanks.

    Hi Cemil,
    Pls check document, I hv sent to your mail.
    May be it helps.
    Regards
    Padma

  • Javascript does not run properly in Firefox

    Firefox does not run javascript properly.
    For example:
    http://vk.com/app2622342_40916334#NEW/comp1427
    Comment form does not run at all in Firefox ( the last version = 20.0.1)
    but runs OK in Opera.
    WHY?
    Mozilla still is HALF-DONE SOFTWARE!!!!!!!
    WHEN YOU DO IT IN A GOOD WAY?

    I have javazcript-enabled = TRUE in my about:config. So your comment did not solve my problem. I noticed that javascript does not run properly in some websites (forms in vk.com) but those forms run OK in OPERA - how can you explain this!?
    And I have no errors in the Web Console (Firefox/Tools > Web Developer).
    I wrote you a link to the page where javascript does not work.
    ( you need to login to vk.com to see that page
    http://vk.com/app2622342_40916334#NEW/comp1427
    )

  • [svn:bz-trunk] 13744: Bug: BLZ-481 - AMFConnection JUnit test do not run properly as part of checkintests on Mac  (and Windows?)

    Revision: 13744
    Revision: 13744
    Author:   [email protected]
    Date:     2010-01-25 01:14:09 -0800 (Mon, 25 Jan 2010)
    Log Message:
    Bug: BLZ-481 - AMFConnection JUnit test do not run properly as part of checkintests on Mac (and Windows?)
    QA: No
    Doc: No
    Checkintests: Pass
    Details:
    -Don't start the server before unit task, unit task already checks if the server is not running and starts the server.
    -Don't stop the server after FlexUnit tests, JUnit tests need the server running, and they will stop the server after they are done.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-481
    Modified Paths:
        blazeds/trunk/build.xml
        blazeds/trunk/qa/apps/qa-regress/testsuites/flexunit/build.xml

    Tony,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • FOR ALL ENTRIES stmnt. in SELECT query is not running properly

    Hello experts,
              In my report program, I write one query on table BSIS.
             Internal table declaration -             
           DATA : BEGIN OF DLC_BSIS OCCURS 0,
                            BUKRS LIKE BSIS-BUKRS,
                            GJAHR LIKE BSIS-GJAHR,
                            BELNR LIKE BSIS-BELNR,  
                            SHKZG LIKE BSIS-SHKZG,
                            BSCHL LIKE BSIS-BSCHL,
                            AUFNR LIKE BSIS-AUFNR,
                            HKONT LIKE BSIS-HKONT,
                            QSSKZ LIKE BSIS-QSSKZ,
                            DMBTR LIKE BSIS-DMBTR,
                       END OF DLC_BSIS.                                                                               
    Query as follows --
             SELECT BUKRS
                           GJAHR
                           BELNR
                           AHKZG
                           BSCHL
                           AUFNR
                           HKONT
                           QSSKZ
                            DMBTR FROM BSIS
                                      INTO TABLE DLC_BSIS
                                     FOR ALL ENTRIES IN IT_BKPF2
                                     WHERE BELNR = IT_BKPF2-BELNR
                                                  AND BUKRS = IT_BKPF2-BUKRS
                                                  AND GJAHR = IT_BKPF2-GJAHR.
    IT_BKPF2 internal table having -- BUKRS - LT01
                                                         BELNR - 6400000061
                                                         GJAHR - 2009.
    And in BSIS database  table  -- 3 entries are there for the above documnet.
    But, in my internal only one entry has come for the same above document.
    I think For all entries stmnt. is not running properly. But Why it's not running properly.??
    What would be the reason..??
    Thanks in advance....!!
    Regards,
    Poonam.

    >
    Poonam Patil wrote:
    > Hello experts,
    >           In my report program, I write one query on table BSIS.
    >
    >          Internal table declaration -             
    >                                            
    >        DATA : BEGIN OF DLC_BSIS OCCURS 0,
    >                         BUKRS LIKE BSIS-BUKRS,
    >                         GJAHR LIKE BSIS-GJAHR,
    >                         BELNR LIKE BSIS-BELNR,  
    >                         SHKZG LIKE BSIS-SHKZG,
    >                         BSCHL LIKE BSIS-BSCHL,
    >                         AUFNR LIKE BSIS-AUFNR,
    >                         HKONT LIKE BSIS-HKONT,
    >                         QSSKZ LIKE BSIS-QSSKZ,
    >                         DMBTR LIKE BSIS-DMBTR,
    >                    END OF DLC_BSIS.                                                                               
    >                           
    >          Query as follows --
    >
    >          SELECT BUKRS
    >                        GJAHR
    >                        BELNR
    >                        AHKZG
    >                        BSCHL
    >                        AUFNR
    >                        HKONT
    >                        QSSKZ
    >                         DMBTR FROM BSIS
    >                                   INTO TABLE DLC_BSIS
    >                                  FOR ALL ENTRIES IN IT_BKPF2
    >                                  WHERE BELNR = IT_BKPF2-BELNR
    >                                               AND BUKRS = IT_BKPF2-BUKRS
    >                                               AND GJAHR = IT_BKPF2-GJAHR.
    >
    > IT_BKPF2 internal table having -- BUKRS - LT01
    >                                                      BELNR - 6400000061
    >                                                      GJAHR - 2009.
    >
    > And in BSIS database  table  -- 3 entries are there for the above documnet.
    >
    > But, in my internal only one entry has come for the same above document.
    >
    > I think For all entries stmnt. is not running properly. But Why it's not running properly.??
    > What would be the reason..??
    >
    >
    > Thanks in advance....!!
    >
    > Regards,
    > Poonam.
    include the buzei field in selection criteria i have faced the same situation earlier.
    always select all the key fields.
    varun

  • Gimp will not run properly

    I just purchased a 24 inch Imac and Gimp will not run properly. I have the latest system updates and firmware. Gimp starts X11 and appears to load, but the only item visible is the Gimp menu, none of the tools. It shows as running in the dock.
    If I try to open a graphic with Gimp, it loads but the graphic is not visible and only the Gimp menu is visible in the menu bar. It shows up as running in the dock.
    It works fine on a G4 quicksilver. I have the latest version 2.2.11
    Thanks,
    Fran
    IMAG INTEL   Mac OS X (10.4)  

    Hello Francis,
    Did Gimp ever load properly? On first load, it should have gone through an installer within X11. Also, I've noticed that my image windows start up hidden. There also may be a bug in which clicking on the Gimp app icon in the dock itself won't bring the windows forward, so you have to use the X11 icon instead. Try using Expose to show all windows in all applications to see if they've opened but sort of "off-screen."
    It could be a bad installation, or it could be that somehow the toolbars and palettes, etc. in Gimp just never appeared. Check to make sure X11 is up to date as well. I'm currently running 1.1.3 with XFree86 4.4.0.

  • I have a copy of Web Premium CS3 which was installed on a Windows Vista PC.  I have a new Windows 7 PC and the installation disc will not run properly.  The installation begins and then asks for the CS3 disc to be inserted.  If I re-insert the CD I just g

    I have a copy of Web Premium CS3 which was installed on a Windows Vista PC.  I have a new Windows 7 PC and the installation disc will not run properly.  The installation begins and then asks for the CS3 disc to be inserted.  If I re-insert the CD I just get a message asking for the disc to be inserted.  any ideas anyone?

    Use the download version:
    Download CS3 products
    Mylenium

  • Captivate project not running properly on iPad

    Hello,
    I built a project using Captivate 7.0.  When I published the project, I checked both the SWF and HTML5 boxes so the tutorial would run on an iPad.  However, when I view the tutorial on the iPad, the tutorial does not run properly.  The pages do not advance (even though, in Captivate, I have the slides advancing automatically - not on mouse clicks), all of the bullets on a slide do not appear, and the narration stops in the middle of a slide and does not resume.
    Do you have any suggestions?
    Thank you,
    Sarah

    Hi Joel,
    I removed all bullet animations and re-published the project (I checked the "Force re-publish all the slides").  My tutorial runs on an iPad, without the slides hanging up.  It appears removing the bullet annimations solved that issue.  Thanks for the suggestion.
    However, neither my music introduction on the first slide nor my narration on subsequent slides comes in.  I confirmed I do not have "mute" on and that my volume is up.  Also, I confirmed the sound works by running the tutorial on my desktop. 
    Do you have any ideas?
    Thanks,
    Sarah

  • 'Mail" not running properly

    After updating to Lion (10.7.2), "Mail" will not run properly. For each of my accounts, either the incoming or outgoing servers go offline, and while I can access incoming mail (sometimes), outgoing is impossible. I have deleted and reinstalled all of my accounts. Doesn't help.
    Anyone else having issues?

    WHOA!!!!! meant to say "After installing LION...."!!!
    Sorry.....

  • FireFox auto updated to 6.0 this weekend and has not worked properly since. I have uninstalled and reinstalled. Made sure all windows componets were up to date and still no joy. Any idea? Windows 7, 64 bit, normal configfuration. It is extreamly slow.

    FireFox auto updated to 6.0 this weekend and has not worked properly since. I have uninstalled and reinstalled. Made sure all windows componets were up to date and still no joy. Any idea? Windows 7, 64 bit, normal configfuration. It is extreamly slow and never finishes loading ANY page.

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

  • SQL script runs under SQL Devoper, will not run under UNIX, SQLPlus

    I have a sql program I developed under the SQL Developer tool and it runs fine. I have ftp'd the sql to the Unix server and I am trying to run the same program under SQL Plus in unix. The program echo's back the line number that is the last line number in the code before the 'Exception' code in the program and it goes out into never never land.
    I can't figure out why this runs under SQL Developer but will not run under SQLPlus in Unix. Any ideas would be appreciated!!!!

    Assuming that the ftp process did not append any invisible characters(which it usually does) at the end of each line,
    did you put the '/' symbol at the end of your program before running in sql*plus
    something like
    begin
    end;
    /

  • Just loaded lion software.  Now java scripts will not run.  What can I do to fix this

    Just loaded my MacBook Pro with Lion 10.7.1 software.  Trying to add printer and the script does not work for loading the drivers and software for that printer.  It goes through the script then says it successfully loaded but asked me no questions about the load during the process.  It appears that the Java script passes right through.  Is there anything I can load to fix this problem.  I also tried to use my internet stick which loads software to select and use this stick.  It does not work either.  What can I do to fix this???

    Hi there,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    -Griff W. 

Maybe you are looking for

  • "no ipod connected" -- but it IS connected! Any thoughts?

    My nano was acting a little strangely -- when listening to music/podcast, I had lost the bar across the bottom of screen showing volume, duration of song, etc. So, I tried to update. I downloaded the updater (1.1.1), pressed the button to update my n

  • I cannot use maps in india, n thats shame for ios6

    I was trying to use maps on ipad2 and iphone 4, i was helpless to use it. Called up coustmer care and they replied ios6 is not feasible for india. Why? Fr the kind information of apple , india has the greater commercial market of phone users. I was a

  • Getting error  ORA-20001: FLEX-ID DOES NOT EXIST

    I am trying to load new jobs.. I have run the fnd_flex_val_api.create_independent_vset_value to load the values into the segments needed.. NREL HR Job Title and NREL HR Job Descriptor and the values are in there. I'm getting this in the hr_job_api.cr

  • Spell Checker in Projector

    Hi all, I've built an application and want to include a spellcheck function - If I have it as a web page based app, then no problem - I've got a cracking spellchecker application that works a treat. BUT because of the nightmare of deploying a web bas

  • Reinstalling PS Elements 6

    I am trying to reinstall PS Elements 6. I found that ver 8 would not work on my computer. When I insert my disc it looks like the installation starts and then it asks me to insert Disc 1. I only have one disc. When I reinsert that disc it still will