How to get out of a loop of 2 different conditions

Hello Experts

I'm writing a procedure in which I take the PROVINCE as an input parameter. All provinces are stores in a table. I use a cursor variable and rowtype to control the province. After I find province I displays its code and province. Everything works very well wait for me if I can't find the province. I don't know how to get out of the loop, if I can't find the province. I already use the output when the condition. I was expecting another condition should function and must break out of the loop, but it doesn't. Can you please someone show me how to get out if I can't find the province in the table through the cursor.

Here is my code

Set serveroutput on
variable G_TAX varchar2 (10)
CREATE OR REPLACE PROCEDURE p_create (i_state VARCHAR2) is
CURSOR cur_bb_tax is
Select * from bb_tax;
bb_tax_details bb_tax % rowtype;
Start
If it is cur_bb_tax % isopen then
Open cur_bb_tax;
end if;
loop
extract the cur_bb_tax in bb_tax_details;
If (bb_tax_details.state = i_state) then
dbms_output.put_line (bb_tax_details. State | bb_tax_details.idstate);
end if;
When the output bb_tax_details.state = i_state;
end loop;
close cur_bb_tax;

exception
while others then
dbms_output.put_line (SQLERRM);
end;

Thanks in advance

....
loop
extract the cur_bb_tax in bb_tax_details;

IF (cur_bb_tax%notfound) then  exit;END IF;

If (bb_tax_details.state = i_state) then
dbms_output.put_line (bb_tax_details. State | bb_tax_details.idstate);
end if;
....

SIM

Tags: Database

Similar Questions

  • I continue to be prompted to install Silverlight when it is already installed. Can someone tell me how to get out of this loop of promting?

    I am a customer of netflix and watching movies/TV shows on my PC.  I watched a lot of movies in the past and today he says I have to install Silverlight.  So I thought 'Ok, maybe the version of Silverlight, I have glitched somehow. "  So I uninstalled and reinstalled and it's the same thing.  Can someone help me on how to convince my compy that he already Silverlight and didn't need another?

    Hey Becca444,

    Thanks for posting in the Microsoft answers site!

    You get asked to install Silverlight on a particular Web page or all of the sites you visit?

    Try to visit http://www.microsoft.com/Silverlight and see if Silverlight content on this page will load for you. Currently this site will show a carousel app that shows a few sites that use Silverlight. If you go over it and right click on your mouse, you should see "Silverlight" in the right click menu.

    If you see a prompt to install Silverlight on the site:

    · Is it installed? If you are using Windows, check the applet of Control Panel programs and see if Microsoft Silverlight is listed as installed.

    · If it is disabled? See the modules of your browser menu (for example, in Internet Explorer click on tools-> manage add-ons) and if you find Silverlight in there, and it is disabled, enable it and I hope that you will be ready to go.

    · Something else? You might want to try another browser to see if it's the specific browser. You can also try the forums of installation & installation on http://Silverlight.net.

    If Silverlight works very well on the site of Silverlight but not the site you are trying to visit, you will probably have to contact the author of the site. If you are the author of the site or you are just curious to know what can be wrong, here are some things I've seen causing the quick loop infinite installation.

    Check out the link for more details below:

    Silverlight Blog of Bob Pomeroy: Why should I get invited to install Silverlight on some Web sites?

    http://blogs.msdn.com/rpomeroy/archive/2009/06/17/why-do-i-keep-getting-prompted-to-install-Silverlight-on-some-websites.aspx

    If Silverlight doesn't work for you, and you get errors, try to uninstall, reinstall or upgrade Silverlight, it may be due to a broken Silverlight installation. Check the link for more details cleaning a machine to fix a broken below Silverlight installation:

     

    Silverlight Bob Pomeroy's Blog: How to manually clean a broken Silverlight installation

    http://blogs.msdn.com/rpomeroy/archive/2008/06/10/how-to-manually-clean-up-a-bad-Silverlight-installation.aspx

     

    Also, see the below link for a similar problem:

    Get invited to install Silverlight

    http://forums.Silverlight.NET/forums/p/121625/301084.aspx

     

    I hope this helps!

    Gokul T - Microsoft Support

  • How to get out of a while loop?

    How can I get out a while loop?

    I'm new to Labview and I tried to make my first Labview program.

    I took an old example, a sieve to primes. The old Erasthotenes sieve.

    Similar to (Visual Basic example):

    While (l<= k)="" and="" teiler=""><=>

    Teiler = TeilerArray (l)

    Hans,

    What you linked is for the loop FOR, that I had attached is for the WHILE loop.

    Only the type of the loop is different, but the concept or the logic is the same for both.

  • How to get out of the callback function key before it complete the LabwindowsCVI

    Hi all

    In my program I use the command button (called SCAN) to analyze the setting on the serial port. When I press SCAN button callback fuction starts to send command on the series for the scan on the serial port setting. There are 99 order send and read. It takes about 3 minutes. It works very well. Now, I want to stop scanning and exit the callback function that is called by the button SCAN. Now when I press the SCAN button that it completes all 99 recommend and control then come to the interface user. So I'm not able to stop and get out of this loop. Y at - it a why to exit this loop if the user wants to get out? otherwise it will finish the scan.

    -Vishnu

    Hello

    I'll give you 3 options:

    1. If you want to go programaticly you can use simple break when stopping 'event' occur.

    2. If you want to go with a Cancel button, you can use this post:

    http://forums.NI.com/T5/LabWindows-CVI/few-general-CVI-questions-how-the-compiler-works/m-p/1440984

    where I already asked that it is not the recommended option for the panels.

    3. the best option is to use the multi threading separate each button in thread...

  • I have a new laptop and I am a newbie on the laptop. I inserted a cd but now how to get out? Of course it is obvious on the desktop what do, but not on laptop.

    I have a new laptop and I am a newbie on the laptop. I inserted a cd but now how to get out? Of course it is obvious on the desktop what do, but not on laptop.

    Well, no, actually, I talked to someone at Microsoft and he discovered for me. The answer is the keyboard on the top right of my keyboard and the third button on the end. Worked like magic.     Thanks again!

  • I have a wireless optical mouse and I can't remove the usb of my laptop Gateway receiver. It is stuck there. How to get out?

    I have a wireless optical mouse and I can't remove the usb of my laptop Gateway receiver. It is stuck there. How to get out?

    Hello

    The unit just has USB slide out. If it is stuck, consult with a real computer store (the one that makes
    his own service in the House and not leeks and glances at a Best Buy or other stores) or gateway
    supported.

    Gateway drivers and downloads
    http://support.gateway.com/support/drivers/dlcenter.asp

    Technical support Gateway
    http://support.gateway.com/support/?cmpid=topNav

    Door Documents
    http://support.gateway.com/support/SUPINFO/index.asp?cmpid=topNav

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How to get out computer safemode?

    How to get out computer safemode, troubleshooting says to many programs open in the start menu

    Hi kristi,.

    First of all, to deal with the programs at startup, click on start / all programs / accessories / run and type msconfig.exe, and then enter.  Go to the Startup tab and uncheck everything what you don't need from start (most is not necessary, but simply useful, but if not checked periodically it can accumulate over time).  You need your antimalware program and virtually all the rest of the list is optional (but some may be required for your system, so be a little careful, but if you uncheck something you really need and find out later, you can always go back and check again isn't a big concern). This only in the start, for now tab.  Click OK when finished.

    Now, to go out to start in safe mode, while remaining in msconfig, go to the Startup tab and uncheck the box Mode safe if it is checked.  If this isn't the case, then what you deleted should if all goes well do the trick.  When I did that the first time, I have removed more than 90% of what was there and there was no effect on me whatsoever - and not only the startup and shutdown to happen more quickly, but my computer run faster while working as well and the Task Manager showed a dramatic drop in CPU utilization and memory.

    Restart now.

    When you first restart, you get a screen asking you how you want to start.  Choose the Normal Boot or Normal Mode or something like that, said like that (NOT Mode without failure or something).  You need to start normally and this should solve the problem.

    If this does not work, then come back and tell me your exact version of Windows (32-bit Vista Business SP2 - and Yes, much more in detail) and we will try a clean boot troubleshooting procedure to try to find the culprits causing the problem - but I hope it won't be necessary.

    I hope this helps.

    Good luck!

  • How to get out the mode safe mode with msconfig.

    I'm working on my computer and need to start in safe mode. I ran the msconfig and reboot the laptop. I get to the login screen, but when I get my username and password it tells me that the user name and password is not correct. How to get out the mode safe mode with msconfig.

    When you run msconfig to get set to Safe Mode, you just activate/check the option/SafeBoot at startup. INI tab or did you do something else?

    There is some malware that if you use the/SafeBoot option, you will not be able to use your system again until you remove the switch/SafeBoot the boot.ini for you can boot normally.

    Maybe it's not your exact problem, but I will never suggest to anyone to use the option / SafeBoot never again - too risky when troubleshooting since you can always start new or will never connect again until you remove the switch/SafeBoot.

    Anywho, if that's what you have done, you can start in the XP Recovery Console and then either make a new boot.ini file containing the switch/SafeBoot or simply rename the boot.ini file, you have something like boot.ini.old if you don't have a boot.ini file (I know it seems like a weird idea).

    In a single partition configuration, XP is not even a file boot.ini to boot.  XP will complain if there is no boot.ini file, but will always start very well without one (non-believers - try it!).

    After you get booted up and logged in, you can rename boot.ini.old in boot.ini and run msconfig to remove the option/SafeBoot, and never use it again.

  • I had a virus that says that the FBI caught me downloaded inlegal stuff a fine of 72 hours or there would be charges pressed against me and I don't know how it get out!

    I had a virus that says that the FBI caught me downloaded inlegal stuff a fine of 72 hours or there would be charges pressed against me and I don't know how it get out!  Whenever I turn on my computer it pops up and I can't do anything! Sometimes I can go and get online! If anyone knows how to remove it please help me!

    What you are investigating your pc with?  What anti virus?

    Some malware knows how to avoid the standard as applications McAffee, Norton and Kaspersky, Avast.

    To be absolutely sure, you may have to reset it to the factory or clean install.  Make sure that you have a backup first.

  • How to get out of the UiApplication?

    Hello!

    Can u tell me pls, how to get out of the UiApplication. The deactivate method is sufficient for this.

    PLS, suggest me-

    System.Exit (0). Or close the last screen and call the application itself.

    Disable does something different:
    public void deactivate()
    Handles finishing event.

    The system calls this method when sending of this request in the background. By default, this method does nothing. Override this method to perform additional when processing sent in the background.

  • cartridges won't come out, says paper jam, how to get out of cartridges without killing printer.?

    cartridges aren't coming out,

    says paper jam, no paper in the printer,

    How to get out the cartridges without killing printer.?

    I did the thing video together 3 times and still won't come out? I'll call hp remote and hope they can fix it thank you

  • How to get out with renaming a file every time that I change it?

    How to get out with renaming a file every time that I change it?

    Since the last update, I have more the possibility to combine files. How can I recover this feature

    10 pro version

    For the first issue: disable the preview pane in Windows Explorer.

    Wednesday, July 15, 2015 to 18:46, keithf52379832 [email protected]>

  • Is there a way to re set Lightroom to the original settings, I've been playing with it and got somewhere that I don't know how to get out of... not particularly computer savvu

    Is there a way to re set Lightroom to the original settings, I was playing with it and has gotten, somewhere, I don't know how to get out of. Not very computer savvy

    For starters, stop Lightroom

    On Windows, do the following

    Click the Windows Start button and in the search box type: -.

    %AppData%\adobe\lightroom

    Then press Return\Enter

    This will take you to the folder Lightroom (see image below)

    Select the Preferences folder and click on delete to send it to the Recycle Bin.

    Close the Lightroom folder, and re-start the Lightroom program.

  • tried for three days trying to get this working and I've already tried some of the suggestions forum and it's just to try... so happy I don't have pais nothing yet. I get out the signed loop no matter what I try

    tried for three days trying to get this working and I've already tried some of the suggestions forum and it's just to try... so happy I don't have pais nothing yet. I get out the signed loop no matter what I try

    While in have you really tried? It's the standard solution, and it works in all cases that I have heard (including mine). Just rename the file, and a new one is created on the next launch.

  • How to get out the address book?

    When I choose a contact, I can return to the editField interface and as SUCH get set to the editField,

    but now if I didn't chosse contact, I want to return to the editField interface, it shows Nullpointer Exception.

    so, how can I get out of address book?

    showAddressBook my code:

    public void showAddressBook() {}
    try {}
    Contact list BlackBerryContactList = (BlackBerryContactList) BlackBerryPIM.getInstance () .openPIMList (BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE);
    Contact BlackBerryContact = (BlackBerryContact) contactList.choose (null, BlackBerryContactList.AddressTypes.EMAIL, true);
      
    Portable chain = "";
    int numValues = 0;
    numValues = contact.countValues (BlackBerryContact.TEL);
      
    for (int i = 0; i)< numvalues;="" i++)="">
    If (contact.getAttributes (BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {}
    Cell = contact.getString(BlackBerryContact.TEL, i);
    break;
    }
    }
             
    editField.setText (mobileNumber);
    } catch (PIMException ex) {}
    ex.printStackTrace ();
    }
    }

    If the user decides to not choose a contact, you get null as a return value. your code should check this.

Maybe you are looking for

  • YouTube videos

    Cannot play the videos sent to me via Gmail.

  • lost iPhoto 'events '.

    I lost all my events when I open iPhoto.  I know that the captain are still on my MacBookPro; I just believe that iPhoto some how is not the right place for them? How can I get the pictures back on the events when I open iPhoto?

  • Problem connecting Bluetooth with Windows Mobile Device Center

    Hello I have and HTC Snap with WM 6.1 I want to connect to my Satellite P500 running Windows 7 to be able to move the files by using Windows Mobile Device Center. I know that this device can talk to this laptop via bluetooth, because there are some u

  • I downloaded PC MightyMax and now I can't find Anywere to remove it. What can I do?

    I downloaded PC MightyMax and now I can't find Anywere to remove it. What can I do?

  • Keyboard replacement dv7-3165dx

    Hello My keyboard just die on my computer laptop dv7.  It is a dv7-3165dx (product WA794UA #ABA) with an AMD Turion processor. Anyone know what is the part number for replacement keyboard? I found a few opportunities but wasn't sure if they were righ