Is there any solution to this script

1 declare
2 i number(2):=1;
3 id number(2);
4 name varchar2(25);
5 begin
6 loop
7 id:=&id;
8 name:='&name';
9 insert into emp_ramu values(id,name);
10 i:=i+1;
11 exit when i>=5;
12 end loop;
13* end;
SQL> /
Enter value for id: 10
old 7: id:=&id;
new 7: id:=10;
Enter value for name: 20
old 8: name:='&name';
new 8: name:='20';
PL/SQL procedure successfully completed.
SQL> select * from emp_ramu;
ID NAME
10 20
10 20
10 20
10 20
This code asking me to supply the values for id and name only once, when i gave the values for id and name it is inserting 4 times (same values) into the table....Is there any way, so that this loop executes 4 times and asks us values four times?

Hi
Anonymous PL/SQL Block will be compiled only after all the input is provided. Once the execution started there is no possible way to stop in between.
U can accompish the work by the following code.( just another way )
Declare
i number(2) := 0;
Type ID IS Table of Number Index by Binary_Integer;
Type Name IS Table of Varchar2(50) Index by Binary_Integer;
Id_Table ID;
Name_Table Name;
Begin
Id_Table(0) := &a;
Id_Table(1) := &a;
Name_Table(0) := &b;
Name_Table(1) := &b;
Loop
Insert into emp_ramu( Id, Name ) Values ( Id_Table(i), Name_Table(i) );
i:=i+1;
Exit when i > 1;
End Loop;
end;
Regards
J Abdul

Similar Messages

  • In PC I have changed the default app location from default to other and copied the previous content to new location and changed the Default location in preference. Now in iTunes, my previous apps are not visible. Is there any solution to this?

    In PC I have changed the default app location from (c:/users/username/My Music/iTunes) to other (d:iTunes)  and copied the previous content to new location and changed the Default location in Edit preference. Now in iTunes, my previous apps are not visible. Is there any solution to this?

    wjosten - thanks very much for the detailed instructions. I'll try this as soon as I get my replacement and it looks like you'll probably end up getting the green tick

  • Primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    You are welcome.
    Sorting and organizing photos on IOS devices is one of the things that really need to be improved. It looks like the developers simply did not expect the users to want to keep large photo libraries on an IOS device, where the ordering would matter. I'd send feedback to the developer team, so that they see, what the users want and need:
    You can use this form:  Apple - iPhoto - Feedback

  • M having a macbook, after successful shut down it is booting up automatically is there any solution for this?

    M having a macbook, after every successful shut down it is booting up automatically. Is there any solution for this?

    There isn't a separate app icon for Facetime for the iPhone like there is for the iPad and iPod Touch.  Facetime is built into the iPhone's iOS.
    Here a refresher on how it works: 
    iOS:  Using Facetime, http://support.apple.com/kb/ht4319

  • TS4436 hi, when zooming in to capture still images, the image is really blurred and out of focus. is this a hardware issue and is there any solution for this?? or is my device faulty?

    hi, when zooming in to capture still images, the image is really blurred and out of focus. is this a hardware issue and is there any solution for this?? or is my device faulty?

    If you are using the iPhone camera zoom then remember that this is a digital zoom not an optical zoom. The zoomed in area will have fewer pixels and not appear as clear. The more you zoom the worse it gets. It's like cropping a picture after it has been taken.

  • I am having an iPad 4. I am not getting alerts while receiving any call in my ipad. Is there any solution for this?

    I am having an iPad 4. I am not getting alerts while receiving any call in my ipad. Is there any solution for this?

    Check your settings
    Settings>Notifications>FaceTime/Message>Alert Style

  • My boss is using Mac machine, whenever I send email from my windows machine he receives email as winmail.dat, is there any solutions for this ?

    My boss is using Mac machine, whenever I send email from my windows machine he receives email as winmail.dat, is there any solutions for this ?
    My boss is using Mac machine, whenever I send email from my windows machine he receives email as winmail.dat, is there any solutions for this ?

    Upgrading my work PC is NOT an option, but I'd like my Mac to be able to recognise the attachment for what it is
    Let see, you are using a proprietary file format that is only supposed to work with Outlook. It doesn't work for millions of Windows or Mac or Linux email users that depend on other email programs like Outlook Express, Thunderbird, Apple Mail, webmail, etc.
    Microsoft has had to publish instructions so that their program's users can make themselves compatible with the rest of the world.
    http://support.microsoft.com/kb/290809
    You are causing your own problem by not making a simple change in your program's options. Changes in the Outlook preferences can be made either Globally or by the Recipient.
    Follow these steps in Outlook 2007 to turn off TNEF:
    1. On the Tools menu, click Options.
    2. Click the Mail Format tab.
    3. In the Compose in this message format box, click Plain Text or HTML, and then click OK.
    Don't know of a better way to fix this problem for everyone concerned. Even if you get the fix to work with your machine, you will not enable all of the people receiving your emails to be able to work with you. That's a losing battle that's been caused by Microsoft.
    Now if Microsoft created a Mail plugin for other email programs like they do for their video format's and services (flip4mac, Office Live Plugin, etc), then I would consider using their email program to deal with my clients. Until then, I need to be compatible with many different programs in other countries, on different platforms. Maybe that's going to change when they bring out the new Office 2011 with Outlook for the Mac...

  • IOS 7 is working very slow in iPhone 4. is there any solution for this

    iOS 7 is working very slow in iPhone 4. is there any solution for this

    I have noticed that speed of operation improves after a shut down of the phone and then start up
    Cheers
    Lory

  • All of suden I can't open email in my mail box...When I get new mail , I click to open that email and mail software quit...is there any solutions for this

    I having problem with emails on my I mac...A few days ago I got email and when I tried to opet to read it mail quit...And from then it is happening all the times...i can't open email in mail ,, anymore...Is there any solutions for this

    See:
    *https://support.mozilla.org/kb/Changing+the+e-mail+program+used+by+Firefox
    You can look at the network.protocol-handler.external.mailto prefs on the about:config page.
    *http://kb.mozillazine.org/about:config
    If network.protocol-handler.external.mailto prefs are user set (bold) then right-click and Reset them to the default value.<br />
    You can also try to change the network.protocol-handler.warn-external.mailto pref to true.

  • My iPod Touch 4G (black) is constantly crashing after a few months of using iOS 5.0.1. Are there any solutions to this?

    Okay, so i have been using the iOS 5.0.1 for a while now, and a few months ago it was working very smoothly, and i was very happy with it because of its new additions. However for the last few weeks, my iPod touch started to lag, especially when i use the facebook app and safari. When I use facebook, safari, or any of my apps, they will crash in under 5 minutes. It has been driving me insane... I open up safari, open up a website, and there, a black screen, and it crashes! Or i open up facebook, try to put up a new status, or check my notifications, 2 seconds later, black screen, and crashes.
    I'm not sure if i want to restore my ipod because the last time i used restore, the apps were all over the place and a lot of information was lost in tht process.
    If i go to the apple store, will they be able to fix this or replace my ipod? if not, then i'd much rather throw this one out and buy a new one..
    But please, if there are solutions, please tell me!!! (i dont wanna waste another $300)
    Additional Information:
    -iPod Touch 4G
    - 32 GBs, 7.4GB free - audio = 4.9 GB, video = 7.3GB, Photos = 0.19GB, Apps = 7.8GB, Other = 1.16GB
    - Black
    - Capacity (said on ipod touch's itunes devices page) : 28.48GB
    - Software Version/iOS : 5.0.1

    Well, you could trade it in for a white one! 
    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."

  • My IPHONE 3GS is bricked and popping (-1) error in restore. It just got bricked over night. Is there any solution to this problem

    My Iphone was bricked when i woke up one day . It was showing restore screen so i restored it but while restoration it showed (-1) error. Is There any method to resolve this problem.

    I know very well how to restore Iphone. 
    The restoration process struck at baseband upgrade and restoration process ends with -1 error.

  • Check this code once, Is therea any remedy to this Script?

    1 declare
    2 i number(2):=1;
    3 id number(2);
    4 name varchar2(25);
    5 begin
    6 loop
    7 id:=&id;
    8 name:='&name';
    9 insert into emp_ramu values(id,name);
    10 i:=i+1;
    11 exit when i>=5;
    12 end loop;
    13* end;
    SQL> /
    Enter value for id: 10
    old 7: id:=&id;
    new 7: id:=10;
    Enter value for name: 20
    old 8: name:='&name';
    new 8: name:='20';
    PL/SQL procedure successfully completed.
    SQL> select * from emp_ramu;
    ID NAME
    10 20
    10 20
    10 20
    10 20
    This code asking me to supply the values for id and name only once, when i gave the values for id and name it is inserting 4 times (same values) into the table....Is there any way, so that this loop executes 4 times and asks us values four times?

    Same problem as on thread How can We avoid Default Prompting for scanning Values into variables?
    You're missing a fundamental fact that SQL*Plus and PL/SQL code does not mix.
    A PL/SQL block is send to the Oracle server process servicing you. It is parsed and executed there.
    Now this block contains SQL*Plus substitution variables - those one with the & sign. Before SQL*Plus transmits the block, it sees that there are these variables. It prompts you for the values. Then it substitutes the variables with the values - and submits this changed block of PL/SQL code to the server to execute.
    At the PL/SQL engine side - it cannot deal with any non-PL/SQL code. It does not know SQL*Plus commands. Just as it does not know C/C++ or Delphi or Powerbuilder or whatever client command or language set being used.
    Nor can that server process, potentially running on a server platform a 1000km away, on some weird operating system, hack across the network, into your PC and magically prompt you to enter some values for the next loop iteration.
    Server code runs on the server (PL/SQL). Client code/commands on the client (SQL*Plus). Do not confuse or mix the two. Standard client-server principles applies.

  • My new iPhone 4S has hearing problem.speaker and headphone works very good.However using handset to make and receive calls I cannot hear anything?I did restore the phone and removed the plastic.Is there any solution to this problem please?

    I am having heraing problem with iPhone 4S.Speaker and headphone works well.No echo.When I use handset to receive or make calls,I can't hear anything?I restore the phone and removed the plastic as well.Is there anyway to fix this problem?

    I personally haven't experienced much of the "reverberation/feedback" when using a headset on the i4S...
    Yes, I have near-perfect hearing too (for scope, squeaky brakes hurt my ears) I come from many conversations on many phones and types and first off, CDMA technology is great for coverage, terrible for voice quality. HD Voice in Europe made for some of the best phone conversations I've ever had.
    Back on track, feedback is most noticable (similar to the landline phone) when using the iPhone without a headset, but for me it's not an absolute criticality mainly because I use VoIP apps alot, so maybe it has desensitized me some over the past year.
    But whenever I'm on a call, and the other person has me on speakerphone, I have alot of trouble talking because of the feedback loop caused. So the less of my voice I hear the better I can talk.
    Have you tried a bluetooth headset yet?

  • Two different site collection cannot use the same Term Set . Is there any solution for this ?

     I can save department site collection as site collection template. Also I can use this template for a new department site collection creation.
    But Managed Meta data Navigation throws the following error
    •Error loading navigation: The Managed Navigation term set is improperly attached to the site. (Correlation ID: 6fa6b19c-820a-001d-b9e0-d939d702050a)

    Hi ,
    this is a limitation. please refer this
    http://social.technet.microsoft.com/forums/sharepoint/en-US/029b7e2e-661f-4ac3-bfcb-eb99b43016f2/the-selected-term-set-is-already-used-by-another-site
    Unfortunately in SP 2013, a termset can only be used by a single site collection for navigation. This is a known limitation. There is no out of the box way to use a central termset to manage navigation across site collections. You need to develop a custom sitemap
    provider to do that.
    Another way to do this is to create termset for each site collection and reuse/pin the terms from the central termset instead of creating duplicate terms. You can script this easily using Powershell. This has some limitations though.
    Also, you can try little customization. Follow this link -
    http://www.mavention.com/blog/building-global-naviga
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Logic 9.0.2 freezes when I quit! Is there any solution for this?

    Hi Guys
    Since upgrading from 9.0 to 9.0.1 and now 9.0.2, when I close a project and then choose "quit" from the Logic menu, I quite often get the dreaded spinning beach ball....
    This stays there for several minutes, and I have to force quit to shut Logic down.
    This doesn't seem to cause any other problems for me, but it's just disturbing to think that Logic is crashing upon quit, and therefore can't tidy up after itself before closing...
    I was hoping this would be sorted in 9.0.2, but it doesn't seem to have been.
    Not sure if this is to do with 9.0.1/9.0.2, or whether it's a Snow Leopard 10.6.1 thing. I updated Logic and SL at the same time a few weeks ago, and this issue started then.
    I'd love to hear from other users who have had this problem!
    And if Apple is going through these posts... please look at this issue!
    Cheers
    Mike

    Hi again all,
    Still trying to make sense of this... I'm trying to work out what changed on my system just before I started having the "not able to quit" problem.
    Only two big changes I can think of:
    1. Updated from 10.6 to 10.6.1
    2. Installed "iZotope Ozone 4" (mastering plug-in)
    It appears that a few other people on this forum are having a similar issue with Logic 8 (I am using 9, though) since they updated to 10.6.1, so this could be to do with the latest version of Snow Leopard...
    But I'm wondering, has anyone had this kind of problem when using Ozone 4? (I wonder, for example, if it is somehow not Snow Leopard compatible...)
    Would love any thoughts or feedback!
    Cheers
    Mike

Maybe you are looking for

  • Can not Open XMD from EDK / can not find the firmware executable file

    Hi, I have two problems: 1. I finished generating the bitstream in the EDK project. But when I try to open XMD in the EDK menu by doing "Debug --> Launch XMD" The XMD doesnt shows up. While the EDK output window says "xterm -e xmd -xmp system.xmp -op

  • Safari doesn't open some websites correclty

    Safari doesn't open some websites correclty. For example Interpals: My Internet speed is fine. It's playing videos from Youtube without any problem and displays Youtube correctly. I also resetted Safari, but it didn't help. What am I supposed to do?

  • Max value is same in report

    Hi Sap Experts I am not getting same min value from max can anyone correct my program please I am getting max value but in place of min I am getting the same value of max. I am searching with equipment range , monthly date range and unit of measurmen

  • Burned DVDs skip on some Home Players

    I know this is a topic that has been thrown around for some time, but is there any new info out there that can help the playback on the DVD home players that skip when you play burned DVD's (DVD-R & DVD+R). A group of us are trying to fix this proble

  • Cannot view resources in pwa 2010

    I have an admin rights ,I am not able to open and see resources in project pro to change their working times. It opens up but blank. They are not checked out to me either