How to continue with the loop without breaking?

Hi people,
I wrote a simple procedure as follows
  create or replace procedure ploop is
 vsno number;
 vsal number;
 i number:=1;
  begin
 loop
  select sno,sal into vsno,vsal from x
 where sno=i;
  dbms_output.put_line(vsno||vsal);
 i:=i+1;
exit when i>10;
 end loop;
 end;

so at execution it gives me o/p as
SQL>  exec ploop;
11000
22000
33000
44000
55000
66000
77000
88000
99000
1010000
but now suppose if I delete a record in the table X.for example sno = 6 and then if I run the above procedure, then o/p appears in the form
SQL> exec ploop;
11000
22000
33000
44000
55000
BEGIN ploop; END;

*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "VIDS.PLOOP", line 16
ORA-01403: no data found
ORA-06512: at line 1
So what I need is that I need the loop should be continued without breaking and should display the o/p except the lack records.can u help me pls.?


Regarding
VIDS

try adding the exception like this

create or replace procedure ploop is
 vsno number;
 vsal number;
 i number:=1;
  begin
 loop
begin
  select sno,sal into vsno,vsal from x
 where sno=i;
  dbms_output.put_line(vsno||vsal);
exception when no_data_found then
  null;
end;
 i:=i+1;
exit when i>10;
 end loop;
 end;

Tags: Database

Similar Questions

  • Get the long Word to continue in the cell without break area

    Hello

    I create a table that includes some codes that are a long string of characters. It would really help I could say the text to just continue in the round and fit into a cell in a table, without having to type a space (which would change the meaning and the appearance of the code) or increase the width of the column.

    It happens naturally in Word:

    Screen Shot 2015-08-14 at 15.05.19.png

    does anyone know how to achieve this in Indesign, please?

    Hi Emma,

    You can try to format your text with the language: "[no language].

    Just like that:

    See you soon,.

    Uwe

  • Get-view FileManager = vCenter only? How to interact with the data without her store?

    Hello

    I am trying to create a folder directly on a data store and copy a vmx file.  What I've read I need to use Get-file manager mode, but this seems to be only available on vCenter.

    Is there anyway to interact with the data using PowerCLI store when it connects directly to a box of ESX?

    Thanks for your help,

    KeV

    The shortcut notation

    Get-View FileManager
    

    is not available when connected to an ESX host.

    But you can get the object as follows

    Get-View (Get-View ServiceInstance).Content.FileManager
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Move items outside of loops without breaking the threads

    Hi all

    is it possible to spend a few elements and their son outside a loop without breaking the connections? He became a real pain when you have more items to move and reconnect everything one by one.

    Thank you very much!

    Today, there is no option to do this directly. Which would probably require less work is to detach the buckle, move objects and then draw the loop again, but it would depend on the amount of work is required to configure the loop (shift registers, etc.). You will probably be able to write script code to do this (or to move the code outside the loop and rewiring it), but I expect that the work required to write and test the code will be larger than the work required to do this. You could do a search for the Quick Drop 'remove and rewiring' plugin to see how it works, as it does part of the work.

    A few years ago, NEITHER showed a demo of an experimental tactile editor who had this behavior integrated, if at least they are aware of him and maybe you will see in BT at a given time.

  • I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    -It used to work and for some reason, now it does not work

    Greetings, d_chiuch1104,

    There is one thing that I know that you need to check that COULD be your problem.  Open Control Panel (in Classic view) and click Folder Options (or, in Control Panel, click on appearance and personalization and then Folder Options).

    Open the view tab and make sure that "Always show icons, never thumbnails" is NOT checked.

    It would be good to hear from you as to whether that was the problem!

    GL - Bob

  • I downloaded red CS6 plugin and added to the contents of the package, replaced the existing files with the new without saving, now my thumbnails images RED and the color correction do not WORK! How to bring back my old file importerRed! ?? Help!

    I downloaded red CS6 plugin and added to the contents of the package, replaced the existing files with the new without saving, now my thumbnails images RED and the color correction do not WORK! How to bring back my old file importerRed! ?? Help!

    Try asking in the forum Premiere Pro seems to be an Adobe first Pro Lab

  • How to 'continue' a 'while' loop using an "if"?

    I have a loop 'while' continuous operation, by taking a step at each iteration. In each such iteration I save this measure unique to the file AND display it on a chart. From time to time, I have "out-of-range" measures, which are displayed as 1E-37 or 1E + 37 on the graph and poured on the record, and are not relevant (for me, it is). With the help of a simple interpreter, like python, I could use an 'if' statement to check if the reading is indeed irrelevant and if so, 'continue' in the loop 'while' so that it stops the current iteration and starts a new.

    How we not implements such a thing in LabVIEW?

    Thank you

    Amit

    Hi Amit,

    There was no 'cynicism', not at all! You ask a few notions of LabVIEW base so I suggested where to find that...

    "but this would require having wrap all code inside the"while"loop."

    OK, then you should explain the difference of a IF/THEN construct textual languages. Made a simple

    IF test

    {do something here}

    ON THE OTHER

    {do something here}

    not wrap the code inside a structure?

    A CASE structure does exactly the same thing and I don't see anything more simple as followed by comparison of two cases. What is complicated in a case around another structure design code?

  • How do I change the store without payment

    How can I change the store without payment?

    How can I return my app purchases after change store?

    Thank you for helping

    1. you can not. It is a security measure to prevent people to arbitrarily change the country.

    2. open a session in the iTunes App Store with the same Apple ID, go to the application page and choose to buy it. you realize that you have purchased the app and will not charge you again. This does not apply to music and video purchases.

    (144368)

  • The procedure of procurement of the game Clash of Clans first two payments $9.99 $4.44 and the second did not gems continued with the developer of the game and they told me to resolve this ongoing problem with Apple's iTunes... help me solve

    The procedure of procurement of the game Clash of Clans first two payments $9.99 $4.44 and the second did not gems continued with the developer of the game and they told me to solve this problem continue with Apple iTunes... help solve me this problem and the compensatory jewelry

    Double-see your message, my first response to this topic tells you how to contact iTunes Support (we are fellow users): Re: the procurement process of the Clash game Clans the amount was deducted from the iTunes account and do not have t...

  • How to communicate with the gsm using lab view

    Please, someone tell me about the following uncertainties:

    1 can anyone tell me about the GSM part in lab mode?

    2. how to communicate with the GSM using lab view?

    3. how to publish my data through GSM using lab view?

    4. how to use ipod to send data to laboratory?

    5. what a DAC suitable for ipod?

    6. how to install the lab for ipod DAC mode?

    without worrying

    FR. mohammad rehan

    rehan_the_great wrote:

    Can u please tell me the minimum requirement of computer (labtop) for the use of labview, like ram size, HARD drive, map chart etc...

    A simple search for "labview requirements" on this site would have given you the information you want.

    http://www.NI.com/LabVIEW/requirements/

  • Why is the Table in the loop without delay time flashing

    Hello everyone

    Why I put Table in the loop without any delay, the front table still flashes?

    How can I avoid this situation?

    This situation is related to the level of the PC?

    Hello

    This problem was presented as a request for corrective measures, several years ago although there always seems to be involved.

    Sometimes this is because the table is constantly updated, but at a slow pace, enough to be visible. If you place a Boolean button on the table on front panel indicator and make transparent (I used a Cancel button that uses a locking mechanism when released), this will force off update screen and flashing minimum.

  • the start-up of the pc have to press F1 key to continue with the load upward,

    the start-up of the pc have to press the F1 key to continue with the load upward, then when the desktop is in place, the date and time is always set to December 2004. Tried to restore to a point without risk, but it makes no difference.

    Sounds like the battery RTC (aka aka backup battery BIOS battery) must be replaced.

    On most computers, it's easy and inexpensive (generally, the battery is a CR2032 available in your local corner store).

    On other computers, however (including portable computers), the procedure can be a little more difficult and/or the battery may be more expensive and only available online.

    What is the make and model (very important - require the label if you have a loptop) from your computer?

  • I want to format my hard drive to start over but I do not have the windows installation disc. How can I reinstall the pack without the disks after I cleaned the system?

    Resettlement without disks

    Hello. I have a computer bought from a friend with windows vista home premium installed. I want to format my hard drive to start over but I do not have the windows installation disc. How can I reinstall the pack without the disks after I cleaned the system? Thank you, Kim

    Hello. I have a computer bought from a friend with windows vista home premium installed. I want to format my hard drive to start over but I do not have the windows installation disc. How can I reinstall the pack without the disks after I cleaned the system? Thank you, Kim

    You have a hard drive partition to do - but you would need to contact/see the FAQ from the hardware manufacturer (HP, Dell, Gateway, Lenovo, etc) to see if and how.

    Otherwise - you might have to order (pay for possibly) the factory restore/recovery of the value of the manufacturer.

    http://www.ZDNet.com/blog/Bott/lost-your-Windows-discs-how-to-get-replacement-media-legally/4320?tag=nl.E539

    If it was built * friend *, you will communicate with them.  Ask your media.

  • How can I reinstall the CC without having to start a new account after a hard drive change?

    How can I reinstall the CC without having to start a new account after a hard drive change?

    Just got my PC back from repair with a new drive installed and al, I see for the CC options for new accounts to create, I already have one so I want to reinstall my account without having to pay for a new account.  Can someone tell me how to do it please?

    Hello

    Please visit the given link to download CC: download and install Adobe Creative Cloud applications

    * Connect with your Adobe on which you have registered the product ID.

    Concerning

    Bianka Attre

  • Need help with the numbers without decimal separator

    I have a number such as 6711.00425532, how can I get the 6711 without this number rounded upwards or downwards. In other words, I don't like with any number after the period, all I need is either the number before the period, as is.

    If the number is 23.02345, I need to get all 23

    If the number is 344.985430, I need just the 344

    Is this possible?

    BYJ_wntrsnt wrote:

    I have a number such as 6711.00425532, how can I get the 6711 without this number rounded upwards or downwards. In other words, I don't like with any number after the period, all I need is either the number before the period, as is.

    If the number is 23.02345, I need to get all 23

    If the number is 344.985430, I need just the 344

    Is this possible?

    Difficulty there.


    Fix (6711.00425532): #fix (6711.00425532) #.

    Fix (23.02345): #fix (23.02345) #.

    Fix (344.985430): #fix (344.985430) #.

    Fix(-6711.00425532): #fix(-6711.00425532) #.

    Fix(-23.02345): #fix(-23.02345) #.

    Fix(-344.985430): #fix(-344.985430) #.

Maybe you are looking for