Problem while Generating premium no help break statement

Hello

I want to create a stored procedure that has an input parameter and it will check and display the entry of prime number
until the number of 1. also can someone please tell me what is the keyword "break" equivalent in oracle such as used in the other programming language.


My procedure is like:


create or repalce procedure premium (newnum in number)
is
i the number: = 2;
number num: = 1;
Start
while(newnum>num)
loop
while(i<newnum)
loop
If mod (newnum, i) = 0
then
dbms_output.put_line ('not a premium no');
break;................................................... Can I use like this?
end if;
on the other
i: = i + 1;
If I = num
then
dbms_output.put_line ('bonus no.' | newnum);
break;
end if;
end loop;
newnum: = newnum-1;
end loop;



can someone plese help me solve this problem.


Thank you
Madam.

Check this box:

SQL> ed
Wrote file afiedt.buf

  1  DECLARE
  2  v_num NUMBER := &1;
  3  v_prime_flag NUMBER := 0;
  4  BEGIN
  5  FOR I IN 1..v_num LOOP
  6  FOR J IN 2..TRUNC(I/2) LOOP
  7  IF (MOD(I,J) = 0) THEN
  8  v_prime_flag := 1;
  9  EXIT;
 10  END IF;
 11  END LOOP;
 12  CASE (v_prime_flag)
 13  WHEN 0 THEN
 14  DBMS_output.put_line(I ||' is a prime Number');
 15  WHEN 1 THEN
 16  DBMS_output.put_line(I ||' is not a prime Number');
 17  END CASE;
 18  v_prime_flag := 0;
 19  END LOOP;
 20* END;
SQL> /
Enter value for 1: 10
old   2: v_num NUMBER := &1;
new   2: v_num NUMBER := 10;
1 is a prime Number
2 is a prime Number
3 is a prime Number
4 is not a prime Number
5 is a prime Number
6 is not a prime Number
7 is a prime Number
8 is not a prime Number
9 is not a prime Number
10 is not a prime Number

PL/SQL procedure successfully completed.

SQL> /
Enter value for 1: 20
old   2: v_num NUMBER := &1;
new   2: v_num NUMBER := 20;
1 is a prime Number
2 is a prime Number
3 is a prime Number
4 is not a prime Number
5 is a prime Number
6 is not a prime Number
7 is a prime Number
8 is not a prime Number
9 is not a prime Number
10 is not a prime Number
11 is a prime Number
12 is not a prime Number
13 is a prime Number
14 is not a prime Number
15 is not a prime Number
16 is not a prime Number
17 is a prime Number
18 is not a prime Number
19 is a prime Number
20 is not a prime Number

PL/SQL procedure successfully completed.

SQL> /
Enter value for 1: 12
old   2: v_num NUMBER := &1;
new   2: v_num NUMBER := 12;
1 is a prime Number
2 is a prime Number
3 is a prime Number
4 is not a prime Number
5 is a prime Number
6 is not a prime Number
7 is a prime Number
8 is not a prime Number
9 is not a prime Number
10 is not a prime Number
11 is a prime Number
12 is not a prime Number

PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • Problem while generating a pgm on JDE

    Hi guys, I got this error when I clicked on "building together and run" option in JDE. It currently shows following error

    Building HelloWorldProject
    H:\Program Research In Motion\BlackBerry JDE 4.6.0\bin\rapc.exe-silencieux import =... name of code \lib\net_rim_api.jar = HelloWorldProject HelloWorldProject.rapc warnkey = 0 x 52424200; 0 x 52525400; 0 x 52435200 "H:\Program Research In Motion\BlackBerry JDE 4.6.0\bin\HelloWorld.java"
    I/o Error: Cannot run program "javac": CreateProcess = 2 error, the system cannot find the file specified
    Error while building project

    until now, I have done projects in NetBeans IDE, but now I have decided to spent at BB JDE, and I'm new to this envoirment JDE, then I decided to get an idea of the development using the JDE, but it shows what could be the error

    Concerning

    Rakesh Shankar.P

    Please mark this topic as resolved..., new questions, you can start a new Thread...

    in any case, here are answers to your questions according to my knowledge

    (1) you can see your outputs in the Debug tab...

    (2) it's basically connect your JVM Simulator & do some process more to connect your JDE Simulator in debug mode, according to my knowledge... So I dnt think so you can remove it. Without connecting to your JAVA virtual machine, how you can run your program on Simulator...

  • Windows Media Player does not. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. »

    Original title: Windows Media Player does not

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    I have Windows XP Professional and have tried playing the CD through Windows Media Player. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. "Then I do. Nothing here helps me. The player shows all my music but puts little red x showing that he can't play. Help! I downloaded version 11 of Windows Media Player, but it is saying the same thing.

    Thank you.

    Hello

    1. don't you also get an error with the message code?
    2 have you installed third-party readers part?
    3. What is the format of the files you are trying to play?

    Follow these steps and check if they help.

    Step 1:

    I would have you readers of third party temporarily Uninstall and check if persists it to the question.

    Step 2:

    Most likely you need codecs to play these files with Windows Media Player. I suggest looking up codec in the Internet that supports the file format, download and install them.

    See also:

    Player Windows Media for Windows XP supported Codecs

    WARNING OF THIRD PARTY
    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    See also:

    Windows Media Player Error Message help

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • Error when you try to play multimedia files: Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web

    ERROR: Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web.

    I get the error Windows Media Player 11.0.6001.7007.  "Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web frequently. "What happens on the music or video files even those I had on my PC for a long time.  They work some days and other days they don't.  I have to reboot to clear it and it's really annoying. I can read a file and then 10 minutes later the same file will not play.  Sometimes after the error message, if I don't click Close, the video is not yet but the audio will not.

    I'm on a laptop HP DV5 with vista 32-bit and 4 GB memory such that shipped HP (Yes, 4 concerts and 32-bit).

    I don't know if it was related, but IE7 would continually fail to open, click on through the windows and should be completely closed.  essentially the WMV and IE are fails miserably on this laptop, and it was only 6 months old.  Firefox fixes my problem of browser.

    How can I fix this WMV as I can't UN/reinstall with Vista?

    I ran sfc/scannow after completion of the analysis, the results were that "windows resource protection finds corrupted but files could not solve some of them" gives then refers to where the cbs.log file is located. I tried to open the cbs log, and he says that access is denied.

    UPDATE: there seems to be a conflict between WMP and any other application that opens which can play the video with sound.  When I close firefox, and then the videos and sound can play (these same questions happened on IE7 and firefox was installed just yesterday).  I met the same problem with more than Pinnacle video editing software.  Is it possible to change a parameter with WMP as there is no sharing violation during a different application can play the video?

    SO thanks a lot!    I had to use the following steps to get your simple solution:

    1. Select Options under the button 'SYNC '.

    2. choose 'other Options '.

    3. click on the tab 'network '.

    4. only check box RTSP/TCP and HTTP and Multicast Streams allow the player Pourrecevoirun multicast stream (which meant I had to uncheck "RSTP/UDP"

    5. click on apply and take advantage of my windows media player.

    Thanks a lot wmd_user!

  • Error when you try to play .wmv files: Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web

    Will not play WMV video files

    I'm having a problem to play wmv. video files.  I have windows vista.  I can play music in Windows Media Player, but can not play any video, that is sent to me by e-mail.  WMP crashes and give a message saying that Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web.  I click web help and receive nothing.  The drivers are up to date.  Why I can't play videos? Thank you

    Hello Henry Michael,.

    Please relay the e-mail program you use.  You can also try to save the file directly on your local computer, and then check if the file is being read correctly. If there has been any recent codec package installation, you can also try to temporarily uninstall the codec package and then check out the question.

    Thank you

  • Right click to problems while playing Dota 2, please help.

    Separated from this thread.

    I have / had the same problem that I haven't played since May because of this. I couldn't find a solution. Did you ever fix it? I just tried to uninstall steam and reinstalled it and DOTA 2, maybe it'll work. I thought it had something to do with me upgrade to Windows 8.1 but I've seen on other forums of discussion where people have no problems with DOTA and Windows 8

    Hi Sam,

    Please provide us with the following information so that we can help you further the question:

    1. What is the brand and model of the computer?
    2. The question is specific to the game DOTA 2 or you experience this problem when you use Windows?

    Have you tried the steps in Aïssa B Ganesh of the next post on May 26,2013:

    https://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-hardware/right-click-problems-while-playing-DotA-2-Please/afb94ea2-5a89-48f4-B195-59d6eafee732

    If this isn't the case, please try and see if it helps.

    You can also run the troubleshooter to fix the problem, follow these steps to run the troubleshooter of material:

    1. Press Windows + C keys on your keyboard to show the charms.
    2. Troubleshooting type, and then click Troubleshooting under settings.
    3. Now, type Hardware Troubleshooter in the search option.
    4. Click the hardware store to run the troubleshooter.

    Hope this helps, get back to us if you need further assistance for Windows.

  • Windows Media Player encountered a problem while playing the file when Pinnacle Studio HD 14 is running

    Windows Media Player encountered a problem while reading file he when Pinnacle Studio HD 14 is running

    Hello

    I have Windows 7 Home Premium. I installed Pinnacle Studio 14 ultimate test. When the Pinnacle program works-

    a. when I run a WMV file there is no audio data.

    b. when I rang a MPEG 2 file (720 p, 25 frames per second) OR a file m2t, Windows Media Player is not able to read the file and gives the error: "Windows Media Player has encountered a problem when reading what he gives.

    c. when I close the program Pinnacle all right and WMP reads all of the above files correctly.

    I also recently installed and uninstalled Corel VideoStudio X 3 of the trial. First Adobe Elements 8 trial is also installed on the PC.

    I would be grateful yuour help solve the problem.

    Thank you

    Paresh

    Hello Paresh,

    The Pinnacle program is third party software that is causing the problem to occur. Pinnacle may be in conflict with your music files playing in Windows Media Player, that's why, I suggest you to contact pinnacle and check with them.

    Windows Media Player 12 is probably to use the codecs used by pinnacle, which may be the culprit.

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • Having problem while playing a game of Wow

    Original title: other for microsoft to scan my computer and find an im problems?

    started to have problems while playing a game of wow. starts fine then cant get in my articles, press Esc. but do not go to the minamizes inter face just, if I got to the laptop will not let me type anything

    Hi James,

     

    1. have you done any recent hardware or software changes to the computer before the show?

    2. What is the number of brand and model of the computer?

    Please follow the link and check with the question:

    Game hangs or quits unexpectedly:

    http://support.Microsoft.com/kb/303032

    Note: Also applies to non-Microsoft games.

    Important note: You must follow step 7 of the article mentioned above to recover the computer to Normal startup after you complete all the steps.

    The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    I hope this helps.

  • Why generate a system health report state I have no anti virus installed

    Why generate a system health report state I have no anti virus installed

    Hi Mark,

    -What antivirus is installed on your computer?

    I suggest to update the antivirus installed on your computer and check.

    Go through the steps mentioned in the Web site and check if this may help.

    Use antivirus software that Windows doesn't find

    http://Windows.Microsoft.com/en-us/Windows-Vista/use-antivirus-software-that-Windows-doesn ' t - search

    Let us know the results.

  • Error reading of disks: Windows Media Player has encountered a problem while playing the file

    Im having a prob. with my Media Player, everthing was working fine until about 15/04/2010.

    Im having a prob. with my media player from vista, everthing was working fine until about 15/04/2010. then all I get when I put a disc that worked before the time this message (Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web.)

    any thoughts?

    Hello SUNCITYDAVIS,

    ·         Remember to make changes to the computer (hardware or software) before having this problem?

    ·         Do you get this error during playback of all media files or any size of file in particular?

    ·         This happens when you play multimedia files stored on your computer as well?

    The error indicates that there could be some missing codecs for the file format, you are trying to play with Media Player.

    You can see the article that will give you information about the codecs:

    http://www.Microsoft.com/windows/windowsmedia/player/FAQ/codec.mspx

    Thank you
    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • Windows 7 - Windows Media Player encountered a problem while playing the file.

    WMP worked fine one day and then the other, it will not play any type of file.  I just get the error message "Windows Media Player encountered a problem while playing the file." with each trying to play any type of file.  It won't play video or audio files, even those she played a few days ago.

    Dano_TR: try to use system restore to restore to a point from before the problem started to happen, as I have suggested earlier in this thread.

    In addition, if you have any installed codec Pack, try to remove the. Uninstall iTunes and Quicktime could also help.

    Tim Baets
    http://www.BM-productions.TK

  • I'm attemppting to enter the programming unit to operate on an OUYA. I encounter this problem while fixing my game development environment.

    I'm looking to get into the programming unit and finally run that I develop on an OUYA. I encounter this problem while fixing my game development environment. At http://stevetack.com/ouya_unity_tutorial_01.html, I try to do this step:

    ------------------------------------------------------------------------------------------------------------------------------------

    Pull up the android_winusb.inf file in Notepad or your favorite text editor and add this section to both [Google.NTx86] and [Google.NTamd64] sections:

    ;OUYA Console
    %SingleAdbInterface% = USB_Install, USB\VID_2836&PID_0010
    %CompositeAdbInterface% = USB_Install, USB\VID_2836&PID_0010&MI_01------------------------------------------------------------------------------------------------------------------------------------
    

    He tells me that I can't change this in Notepad! It is of crazy! The truth is that I am God in my own digital universe. I am an administrator and my computer needs to be aware of this fact! This refers to an area of permission that I am not familiar with.

    Help, please.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)

    *
  • There is no sound in my computer and I also get the error "Windows media player has encountered a problem while playing the file" while trying to play audio in Windows Media Player.

    Original title: what is a possible cause for any audio?

    Whenever I try to play any type of audio file I get the error message "Windows media player has encountered a problem while playing the file." All of my audio is disabled, no notification sound, no in his game. All audio drivers are up to date and when I try to diagnose the problem, he told me that there is no problems found. It also gives me this error message when you try to play video files or listen to internet radio on the media player.

    Hello

    If I understand correctly, you are facing problem with playback of the audio files in Windows Media Player. I would like to know more information on the issue, so that we can help you better.

    1. have you made changes on the computer before this problem?

    2. is it works much earlier?

    Let us try the following methods and check if it works for you.

    Method 1:

    Run the troubleshooter in Windows Media Player.

    Open the troubleshooting Windows Media Player settings Troubleshooter

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

    Method 2:

    Try to re - register the files associated with Windows Media Player.

    a. Click Start, type 'regsvr32 wmp.dll"without the quotes into the search option and press ENTER.

    b. restart your computer later.

    Also see the following Microsoft to issue his No. article.

    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-sound-problems

    http://Windows.Microsoft.com/en-us/Windows/no-sound-help#no-sound=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Please reply with the status of the issue, so that we can better help you.

  • Facing problem while in place emphasis on the pop-up component interface user

    Hello team,

    Jdev - 12.1.2.0.0

    I am facing problem while emphasizing one of the UI element (af:inputtText) of pop - up to

    Scenario-

    I have a jsff page.

    On the page, I have a button and a pop up

    When you click the button, pop up comes with 10 text entry box. By default, his shows on the first field accent, but I want it to be on the second text box.

    I already have a client component to TRUE for the two input as well as pop-up text

    Please suggest me any hint/help

    Code: -.

    < af:inputText label = "#{ctapmainBundle.Accountno}" id = "pt_it2" "

    partialTriggers = "b11".

    value = "#{pageFlowScope.bannerFlowManager.Criteria.AccountNumber} '"

    autoSubmit = 'true '.

    Validator = "#{backingBeanScope.bannerFlowBean.validateAccountNumber} '"

    Binding = "#{backingBeanScope.bannerFlowBean.AccountNumber} '"

    clientComponent = "true" >

    < af:clientListener type = "keyUp" method = "enterKeyEvent" / >

    < / af:inputText >

    function setFocusOnAccount (event) {}

    Alert ('Hi');

    var component = event.getSource ();

    Alert (' component name ' + component);

    var characterCounter = component.getParent () .findComponent ('pt_it2');

    Alert ('characterCounter with Parent' + characterCounter);

    var characterCounterId = characterCounter.getClientId ();

    Alert ("text entry id ' + characterCounterId");

    characterCounterId.focus ();

    }

    Thank you

    Céline

    Hi guys,.

    I found the solution,

    I changed my customer contact on af:pop - up to earlier that I was calling from button makes part of the same page and he called client listener first and then pop up.

    If my goal is not to set to pop - up field.

    So now I'm able to get the focus on the pop-up field.

    Here's the code.

    function setFocusOnAccount(event) {}

    Alert ('Hi');

    var component = event.getSource ();

    Alert (' component name ' + component);

    var characterCounter = component.getParent () .findComponent ('pt_it2');

    Alert ('characterCounter with Parent' + characterCounter);

    characterCounter.focus ();

    }

    contentDelivery = "lazyUncached".

    popupFetchListener = "#{backingBeanScope.bannerFlowBean.searchPopupClearFields} '"

    popupCanceledListener = "#{backingBeanScope.bannerFlowBean.resetPopUpFields}" > "

     

    Thanks Dario, Ashish and Arun who helped me.

  • I am facing a problem while pay buy creative cloud this message appeared (there was a problem processing your order, please contact our Service team customer care for assistance)

    I am facing a problem while pay buy creative cloud this message appeared (there was a problem processing your order, please contact our Service team customer care for assistance), whatever?

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific time) <===> NOTE DAYS AND TIME
    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html
    -or by phone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

Maybe you are looking for