Why my DELETE not WORK with  BULLKCOLLECT ?

Cursor Cur_Del (p_AnoMes IN varchar2) IS
SELECT A.OBJECTID
FROM mytable A
WHERE A.YEAR_MONTH = p_AnoMes;
OPEN Cur_Del(p_YEARMONTH);
LOOP
          FETCH Cur_Del BULK COLLECT INTO v_obj_tab LIMIT 200;
          FORALL i IN 1 .. v_obj_tab.COUNT
          DELETE FROM CIRCUITSOURCECUSTCLASS_DB WHERE OBJECTID = v_obj_tab(i);
          COMMIT;
          EXIT WHEN Cur_Del%NOTFOUND;
END LOOP;

SQL> create table mytable
  2  as
  3  select l objectid, '20060' || to_char(mod(l,2)+1) year_month
  4    from (select level l from dual connect by level <= 1000)
  5  /
Tabel is aangemaakt.
SQL>
SQL> create table circuitsourcecustclass_db
  2  as
  3  select l objectid from (select level l from dual connect by level <= 1000
  4  /
Tabel is aangemaakt.
SQL>
SQL> create type muttleychess_type as table of number;
  2  /
Type is aangemaakt.
SQL>
SQL> select year_month,count(*) from mytable group by year_month
  2  /
YEAR_MONTH
                              COUNT(*)
200601
                                   500
200602
                                   500
SQL>
SQL> select count(*) from circuitsourcecustclass_db
  2  /
                              COUNT(*)
                                  1000
SQL>
SQL> declare
  2    Cursor Cur_Del (p_AnoMes IN varchar2)
  3    IS
  4    SELECT A.OBJECTID
  5    FROM mytable A
  6    WHERE A.YEAR_MONTH = p_AnoMes;
  7    v_obj_tab muttleychess_type;
  8  begin
  9    OPEN Cur_Del('200601');
10    LOOP
11      FETCH Cur_Del BULK COLLECT INTO v_obj_tab LIMIT 200;
12      dbms_output.put_line(v_obj_tab.count);
13      FORALL i IN 1 .. v_obj_tab.COUNT
14      DELETE FROM CIRCUITSOURCECUSTCLASS_DB WHERE OBJECTID = v_obj_tab(i);
15      COMMIT;
16      EXIT WHEN Cur_Del%NOTFOUND;
17    END LOOP;
18  end;
19  /
200
200
100
PL/SQL-procedure is geslaagd.
SQL>
SQL> select count(*) from circuitsourcecustclass_db
  2  /
                              COUNT(*)
                                   500So it seems to work.
A couple of remarks:
- Please change the datatype of p_AnoMes to a date or maybe a number
- Please post everything next time, because we can only guess what exactly does "not work" with your example.
Regards,
Rob.

Similar Messages

  • Why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    Facetime only works via WiFi. Are you trying to set up Facetime with a T-Mobile account?

  • Why RSS does not work with my OS X 10.8.2?

    Why RSS does not work with my OS X 10.8.2? There was no problem before the upgrade to the Mountain Lion.

    By clicking on the RSS icon I'm getting a message:
    "No RSS reader is installed. Safari can't open the feed because Safari can't display RSS feeds"
    In Chrome I get xml file of the RSS site.
    Should I buy something what I didn't need with the Snow Leopard?
    Thanks for your help.
    Message was edited by: PZA22

  • Why is scrolling not working with multiple youtube embeds layed out vertically in a stack on one page?

    Why is scrolling not working with multiple youtube embeds layed out in a stack on one page?

    Hi ,  
      This is a sort of performance issue , because your program takes more than the max time set for the program to execute in foreground.
    There are many stuff in program which will hamper your performance.
    I will list down a few
    1. SELECT *
    FROM konp
    INTO CORRESPONDING FIELDS OF TABLE konp_itab
    FOR ALL ENTRIES IN a363_itab
    WHERE knumh EQ a363_itab-knumh
    in this statement you are using for all entries a363_itab , but before this statement you are not checking if the table has any entry or not , please do remember that for all entries has this characterstic , that if you internal table does not contain any record , then all the records are selected from the database table. So in this case if you table a363_itab is empty , so what you want is no data must be seelcted from table konp , but what will happen is all the records in KONP will be seelcted.
    2. While retreiving data you are using seelct * even though you do not require all the fields , an example is
    <b>SELECT *
    FROM mkpf
    INTO CORRESPONDING FIELDS OF TABLE mkpf_itab
    FOR ALL ENTRIES IN mseg_itab
    WHERE mblnr EQ mseg_itab-mblnr.</b>
    in this your internal table contains only 2 fields
    <b>mblnr LIKE mkpf-mblnr, "Number of Material Document
    bldat LIKE mkpf-bldat, "Document Date in Document</b> , but to get these 2 fields you are selecting all the fields of the table.
    3. In select you are using into corresponding fields of table , it is not a good practice., so please avoidd it.
    Please understand that you must try to reduce the access to your database tables and try to keep it minimal , because this same thing may happen becasue data in DEV is very less compared to the volume of data in production , so a program working in DEV will take much more time in PRD if not written properly and may result in timeouts , as in your case.
    Please try to make chanegs to the prorgam and see if it works.
    In case you have more queries , please do revert back.
    Regards
    Arun
    *Reward points if replay is helpful

  • Why i-tunes not working with the windows 8.1?

    i have windows 8.1 in my laptop,but i-tunes not working with it.when i connect my iphone with my laptop its not shown in itunes.
    can you please help me?

    See this support document. http://support.apple.com/kb/TS1538
    The latest version of iTunes works just fine with Windows 8.1.

  • Why does Thunderbird not work with Windows 8.1

    I have used thunderbird now for about 6 years, for all my website accounts. During that time I have had very few problems, about 9 months ago I started using Windows 8, I transferred all my accounts from my old machines running on XP pro to new machines running Win 8 and thunderbird ran ok. I have auto updates running so I am assuming both thunderbird and windows are updating whenever! About 4 weeks ago I started experiencing major problems with Thunderbird, it would start then freeze, then it would start again then freeze, if I ran it in safe mode it would work for a while. Now it opens and freezes, the message at the top just says ' Thunderbird is not responding'. Even in safe mode now it will not work! I have tried uninstalling and re-installing, I have even tried installing an earlier version of Thunderbird, I Have deleted the profile and forced it to produce a new one, I have spent hours trawling different sites trying to find an answer, and you know what, the only conclusion I could come to was, nobody seems to care whether this problem is solved or not, so reluctantly I have had to give up and I moved all my accounts to Outlook, which works perfectly with Windows 8.1. I think that should have been the answer, right from the start of the problem!

    The point is, it shouldn't matter if you're using McAffee or Norton or not using any anti-virus at all. Thunderbird works on XP. Thunderbird works on Vista. Thunderbird works on 7. But despite what the FAQ says, Thunderbird does _NOT_ work on Windows 8. This is a problem that many people are having and Mozilla _OUGHT_ to be able to fix it.
    I hate to bitch because Thunderbird is free and it's a damned good program. But this damned good program that worked through three earlier iterations of MicroSoft operating systems is unusable on 8.1. Anybody who has any knowledge of user experience can tell you that a program becoming unresponsive at random for anywhere from 1 to 3 minutes is simply not acceptable.
    This problem has been known for quite some time now. Is anybody in Mozilla support even looking at it?

  • +shift+ delete and +delete not working with external keyboard...

    Most of the time, when I try to send a file to the trash or empty the trash using the keyloard shortcuts, it will only work if I use my laptop keyboard but not my external apple keyboard hooked up to it. Ocassionally it will work with my external keyboard, but most of the time it wont.
    Does anyone have similar problems to this or know how to fix it?
    Thanks in advance!
    -Isaac
    MacBook   Mac OS X (10.4.7)  

    The only other thing I can think of is that the Finder can sometimes be slow in updating its view of reality. This is a perennial gripe about OSX. So maybe the issue is not the keyboard, but the Finder itself. Are you a fast typist? Try taking 3 deep breaths before using these key combos the next time you try to delete. Maybe that will let the finder catch up.
    I only suggest this because, otherwise, the problem is pretty inexplicable.

  • Why is bonjour not working with my mac computer and hp printer?

    Why is bonjour printing with my hp printer not working?
    I have a mac hooked up to an hp printer. i installed bonjour on my windows 7 laptop and it was able to install this printer via bonjour. yet when i click print on my laptop, nothing happens. on my mac, the printer queue doesn't open up and my printer does nothing.
    why does it say that it installed it if it doesn't work?
    thanks

    Printers not behaving? Reset them and start from scratch | MacIssues

  • Why is YouTube not working with Safari all the sudden?

    At first I thought it was a problem with YouTube's site because a lot of videos were not loading up (thumbnails). Then I noticed that I could not comment on a video, nor could I "Like" a video. I can't even logout either! I am still using Safari 5.1.10.
    I loaded up Youtube on my Firefox browser and it came right up! I could leave comments, logout and back in, like a video and share it on Facebook! So there is definitely something wrong with Youtube working with the Safari browser or perhaps mine is just outdated maybe?

    Hi ..
    YouTube content requires Flash.
    Open System Preferences > Flash Player then select the Advanced tab.
    Click Delete All under Browsing Data and Settings
    Not empty the Safari cache.
    From your Safari menu bar click Safari > Preferences then select the Advanced tab.
    Select:  Show Develop menu in menu bar
    Now click Develop from the menu bar. From the drop down menu click Empty Caches.
    Now try a video. If you still have problems, try troubleshooting Safari extensions.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.

  • Why is rtmfp not working with these parameters and functions?

    I wrote some basic functions in ActionScript in order to use RTMFP:
    import flash.events.NetStatusEvent;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.ui.Keyboard;
    private var serverAddress:String = "rtmfp://p2p.rtmfp.net/";
    private var serverKey:String = "xxxxx";
    private var netConnection:NetConnection;
    private var outgoingStream:NetStream;
    private var incomingStream:NetStream;
    private function initConnection():void {
        netConnection = new NetConnection();
        netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnectionHandler);
        netConnection.connect(serverAddress + serverKey);
    private function netConnectionHandler(event:NetStatusEvent):void {
        receivedMessages.text += "NC Status: " + event.info.code + "\n";
        //Some status handling will be here, for now, just print the result out.
        switch (event.info.code) {
            case 'NetConnection.Connect.Success':
                receivedMessages.text += "My ID: " + netConnection.nearID + "\n";
                break;
    private function sendInit():void {
        outgoingStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
        outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
        outgoingStream.publish("media");
        var sendStreamObject:Object = new Object();
        sendStreamObject.onPeerConnect = function(sendStr:NetStream):Boolean {
            receivedMessages.text += "Peer Connected ID: " + sendStr.farID + "\n";
            return true;
        outgoingStream.client = sendStreamObject;
    private function receiveInit():void {
        receivedMessages.text += "Initializing Receiving Stream: " + incomingID.text + "\n";
        incomingStream = new NetStream(netConnection, incomingID.text);
        incomingStream.addEventListener(NetStatusEvent.NET_STATUS, incomingStreamHandler);
        incomingStream.play("media");
        incomingStream.client = this;
    public function receiveMessage(message:String):void {
        receivedMessages.text += "Received Message: " + message + "\n";
    private function outgoingStreamHandler(event:NetStatusEvent):void {
        receivedMessages.text += "Outgoing Stream: " + event.info.code + "\n";
    private function incomingStreamHandler(event:NetStatusEvent):void {
        receivedMessages.text += "Incoming Stream: " + event.info.code + "\n";
    private function sendMessage():void {  
        outgoingStream.send("receiveMessage", toSendText.text);
    private function disconnectNetConnection():void {
        netConnection.close();
        netConnection.removeEventListener(NetStatusEvent.NET_STATUS, netConnectionHandler);
        netConnection = null;
    private function disconnectOutgoing():void {
        outgoingStream.close();
        outgoingStream.removeEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
        outgoingStream = null;
    private function disconnectIncoming():void {
        incomingStream.close();
        incomingStream.removeEventListener(NetStatusEvent.NET_STATUS, incomingStreamHandler);
        incomingStream = null;
    Notes:
    initConnection initializes the NC, sendInit initializes the send stream
    receiveInit initializes the incoming stream based on the far peer id which I copy paste intoincomingID.text
    I print every results into receivedMessages.text
    I do not have firewall, nor NAT.
    The Adobe sample application (http://labs.adobe.com/technologies/cirrus/samples/) works perfectly.
    The procedure I follow:
    Initialize NC on application 1. (sender)
    Initialize NC on application 2. (receiver)
    I initialize the sending stream (sendInit) on application 1.
    I copy the far peer id to application 2. and run receveInit.
    After this, I execute sendMessage() which reads the message from toSendText.text.
    Does not working. Why? What is wrong with my codes?
    Thank you for every helpful answer in advance.

    Jesus. I found out.
    I used to test the application on the same computer I am doing the development on, its a Mac (OSX 10.8.2, Chrome 24.0.1312.57).
    Later, I put it on Windows, to see if everything is okay. It worked.
    My RTMFP works on Windows, but not on Mac.
    It's strange.

  • Why google+ does not work with firefox?

    Google+ and google drive are not working right in firefox as before

    Thats because the old installed version of googletoolbar has a file named install.rdf that declares the max supported version of firefox to be 4.0.
    To fix this ,just open the install.rdf file with notepad and change maxVersion from 4.0.* to 6.* (see the image i've also uploaded)
    Now, in order to find the correct install.rdf file do the following:
    Go to folder :
    C:\Users\[your user name here]\AppData\Roaming\Mozilla\Firefox\Profiles\[sometext].default and search for the install.rdf file (im using windows 7)
    Windows search will find many install.rdf files (one for each addon you have installed on firefox)
    so make sure that you find the install.rdf that has the line
    <em:name>Google Toolbar for Firefox</em:name>
    in it.
    For this install.rdf file just rename the max version as stated above , restart firefox..and vualla! Google toolbar is back!

  • Why Skype does not work with the new OS for iphone

    Since I downloaded the new OS, skype for iphone does not work at all. Nobody can hear...

    Have you tried deleting the app then reinstalling it? If not, give that a try.

  • Why Roboform will not work with 4.0

    Roboform works fine until I installed Firefox 4.0. Now it will not work. Can 4.0 be made compatible with 4.0 like it is with previous Firefox versions?

    It is the other way actually. It is not uncommon for the Roboform toolbar to need to be updated for every new Major release however thankfully they do not do the need to update toolbar for every little minor update patch like they did in past and drove Rf users nuts.
    Actually the Roboform extension should work on Firefox 4.0 if you have the recent version though it is not problems free.

  • Why does hulu not work with ios5

    Just upgraded to ios5 on IPad.  Hulu does not work, any suggestions would be greatly appreciated

    http://itunes.apple.com/us/app/hulu-plus/id376510438?mt=8

  • Why does Skype not work with mavericks?

    I recently "upgraded" to Mavericks and find that several of my other applications no longer work...Great "UPGRADE" I think I know why it was offered FREE.

    Check with HP for new software, in the past after an OS upgrade I have had to delete the printer and re add it to get it to work. The upgrade to Mavericks this did not occur but it did when I upgraded to Lion and then Mountain Lion.
    If this does not fix it please start a new thread.
    regards

Maybe you are looking for

  • ODBC Problems with SQL Server 2012 on Virtual Machine

    I am having problem with my application after my IT department upgraded to SQL Server 2012 with error "ConngetDataToModify.vi:1"<ERR>Object 0x2222222 is not valid.  I have 4 servers running the same executable without problem before the upgraded. How

  • Photoshop elements 6 - some effects stopped working - Mac

    Photoshop Elements 6 - Mac - some of the effects that have always worked have stopped working.  i get a message that "command ..... is not currently available" This program was purchased online ... I have no discs to install it. From these forums, I

  • Time stamp to excel sheet

    I want to print time stamp every second to an excel sheet, tried 1000 of times to add row to the sheet but failed, any clue how to? Attachments: time stamp in a row.vi ‏67 KB

  • Why is the side of my MacBook cracked open?...

    I just realized....that the side of my MacBook has two cracks, the upper one is smaller and lower one is so big, I can see the inside.... is this normal? I've only had this for 2 years...should I glue it back or something? Thanks!

  • Flash CS3: Help panel too large to resize

    Hi! I feel quite stupid but... for some reason my Help panel is too large, making it impossible to scroll down to all the items. Here's a screenshot: http://tinyurl.com/2aycu4 When I open the Help Panel, e.g. by pressing F1 the grey header bar is flu