How to use continue in loop ...

Hi,
declare
i number;
begin  
i:=0;
loop    
dbms_output.put_line('i='||to_char(i));    
if ( i = 2 )  then       
continue;     
end if;    
dbms_output.put_line(' Only if i is not equal to 2 ');  
end loop;
end; When I run this block, oracle is throwing an error...
ORA-06550: line 8, column 1:
PLS-00201: identifier 'CONTINUE' must be declared
ORA-06550: line 8, column 1:
PL/SQL: Statement ignoredThis feature has been added in Oracle 11, but I am using Oracle 10.2.0.1
Is there any other keyword like "CONTINUE" in 10g?
Please help me.
Thanks,
Bharath.

This
This feature has been added in Oracle 11, but I am using Oracle 10.2.0.1
Says it all.
In this particular case using CONTINUE is a clear case of unreadable, unstructured code, because it should have of course been
declare
i number;
begin  
i:=0;
loop    
     dbms_output.put_line('i='||to_char(i));    
     if ( i != 2 )  then       
        dbms_output.put_line(' Only if i is not equal to 2 ');  
    end if;    
end loop;
end;
Sybrand Bakker
Senior Oracle DBA
Experts: those who did read documentation.

Similar Messages

  • How to use old "Apple Loops for Soundtrack" with Garageband

    Since Soundtrack (was part of FinalCut Express HD) doesn't work anymore (since some ProKit framework update) and was not part of the FinalCut Express 4 upgrade I used Garageband for sound creation and editing. But I missed some good loops from the old Soundtrack.
    The Apple Loops for Soundtrack were still sitting on my harddisk but Garageband didn't recognize them in the Loop-Browser. Looking at the structure I found the Search Index files (/Library/Audio/Apple Loop Index/). I have two there, one for Garageband and another for iLife Sound Effects. Both are interpreted by Garageband. But no third for the old Soundtrack Loops. So I had a look at the Sound Loops installer DVD from FinalCut HD and there I found a similar structur and copied the Index file to the location of the two indexes mentioned above. I left the Loops for Soundtrack where they are (also could edit the index file for new locations, but that's a 7.5MB text file) and now Garageband knows their location and also lists the loops at the right categories inside the Loop-Browser.
    Maybe that helps someone, even if I didn't find a topic about it here.

    Ah.. ok, then never mind. Just didn't find any information about how to use the old soundtrack loops with garageband and so I did some thinking on my own. And if it works that easy, the better it is

  • How to use "continue"

    hi all
    i want to use "continue" statement in java... when i am doing this it says and trying to compile. But it says undefined label: error..
    any help on this
    thanks in advance

    i am using a method to send bulkmails to some emailAddresses.... if i got any wrong email then immediately it throws an exception after this exception my control is coming out of loop. So i am not able to send emails to the remaining addresses even they are correct email addresses.
    my code looks like this
         try
    System.out.println(""+recipients.length);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
              for (int i = 0; i < recipients.length; i++)
    //System.out.println(" <---------in forloop-------->"+recipients);
         start:
                   addressTo[i] = new InternetAddress(recipients[i]);
    //System.out.println("this is from bulk mail "+content);
    //System.out.println("this is from bulk mail "+subject);
                   boolean debug = false;
                   String smtpHost="mail.ipointsoft.com";
                   String htmlString = "<html><head><title>" +
                   "</title></head><body><font class=verdana size=2><b>To Unsubscribe please<i><a href='http://192.9.1.7:8080/Unsubscribe?unsub="+addressTo[i]+"'> click Here...</a></i></b></font>"+
                   "<p>" +
                   " </body></html>";
    //System.out.println("------->from blk mail"+smtpHost+"----------");
                   //Set the host smtp address
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", smtpHost);
    //System.out.println("<----------attachment------------->"+attachment+"<------------");
                   //create some properties and get the default Session
                   Session session = Session.getDefaultInstance(props, null);
         session.setDebug(debug);
    //System.out.println("<----------i am after getting session------------->");
              // create a message
                   Message message = new MimeMessage(session);
    //System.out.println("<----------i am after getting msg------------->");
              // set the from and to address
                   InternetAddress addressFrom = new InternetAddress(from);
                   message.setFrom(addressFrom);
                   message.addRecipient(Message.RecipientType.TO, addressTo[i]);
    //System.out.println("<----------i am after setting the to address------------->");
                   // Optional : You can also set your custom headers in the Email if you Want
                   message.addHeader("MyHeaderName", "myHeaderValue");
                   // Setting the Subject and Content Type
                   message.setSubject(subject);
                   BodyPart part1=new MimeBodyPart();
                   part1.setText(content);
                   BodyPart part2=new MimeBodyPart();
                   DataSource source =new FileDataSource(attachment);
                   part2.setDataHandler(new DataHandler(source));
                   part2.setFileName(attachment);
                   MimeBodyPart part3 = new MimeBodyPart();
                   part3.setDataHandler(new DataHandler(new HTMLDataSource(htmlString)));
                   MimeMultipart multipart=new MimeMultipart();
                   multipart.addBodyPart(part1);
                   multipart.addBodyPart(part2);
                   multipart.addBodyPart(part3);
                   message.setContent(multipart);
    System.out.println("this is before calling send method on Transport Class $$$$$$$$$$$$$$$$$$");
                   Transport.send(message);
                   System.out.println("mail send sucessfully");
                   }//end of for()--loop
              }//end of try-catch() block
              catch(Exception e)
    System.out.println("mail did't send sucessfully********");
                   e.printStackTrace();
                   return false;
                   continue start;
    System.out.println("i am returning return");
    return true;
    thanks in advance

  • How to use for each loop in XSLT when my source is a multilayout file and db

    How do I use a for each loop in XSLT when my source is multilayout file and db .
    My multilayout file is basically contain 2 kind of data one for employee and another for dependent.
    Now my requirement is I want to read each line of data whether it is it is employee or dependent do a join with db and write it in my target file.
    eg :  File content
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar 456782 BRO RichaKumari 311289 INDIA
    2 Ravi            456882 BRO RichaKumari 311289 INDIA
    eg : db Content
    311289 RichaKumari TCS INDIA Bangalore [email protected]
    Now in Final File I need something like this :
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar RichaKumari 311289 TCS INDIA
    2 Ravi            RichaKumari 311289 TCS INDIA
    here 1 and 2 are the identifier which will decide which layout to follow .

    Hi,
    I think you'll need two nested for-each's... Something like...
    <xsl:for-each select="$root/row[layout = 1]">
    <xsl:variable name="employee" select="."/>
    ... write employee ...
    <xsl:for-each select="$root/row[layout = 2 and dependentid = $employee/id]">
    ... write dependent ...
    </xsl:for-each>
    </xsl:for-each>
    Cheers,
    Vlad

  • How to use equals in loop of an Stored Procedure

    Hi ,
    This is my Stored Procedure which is working fine (mean displaying all the Data from the Table)
    Here i want to add this functionality that is i want to check if there is 'IND' in country_code , i want to throw an Exception manually .
    I am struck up here : After the cursor fetches all the country_code in its loop , how can i check the whether country_code contains 'IND' or not in it ??
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code    VARCHAR2(40);
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    DBMS_OUTPUT.PUT_LINE(country_code);
    EXIT WHEN PD1%NOTFOUND;
    END LOOP;
    CLOSE PD1;
    END  Auto_After_Bod_Status;
    please help .Thanks .

    user10503747 wrote:
    I am struck up here : After the cursor fetches all the country_code in its loop , how can i check the whether country_code contains 'IND' or not in it ??Why do you need to check it after the loop. Check as soon as row is fetched. Also, your DBMS_OUTPUT.PUT_LINE(country_code); should be after EXIT WHEN PD1%NOTFOUND; not before:
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code VARCHAR2(40);
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    EXIT WHEN PD1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(country_code);
    IF country_code LIKE '%IND%'
      THEN close pd1;
           raise myException;
    END IF;
    END LOOP;
    CLOSE PD1;
    END Auto_After_Bod_Status;But if you want to fetch all rows first:
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code VARCHAR2(40);
    ind number := 0;
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    EXIT WHEN PD1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(country_code);
    IF country_code LIKE '%IND%'
      THEN ind := 1;
    END IF;
    END LOOP;
    CLOSE PD1;
    IF ind = 1
      THEN raise myException;
    END IF;
    END Auto_After_Bod_Status;SY.

  • How to use smartforms

    how to use smartforms & its loop,command line,address concept & other tool

    Hai    Rahul,
    Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Subtotals - Check the link...
    Re: Subtotal with Table Node in smartforms
    Go through these SAP Standard programs also,
    sf_example_01
    sf_example_02

  • How can I load a .xlsx File into a SQL Server Table using a Foreach Loop Container in SSIS?

    I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
    I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
    If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
    Put the Data Flow Task within the Foreach Loop Container
    Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
    I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
    I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
    And that's when I run into trouble...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
    Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
    I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
    I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
    Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
    to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
    Thanks for your review and am hoping and praying for a reply and solution.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Here's the short-cut solution:
    Green Apple tracks are MIDI files (so to speak). If you drag one from the loop browser (Capitol C Orchestral hit, as you mentioned in this exable) directly into the arrange page it creates the MIDI file and the instrument to play it back on.
    HOWEVER.If you create and audio track first, THEN drag the green Apple loop onto that track, the loop will get "bounced" with the reverb in tact and you'll have the exact sound that you heard in the preview.
    Make sense?

  • Hi! ... When configuring my new iPad, it says the UserId is already in use and I cannot progress any more. Of course it's in use, it's my UserId. How do I continue ?? ... Thanks in advance

    Hi! ... When configuring my new iPad, it says the UserId is already in use and I cannot progress any more. Of course it's in use, it's my UserId. How do I continue ?? ... Thanks in advance

    Did you select "Sign In with an Apple ID" as opposed to "Create a free Apple ID" when setting it up?

  • How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8)

    How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8) since November until now.  Mail will no longer download on the MacBook Pro and keeps asking for my password.

    Mail should still be usable with your machine - but you'll need to update the settings to conform to the requirements of your system. Check with your ISP (like ATT, etc.) for the settings that will work with your Mail. Once you've updated this, you should be able to email like before.
    For example, my ISP required that I go to Mail Preferences/Accounts and make sure the details conform to your email settings.
    I have no idea of what your ISP is or what the settings might be, but this is likely the source of the problem.

  • After a clean install, how can I continue using Time Machine?

    After a clean install, how can I continue using Time Machine?
    I booted from my recovery partition, erased my HD, installed the same OS, (Lion, 10.7.5) then restored from my TM.
    If it asks if i want to use TM, I say yes. When I chose the drive, it seems to want to start all over, instead of just picking up where I left off.
    Is there any way of picking up where I left off?

    Hi Frank,
    You are sure you looking in your Library in /Users/YOUR_USERNAME/Library and not /Library at the top level of your harddrive?
    When you open iCal what do you see?  Are the calendars the two default Home and Work ones?
    I really appreciate the responses -- especially if you are in the UK as opposed to Ontario.
    Why, do you have something against London Ontario?
    John M

  • How to use i for if condition in a for i in loop?

    Hi friends,
    I have a question on how to use i for IF condition in a loop, in order to get an efficient programming and results. Here is outlined SQL:
    cursor is
    select c1,c2,c3 from table1; -- 100 rows returned.
    open cursor
    loop
    fetch c1,c2,c3 into v1,v2,v3;
    for i in 1..3 loop
    if 'v'||i between 90 and 100 then
    v_grade := 'Excellent';
    elsif 'v'||i between 80 and 89 then
    elsif 'v'||i between 50 and 59 then
    end if;
    end loop;
    close cursor;
    This way, I don't need to use a lot of if..then for hard code v1,v2,v3,.... actually I have more v..
    But Oracle gave an error of this usage of 'if 'v'||i' or 'v'||to_char(i).
    Thanks for any advice in advance!

    user508774 wrote:
    Thanks for comments and advices. But I didn't get your inputs clearly. Are you saying I don't need to use PL/SQL to achieve this?Correct. Ronel and John showed you the basic approaches. SQL is not a mere I/O language for making read and write calls. It is a very capable, flexible and powerful language. One can solve a problem with a few lines of SQL code, that will take 100's of lines of PL/SQL or Java code.
    So do not underestimate what can be done in SQL.
    v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
    EXECUTE IMMEDIATE v_cmd;This code is also wrong. Besides the fact that there is no need for dynamic SQL, this approach creates a brand new SQL statement each loop iteration.
    SQL is source code. It needs to be parsed (compiled). The end result is an executable program that is called a cursor. This cursor needs to be stored in server memory (the SQL Shared Pool in the SGA).
    The problem with your code is that it is slow and expensive - it generates lots of unique SQL statements that need CPU for parsing and server memory for storage.
    These add up to a very significant performance overhead. That is the wrong approach. The correct approach is the same one that you would use in any other programming language.
    Let's say you need to use Java to process a bunch of CSV files - exact same CSV layout used by each file. A file needs to be read, processed, and a log file created.
    Will you write a Java program that loops through the files, for each file found, write a Java program for processing that file, compile it, then execute it?
    Or would you write a Java program that takes the name of the file as input, and then process that file and writes the log file?
    The 2nd approach provides a program that can process any of those CSV files - one simply needs to pass the filename as an input parameter.
    Your code and approach use the 1st method. Not the 2nd. And that is why it is wrong.
    To create a SQL program with parameters is done by using bind variables. Instead of
    v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
    The following SQL source code should be created:
    v_cmd := 'UPDATE parts_categ_counts SET w1=:v1, w2=:v2 ..., w9=:v9 WHERE seq= :vseq';
    The tokens with the colon prefix (such as :v1), are bind variables. Think of these as the parameters to the SQL cursor.
    The server parses this SQL into a cursor. You can now execute the same cursor over and over again, using different bind variables. (just like the 2nd approach above that one would use in Java)
    In PL/SQL, this is made even easier as you can code native SQL code with PL/SQL code and use PL/SQL variables in it. The PL/SQL compiler is clever enough to do the SQL parsing, variable binding, and cursor execution for you. So in PL/SQL, you would use:
    UPDATE parts_categ_counts SET w1=v1, w2=v2 ..., w9=v9 WHERE seq= vseq;
    Where v1 and the others are PL/SQL variables.
    That all said - PL/SQL is only used for data crunching, when the processing of data is too complex for the SQL language to deal with. And this is very seldom the case.
    The main reason for using PL/SQL it to provide processing flow control, conditional processing and error handling, for SQL code. As the SQL language does not have these features.

  • I have an Epson scanner that is apparently no longer supported  because it is a PowerPC app.  It's a very good scanner that worked fine until I upgraded to OS Mountain Lion on my MacBook Pro.  Any suggestions on how I can continue to use it?

    I have an Epson scanner that is apparently no longer supported  because it is a PowerPC app.  It's a very good scanner that worked fine until I upgraded to OS Mountain Lion on my MacBook Pro.  Any suggestions on how I can continue to use it?

    For that model, Epson has this information:
    ICA Scanner Driver
    07/17/12
    Description: The latest Mac OS X ICA scanner driver for your Epson product is available only via Apple's Software Update. Here's how to get it:
    1. Connect the all-in-one or scanner to your Mac and power it on.
    2. Select the  menu, then Software Update.
    3. Follow the on-screen instructions to install the available updates.
    Note: Software Updates may find multiple updates for your system. You may choose to install all or some of the updates by clicking on Show Details.
    Compatible Systems: Mac OS X (v10.8.x)

  • How can I continue using my CS3? I needed to install a new hard drive, & CS3 wont accept my serial # on the re-install :-/

    How can I continue using my CS3? I needed to install a new hard drive, & CS3 wont accept my serial # on the re-install :-/

    Unfortunately, only Adobe customer service can assist you with your issue. These are user forums; you are not addressing Adobe here.
    Click on the link below, and after that click on "Still need Help? Contact us."
    Then on the next page, click Chat
    There is also a phone option.
    http://helpx.adobe.com/contact.html?step=PHXS_downloading-installing-setting-up_licensing- activation

  • How to use LOOP(Until) step in a Workflow

    Hi,
    How to use LOOP(Until) step in a Workflow?
    What are the steps involved in using the step LOOP(Until).

    Hmmm... using it is just like using a LOOP UNTIL statement in any programming language. You get at least one loop iteration, as opposed to a WHILE loop which may give you zero iterations.
    You simply insert a node of this type in the workflow, and magically there will be a loop inside which you can insert the steps you want to execute in the loop, and by double-clicking at the end node of the loop you can enter the condition for exiting.
    What exactly is it you are having trouble understanding about the use of it?

Maybe you are looking for