What's wrong with my store procedure?

HI, I can't figure out what's wrong with my stored procedure. I believe i have a "commit;" where it's not supposed to be. What i really want to acheive is save the record once it finds those keywords. Maybe my syntax is all wrong.
I am getting the following error msg. PLS-00103
create or replace
procedure sp_diag is
DECLARE
v_setting_key NUMBER(18);
v_parent NUMBER(22);
v_name VARCHAR2(100);
v_class_key NUMBER(22);
CURSOR c1 IS
select setting_key, setting_class_key,name
from cms2wire.setting_list;
CURSOR c2 IS
select setting_class_key, parent_class_key,name
from cms2wire.setting_class
where setting_class_key = v_parent;
BEGIN
OPEN c1;
LOOP
FETCH c1 into v_setting_key, v_parent, v_name;
EXIT when c1%NOTFOUND;
WHILE v_parent != null
LOOP
OPEN c2;
FETCH c2 into v_class_key, v_parent, v_name;
CLOSE c2;
IF v_name='Diag.'or v_name='Settings.' THEN
COMMIT;
END IF;
END LOOP;
END LOOP;
CLOSE c1;
END;
-------------------------------------------------------------------------------------

Now, the way I see it, if you want to save the information, then you need to put it some place, so your slow-by-slow stored procedure becomes something like
INSERT INTO some_table (column list)
  SELECT a.setting_key,
         a.setting_class_key,
         a.name
         b.setting_class_key,
         b.parent_class_key,
         b.name
    FROM cms2wire.setting_list  a,
         cms2wire.setting_class b
   WHERE a.setting_class_key = a.setting_class_key
     AND b.name in ('Diag.', 'Settings.');
COMMIT;does it not?

Similar Messages

  • What is wrong with App Store?  On all of my devices it says App Store is unavailable

    What is wrong with App Store?  On all of my devices it says App Store is unavailable

    Based on posting time
    It could be off line for maintenance - picking slowest time of day.
    It could be off line because of a power failure - even with UPS(uninterrupted power source) they may want to shut down.
    Extreme melting can flood man-holes causing line failures.

  • What's wrong with my approval procedure query ?

    Hi everybody,
    This is my query :
    SELECT DISTINCT 'TRUE' FROM RDR1 WHERE $[$38.U_Prix_plancher.number] >=$[$38.Price.number]
    What's wrong with that ?
    Thanks
    Ara

    Ara,
    The problem is not with your Query but the problem is with the way the Query gets trigerred for an Approval Process.
    SAP only recognizes the value of a $[$38.x.x] parameter when that particular row is active.
    I suggest you can test this by simply highlight that particular row which breaks the rule and try to Add the document and you will see that the Approval Procudure will fire.
    Also remember an Approval Procudure works only when you are in Add Mode and does not on Update.
    Regards
    Suda

  • What is wrong with app store iOS 6?

    What is wrong with iOS 6 on my iPod. Apps are loading and search results are empty.

    Based on posting time
    It could be off line for maintenance - picking slowest time of day.
    It could be off line because of a power failure - even with UPS(uninterrupted power source) they may want to shut down.
    Extreme melting can flood man-holes causing line failures.

  • What is wrong in my store procedure

    Hi all,
    I confuse on in ,out inout in store procedure , I got eroor at
    Formal parameter '@AccessionNumber' was defined as OUTPUT but the actual parameter not declared OUTPUT
    I use sql server 2000 and ms type 4 driver,
    my test store procedure is
    drop  proc test_select
    go     
    create proc test_select
    (@AccessionNumber int,
    @NewNum varchar(20))
    AS
            begin
        begin transaction
    select FieldNumber, Name, HiTiter, SubType, Storage,SampleRegion, SampleYear
            from STData.dbo.ViruName00          
         where AccessionNumber=@AccessionNumber      
            and NewNum=@NewNum
    if @@error <>0 or @@rowcount !=1
               begin
                    rollback
                   return
              end
           commit transaction
    endand my test servlet is
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.sql.*;
    * TryJdbc.java
    * This servlet demonstrates using JDBC
    public class displayT1 extends HttpServlet {
        CallableStatement cs =null;
        ResultSet rs = null;
        Connection conn = null;
       * We want to initialized the JDBC connections here
        public void init()
            try{
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
            catch( Exception e )
                e.printStackTrace();
       * This responds to an HTTP GET request.
        public void doGet(
        HttpServletRequest request,
        HttpServletResponse response)
        throws IOException, ServletException {
            response.setContentType("text/html");
        PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");        
            try{
              conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","test","1234");
            conn.setCatalog("STData");   
           //we made it!
            out.println("connection established sucessfully!");
               // register int OUT parameter
                cs = conn.prepareCall("{call test_select(?,?)}");
                  cs.setInt(1, 1);
                   cs.setString(2, "00-1");
    cs.registerOutParameter(1, Types.INTEGER);
         cs.registerOutParameter(2, Types.VARCHAR);
                     ResultSet rs = cs.executeQuery(); 
          out.println("<html>");
                         out.println("<body bgcolor=\"#d2eeff\">");                  
                         out.print("<table border=\"1\"  width=\"37%\"> "); //create an html table
                         out.print("<tr>");
                         out.print("<h2> Customers on the flight</h2>");
                         out.print("</tr>");                    
                         out.println("<tr><td>Name</td>");
                         out.println("<td>SubTYpe</td></tr>");
                           while(rs.next()) {
                             out.print("<tr>");
                              out.print("<td>"+ rs.getInt(1) +"</td>");
                               out.print("<td>"+ rs.getString(2) +"</td>");
                               out.print("</tr>");                             
                                }// end while
                      out.print("</table>");
                       out.print("</body></html>");
                       out.close();
          while(rs.next()) {
           String Name=rs.getString("Name");        
            out.print(""+Name+"");
             out.print("</body></html>");
              out.close();
         }catch(SQLException e) {
                e.printStackTrace(out);
         finally {
          try {
            if(rs != null)
              rs.close();
              rs = null;
            if(cs != null)
              cs.close();
              cs = null;
            if(conn != null)
              conn.close();
              conn = null;
        catch (SQLException e) {}   
    public void doPost(HttpServletRequest Request, HttpServletResponse Response)
                    throws ServletException, IOException {
    public String getServletInfo()
        return "A Simple Servlet";
    }and my AccessionNumber is first column, and NewNum is second column.
    appreciate any help!
    Thank you!

    HI all,
    html + bean + jsp call store procedure still not work, I got empty output!!
    what is wrong ?
    public  String getString(){
        return string;
    public void setString( String string ) {
       this.string =string;    }
    public  String getMyType(){
        return myType;
    public void setMyType( String myType ) {
       this.myType =myType;    }
    try {
                  cs = db.prepareCall("{call select_all(?,?)}");            
                   cs.setString(1, myType);
                   cs.setString(2, string); 
                     ResultSet rs = cs.executeQuery();         
            fieldNumberList.clear();
            nameList.clear();
            hiTiterList.clear();
            subTypeList.clear();
            storageList.clear();
            sampleRegionList.clear();      
            rowCount = 0;
            while (rs.next()) {
               fieldNumberList.add(rs.getString("FieldNumber"));
               nameList.add(rs.getString("Name"));
               hiTiterList.add(rs.getString("HiTiter"));   
               subTypeList.add(rs.getString("SubType"));
               storageList.add(rs.getString("Storage"));
               sampleRegionList.add(rs.getString("SampleRegion"));
               rowCount++;
              anyRecords = true;
            }//end while
          }//end trythe following code work in servlet
    cs = conn.prepareCall("{call select_all(?,?)}");
                   cs.setString(1, myType);
                   cs.setString(2, string); 
                     ResultSet rs = cs.executeQuery(); 
             thank you!

  • What's wrong with Virtual Store for Journ.E

    What is with the virtual store?
    I have a wihte screen, i never see virtual store ?
    I think the support is very very bad.
    Nobody becomes an answer about the question !

    I think we need to join together and sue Toshiba for this behavior and to prompt further selling their products in the EU. My unit is still under warranty and I have consulted with some associations of consumers who are willing to come out with this example to the public, and who they recommend with Indemnifying lawsuit demanded that they, too, would support all lawful means and confident as well as some prominent lawyers in positive outcome for us, the consumers in this case ..

  • What is wrong with itunes. it says itunes store is not available. try back later.

    itunes store is not available. try back later. Everytime I try to purchase something this message appears. What is wrong with itunes?

    iTunes in Windows is difficult to uninstall.
    I found this for you in an older thread (read carefully before you start):
    Quote
    Resolution
    Note that the following procedure involves a registry edit. Back up your registry prior to proceeding.
    (1) Do a complete uninstall of iTunes and related software components as per the instructions in the following document (but do not attempt to reinstall iTunes just yet):
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7:
    http://support.apple.com/kb/HT1923
    (2) Launch Regedit as an administrator. In your Start Search field, type regedit. Right-click on the Regedit entry that comes up and select "Run as administrator" as per the following screenshot:
    (3) In the left-hand pane of Regedit, click the triangle next to HKEY_LOCAL_MACHINE to expand its contents.
    (4) Expand the contents of SOFTWARE
    (5) Expand the contents of Microsoft
    (6) Expand the contents of Windows
    (7) Expand the contents of CurrentVersion
    (8) Expand the contents of Installer
    (9) Expand the contents of UserData
    (10) Expand the contents of S-1-5-18
    (11) Right-click on Components and select "Permissions" as per the following screenshot:
    (12) In the "Permissions for Components" screen that comes up, click the Advanced button:
    (13) In the "Advanced Security Settings for Components" screen that comes up, click the "Owner" tab.
    (14) In the "Owner" tab, check the "Replace owner on subcontainers and objects tickbox, select "Administrators" and click Apply:
    (14a) If (after clicking Apply) you receive a "Registry Editor could not set owner on the key currently selected, or some of its subkeys" message, click OK:
    (15) Click OK in the "Advanced Security Settings for Components" screen.
    (16) Click OK in the "Permissions for Components" screen.
    (17) Quit out of Regedit.
    (18) Try installing iTunes using the latest version of the iTunes installer downloaded from the Apple website:
    http://www.apple.com/itunes/download/

  • What is wrong with my shipping address? I want to order pictures via apple store with iPhoto. Apple Id and payment seem ok. My current and correct shipping address appears with red letters. Why and what to do?

    What is wrong with my shipping address? I want to order pictures via apple store with iPhoto. Apple Id and payment seem ok. My current and correct shipping address appears with red letters. Why and what to do?
    Maybe this is relevant: I bought iphoto from the German apple store but I now live in Italy. I have tried German credit card with German invoicing address and Italian shipping address. And I have tried Italian credit card with Italian invoicing address and Italian shipping address. The phenomenon is the same: shipping address appears in red and I am asked to fill in the mandatory fields (which turn red whatever I enter).

    KarinavD,
    what is the setting for the Print Products Store in the Advanced Tab of the iPhoto Preferences?
    The country you select there has to match the billing address. And your billing address should match the country of your AppleID and credit card used with the AppleID.
    Regards
    Léonie

  • What is wrong with my app store?

    What is wrong with my app store? I am trying to update my apps and purchase a new one but it is not working on my iPad. It is working on my iPhone 4 though.
    I have tried turning my iPad off then on, I have tried re booting it by holding the 2 buttons at once, don't know what else to do. I have even gone in through the general settings and logged out of my apple ID then logged back in. This is annoying. I just want to buy an app!!!

    The App store appears to be having issues right now.
    Stedman

  • What's wrong with the itunes store UAE? i couldnt buy my favorite songs and movies because there's no "music" and "movies" category. please do something... thanks!

    what's wrong with the itunes store UAE? i couldnt buy my favorite songs and movies because there's no "music" and "movies" category. please do something... thanks!

    You are not addressing Apple here...
    This is a User to User forum...
    iTunes Store: Which types of items can I buy in my country?

  • All of my apple sets (iphone, ipad and computer) cannot connect the app store since yesterday, what's wrong with the app store?

    All of my apple sets (iphone, ipad and computer) cannot connect the app store since yesterday, what's wrong with the app store? do you know? or do you have have the same experience?

    I still have access.  Must be your phone or your internet connection.

  • Is there a problem w/itunes store site? after input my cr.card info, i was told that it cannot verify my address, which is correct, what's wrong with the edit the billing info screen?

    What is wrong with the edit biling info screen. it cannot verify my address. i triple check my address info
    and it is correct.

    Use the email form >  Apple - Support - iTunes Store - Contact Us

  • I am getting the error "We're sorry we cannot complete your request on the iTunes store at this time. Please try again later." on both my iPhone and iTunes on my computer. What is wrong with iTunes? Is the server down???

    I am getting the error "We're sorry we cannot complete your request on the iTunes store at this time. Please try again later." on both my iPhone and iTunes on my computer. What is wrong with iTunes? Is the server down or what? I need to download some things and update some apps...

    I've been getting the same message for like an hour now.  Since everything was working fine a few hours ago, and nothing changed on my end before it stopped working, I'm guessing it's something on Apple's end.  They probably already know about it by now, and are hopefully working on fixing it, so there's probably not much we can do but wait for them to fix it.

  • HT201304 I don't what is wrong with my card I can't buy anything on apple store even free ones I can't download, they said my previous purchase have a problem but I don't how wil I do to solve this problem, I need a help pls

    I don't what is wrong with my card I can't buy anything on apple store even free ones I can't download, they said my previous purchase have a problem but I don't how wil I do to solve this problem, I need a help pls

    What is the exact error message you're receiving?

  • What is wrong with iPhone 5 iTunes Store

    What is wrong with iPhone 5 iTunes Store

    Checkobee wrote:
    I seem not to able access iTunes Store from my iPhone 5....
    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430
    If no joy...
    Reset all settings
    Settings > General > Reset > Reset all Settings.
    This will return all iDevice settings to factory defaults... you will not lose any data.... But you will have to re-enter all of the device settings.

Maybe you are looking for

  • Setting Non-perpetual Inventory in SAP Business One

    Dear SAP partners, Do you know how to setup non-perpetual inventory in SAP Business One? I have tried to uncheck "Use Perpetual Inventory" in Administration > System Initialization > Company Details > Basic Initialization but SAP shows "item cost can

  • Imorted 3Ds Max Camera succesfully ... but something is wrong!

    Hi all, i hope i post correctly! the work between Studio Max and After Effects was successful! BUT ... i have "2 Frame - Segments" that have a blur just like the camera does a fast 360 on the z-Axis. I checked the keyframes and tried to change, but t

  • How to set

    I am running a prgram from command line which requires to pass command line argument with -D option to set several directories in the JVM for java extension mechanism. I could successfully run my program as below by using a variable. set EXT_DIRS = "

  • Read / Unread Marks - why no controls??

    I'm a recent convert to the Mac (happily), but miss the ability Outlook mail gives you to control whether messages are automatically marked as read, or remain unread, when previewing them in the preview pane. Is there no plug-in available to allow th

  • Driving and dimming LEDs with USB-6501

    I have a strip of LEDs hooked up to a power source with an intermediate dimmer. The specs for all that hardware is listed below. I am looking to switch from manual control to digital I/O. I have a NI USB-6501 DAQ but have never worked with it before