Catch exception and continue the execution

Hi Team,
I require the action(such as insert/Update/Delete) for each row of table/table variable and also Error/Exception details as new column if occured any.
Please refer below sample input and output.
i was using merge, when exception occurs it fails to fit my requirement.
My input data will be huge(such as 10k-15k), please suggest me optimized way to achieve this
Kindly assist me.
Thanks

Hi,
1. We don't know what make wrong and what exception occurs! We only have a nice story here :-)
2. We don't have any information about your DDL and/or your source data an destination table, therefor we cant tell you  what is the best option.
3. For 10-15K records doing a loop as suggested can be slow (for a 1000k it will be take for ever). It is highly faster most of the time for a big SET of data to use 3 queries (if MERGE is not an optioned), one for each operation (insert,update,delete),
 and to work with bulk insert! In this case the only heavy operation will be the fact that you need to use 3 time filtering but if your index fit the query this might be the best solution sometimes (again if merge is not an option). If the data come from
external Data as CSV for example, then You can split the data into 3 sources before the queries, using 1 query or a small shell script prepering 3 sources. There can be several option fit your needs and uses which might fit better, but ont go to fast to work
with looping record by record. try to thing of working with SETs of data.
As mentioned, please post more information, In order to get the best solution for your specific case
[Personal Site] [Blog] [Facebook]

Similar Messages

  • N unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    some one can help me please
    i have no idea what i must to do.
    an unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    The Exception Handler gave all the info that you need. No need to print the whole stack trace.
    The exception handler says
    Exception Details: java.lang.IllegalArgumentException
    TABLE1.NAME
    Look in the session bean (assuming that is where your underlying rowset is). Look in the _init() method for statements similar to the following:
    personRowSet.setCommand("SELECT * FROM TRAVEL.PERSON");
    personRowSet.setTableName("PERSON");
    What do you have?

  • How to interrupt an funtion call and continue the followed code?

    for example, the code:
    public class A{
    public static void main(String[] args){
    int i = 0;
    method1();
    system.out.println("exit");
    public void method1(){
    int j = 0;
    while(true){
    j +=1;
    there is a error in method1(), so the call the method1( ) in main() will make an error.
    how can i interrupt this funtion call and continue the followed code?

    in actually, I can not control the method1(), that's
    an remote object function.
    So I can not add exception in methoes().Then in your main method catch whatever "Error" your method1 is throwing.

  • Exception Handling Standards -The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.

    In the current project my exception handling implementation is as follows :
    Exception Handling Layer wise :
    DL layer :
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    BL Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    UI Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    Response.Redirect("ErrorPage.aspx", false);
    We have a tool to check the standards. And tool output is as follows :
    The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
    I need suggestions on how to implement the same according to standards.

    Your tool is wrong if it says to never throw Exception.  This was a common recommendation back in the .NET v1 days but has long since been thrown out.  It is perfectly fine to use Exception when you have a general exception that provides no information
    that an application can use to make an informed opinion.
    The general rules of exception throwing is to throw the most specific exception that makes sense. If there is no specific exception that applies and it would be useful for the caller to handle the exception differently than other exceptions then creating
    a custom exception type is warranted.  Otherwise throwing Exception is reasonable. As an example you might have an application that pulls back product data given an ID. There is no built in exception that says the ID is invalid. However an invalid ID
    is something that an application may want to handle differently than, say, an exception about the product being discontinued.  Therefore it might make sense to create an ItemNotFoundException exception that the application can react to.
    Conversely there is no benefit in having different exception types for disk full and disk quota met. The application will respond the same in either case.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Ng An exception occurred during the execution of the current web request.

    An exception occurred during the execution of the current web request. Please contact the administrator to review the stack trace in the event log for more information about the error.
    this error occured while making changes to the mapings, there was "&" in the source account and some test also loaded in the text,
    the versio n of FDM is 11.1.2.0
    I understand that because of loading & in the source account it is causing this issue,
    How to delete this invalid char from database, which table and column will contain this information, Please advise me how to proceed on this.
    thanks,
    msr

    This TSQL will do the trick. It's not the cleanest as I just wrote it, but it will dynamically remove the & from the data mapping tables and replace any invalid entries with the phrase INVALID.
    --Remove && from Data Maps
    --Charles Beyer ([email protected])
    --NOTES : 'Hackish' version for demonstration purposes
    -- Declare working variables
    DECLARE @strTableName varchar(255)
    DECLARE @strSql Nvarchar(500)
    -- Create cursor to iterate through each Data Map table.  Look in special table sysobjects to get a list of the tables.
    DECLARE crsDataMapTables Cursor For
       select name
          from sysobjects
          where name like 'tdatamap%'
             and xtype = 'U'
    Open crsDataMapTables
    Fetch Next from crsDataMapTables Into @strTableName  --Get the name of the first Data Map table and place it into working variable
    While @@FETCH_STATUS = 0 Begin  --While records (table names) exist, execute loop logic
    print 'Cleaning table : ' + @strTableName
      --Multi-pass updates to check the SrcKey, TargKey, and WhereClauseValue fields for the invalid character
      --Dynamic SQL is used below so that we can use the Table Name from the cursor..
      Set @strSQL = 'UPDATE ' + @strTableName + ' set SrcKey = ''Invalid'' where SrcKey like (''%&%'')'
      exec (@strSQL)
      Set @strSQL = 'UPDATE ' + @strTableName + ' set TargKey = ''Invalid'' where TargKey like (''%&%'')'
      exec (@strSQL)
      Set @strSQL = 'UPDATE ' + @strTableName + ' set WhereClauseValue = ''Invalid'' where WhereClauseValue like (''%&%'')'
      exec (@strSQL)
      Fetch Next from crsDataMapTables Into @strTableName
    End
    --Dispose of Cursor as we are done.
    Close crsDataMapTables
    Deallocate crsDataMapTables
     

  • Unhandled exception occurred during the execution of the workflow instance

    I had a workflow and library working with no issues, but had to move the library and export the workflow to another subsite (though on the same web site/collection).  I followed these how-tos:
    http://msdn.microsoft.com/en-us/library/office/jj819316%28v=office.15%29.aspx
    http://technet.microsoft.com/en-us/library/ee428301%28v=office.15%29.aspx
    Anyway, I've stripped all actions from the workflow and only have an Assign Task, but get this below:
    An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ArgumentException: ContentTypeId at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance
    instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
    To troubleshoot, I removed all library columns, removed then re-added the Custom Content type the New Document uses, and still the same error - with the workflow going into Suspended mode.
    I also tried the removal of the file from /Relationships%20List/allitems.aspx and de-activating then re-activating the SharePoint Publishing feature, also that didn't work.
    I've gone into ULS, but unable to find anything definitive, so not sure what to try next?
    Thank you,
    Chad

    Hi Chad,
    Glad to hear the issue is resolved. Content types could be used for multiple lists in SharePoint site at the same time.
    However, I'm not quite sure why you said the resolution is for a "bug". I read the article per your link:
    http://www.andrewconnell.com/blog/SP2013-Workflow-Custom-Task-Outcomes
    The article is showing how to create custom outcomes buttons in task forms. As I understand, the issue you encountered is that workflow migrated from the other site shows the suspended status.
    Please be more specific on the issue if assistance is needed. If this is the second question, I’d recommend you open another thread in the relevant forum and provide specific information about the issue. In order to avoid confusion and keep track of troubleshooting
    steps, we usually troubleshoot one issue per thread in order to find a resolution efficiently.
    Thanks for the understanding.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • HT4847 i want to keep and continue the amount of iCloud storage that I currently have

    i want to keep and continue the amount of iCloud storage that I currently have.  How do I extend my current iCloud service beyond the expiration date?

    Are you an ex-MobileMe subscriber who has the complimentary extra storage? If so this will downgrade to the free storage level at the end of next September, and if you want to keep the storage you will need to cancel the downgrade and pay for the additional storage. Note that if you purchase additional storage before next September it will cancel the complimentary storage immediately. Please see
    http://support.apple.com/kb/HT5527
    If you are not an ex-MobileMe subscriber then as said above you need do nothing except make sure you have a valid credit card registered.

  • Catch exception, but continue try{ ?

    I have a http timeout error that is handled by a printing of the stack trace, but how do I continue it so the while loop still continues?
    try {
    while(rs.next()) {
    httpConection.setConnectTimeout(15000);
    httpConnection.connect();
        }//end while loop
          con.close();
         catch(Exception e)
         continue; // <--- Won't let me do this, since it is not in a loop
         }//end catch
        thanks in advance

            public static void main(String[] args) {
         try {
          Statement stmt;
          ResultSet rs;
          Class.forName("com.mysql.jdbc.Driver");
          System.out.println("URL: " + url);
          System.out.println("Connection: " + con);
          stmt = con.createStatement();
          stmt = con.createStatement(
                   ResultSet.TYPE_SCROLL_INSENSITIVE,
                         ResultSet.CONCUR_READ_ONLY);
          while(rs.next()){
            int theInt= rs.getInt("id");
            String URLs = rs.getString("url");
            String urlString = URLs;
                  URL httpurl = new URL(urlString);
                URLConnection connection =
                httpurl.openConnection();
                if (connection instanceof HttpURLConnection) {
                    HttpURLConnection httpConnection =
                     (HttpURLConnection)connection;
                     httpConnection.setConnectTimeout(15000);
                     httpConnection.connect();
                  } // End IF
                 // Continue
          // End If(connection instanceof)...
          } // End While
          con.close();
         } // End TRY
        catch(Exception e) { }
            }Thats how I have the exception now.. If i try anything else it says need catch or finally for try?

  • HT1725 I have paid for a movie rental, when trying to download but wifi got interrupted , therefore I can't see the movie in the download section , it's disappear and I have paid for it , how can I find the movie and continue the download ?

    I have paid for a movie rental, when trying to download but wifi got interrupted , therefore I can't see the movie in the download section , it's disappear and I have paid for it , how can I find the movie and continue the download ?

    In the "Store" menu, click "Check for Available Downloads"

  • My phone keeps looping, powering up and powering down and continues the process.  I do not want to restore my phone where it will cause my pictures and video to be lost.

    First, a comment: this process ***** because I am typing my question in various screens for the fifth time.
    QUESTION:
    My phone keeps looping, powering up and powering down and continues the process.  I do not want to restore my phone where it will cause my pictures and video to be lost.

    Is your device jailbroken? Have you backed up your device recently?
    Cheers,
    GB

  • How to catch exception while validating the username and password in hbm

    Hi,
    I do want to set the username and password dynamically in hibernate.cfg.xml
    Here below is my configuration file.
    {code<hibernate-configuration> 
    <session-factory> 
           <property name="hibernate.bytecode.use_reflection_optimizer">false</property> 
           <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> 
           <property name="hibernate.connection.pool_size">10</property> 
           <property name="show_sql">true</property> 
           <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property> 
           <property name="hibernate.hbm2ddl.auto">update</property> 
           <property name="current_session_context_class">thread</property> 
           <property name="show_sql">true</property> 
         </session-factory> 
    </hibernate-configuration>{code}
    Also im getting that session factory object like the below code.
    public class Sessions {        private static SessionFactory sessionFactory;      private static Configuration configuration = new Configuration();        static {          try {              String userName = GuigenserviceImpl.userName;              String password = GuigenserviceImpl.password;              String hostName = GuigenserviceImpl.hostName;              String portNo = GuigenserviceImpl.portNo;              String sId = GuigenserviceImpl.sId;                  configuration                      .setProperty("hibernate.connection.username", userName);              configuration                      .setProperty("hibernate.connection.password", password);              configuration.setProperty("hibernate.connection.url",                      "jdbc:oracle:thin:@" + hostName + ":" + portNo + ":" + sId);                try {              configuration.configure("/hibernate.cfg.xml");              sessionFactory = configuration.buildSessionFactory();              GuigenserviceImpl.strAccpted = "true";              }              catch (Exception e) {                    e.printStackTrace();                  GuigenserviceImpl.strAccpted = "false";              }            }          catch (HibernateException hibernateException) {              GuigenserviceImpl.strAccpted = "false";              hibernateException.printStackTrace();          }          catch (Throwable ex) {                GuigenserviceImpl.strAccpted = "false";              ex.printStackTrace();              throw new ExceptionInInitializerError(ex);          }      }          public static SessionFactory getSessionFactory() {          return sessionFactory;      } 
    So, in this above scenario, suppose if im giving the wrong password means exception should be caught and the string variable "GuigenserviceImpl.strAccpted" should be assigned to false.
    But im getting the SQL Exception only in console like wrong username and password. And finally i couldn't able to catch the exception in Sessions class, static block.
    Anyone can help me in catching that SQL Exception in my Sessions class and i need to handle that SQL Exception in my class.
    Im getting this following exception message in my console.
      INFO: configuring from resource: /hibernate.cfg.xml  Apr 6, 2009 2:47:00 PM org.hibernate.cfg.Configuration getConfigurationInputStream  INFO: Configuration resource: /hibernate.cfg.xml  Apr 6, 2009 2:47:00 PM org.hibernate.cfg.Configuration doConfigure  INFO: Configured SessionFactory: null  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: Using Hibernate built-in connection pool (not for production use!)  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: Hibernate connection pool size: 10  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: autocommit mode: false  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@192.168.1.12:1521:orcl  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: connection properties: {user=scott, password=****}  Apr 6, 2009 2:47:01 PM org.hibernate.cfg.SettingsFactory buildSettings  WARNING: Could not obtain connection metadata  java.sql.SQLException: ORA-01017: invalid username/password; logon denied        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)      at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)      at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:799)      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:368)      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)      at java.sql.DriverManager.getConnection(DriverManager.java:525)      at java.sql.DriverManager.getConnection(DriverManager.java:140)      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)      at com.beyon.ezygui.server.Sessions.<clinit>(Sessions.java:39)      at com.beyon.ezygui.server.GuigenserviceImpl.testRPC(GuigenserviceImpl.java:322)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    Thanks in advance.
    Thanks & Regards,
    Kothandaraman N.

    Hi,
    Myself hardcoded that username and password checking like the below code.
    String name = loginData.get("userName").toString();
              String pswd = loginData.get("pswd").toString();
              String hstName = loginData.get("hName").toString();
              String prtNo = loginData.get("portNo").toString();
              String sid = loginData.get("sId").toString();
              SessionFactory sessionFactory = null;
              try {
                   if (name.trim().equals(userName) && pswd.trim().equals(password)
                             && hstName.trim().equals(hostName)
                             && prtNo.trim().equals(portNo) && sid.trim().equals(sId)) {
                        sessionFactory = Sessions.getSessionFactory();
                        strAccpted = "true";
                   } else {
                        strAccpted = "false";
              } catch (Exception e) {
                   e.printStackTrace();
                   strAccpted = "false";
              }I have my own values in string objects, then comparing that values with the values from login form. If both values are matching, then i will do configurations in hibernate.
    ResourceBundle resourceBundle = ResourceBundle
                   .getBundle("com.beyon.ezygui.server.Queries");
         public static final String connection_url = resourceBundle
                   .getString("connection.url");
         public static final String userName = resourceBundle.getString("userName");
         public static final String password = resourceBundle.getString("password");
         public static final String hostName = resourceBundle.getString("hostName");
         public static final String portNo = resourceBundle.getString("portNo");
         public static final String sId = resourceBundle.getString("sId");The above are the String objects i'm checking for the match with values from login form.
    Thanks & Regards,
    Kothandaraman N.

  • If I download Mountain Lion on my MBP , can I use the same installer file on a different computer and continue the installation without Internet connectivity?

    Hi Folks,
    I have just downloaded Mountain lion on my  Macbook Pro(haven't installed it yet) . My question is, can I copy the same downloaded Mountain Lion from the Applications on to an external hard drive and use the same on a different computer? I am having problems with internet connectivity right now, it would be amazing if it can be installed on the iMac without internet connection.
    So is that doable?
    Thanks in advance

    And the 2nd installation would not require internet connectivity? Except , of course during the set up and the configuration of iCloud and location based services, which I can skip at the time

  • While talking to someone, I could lock the screen in iSO6 and continue the call, How could I do the same in iSO7?

    Dear Team,
    In iSO 6 while talking to some one I could lock the screen in the middle of the call and I could continue the call, this helps me in may ways
    1. I dont press the key board accidentally so that key presses wont be sent to IVR if Iam talking to a customer care or bank ect..
    2. once I lock the screen while talking to the other person, accidentally I could avoid pressing End button, as it is touch screen and an accidental skin touch ends the call?
    3. How could I reject the call if I dont want to receive the call using touch screen in iSO7 if possible?
    could you please answer these queries if am on right forum, if not let me know?
    thank you.
    Kul

    Hello Csound1
    The feature exists (and is clearly described in Numbers User Guide) in Numbers '09 but the thread is about the behavior of Numbers '08.
    Yvan KOENIG (VALLAURIS, France) mercredi 21 septembre 2011 21:59:50
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How to edit PSA and continue the load with corrected data from PSA.

    Hi,
    Can you guide me on how to edit data in PSA and then continue a load?
    i.e. if you can provide me with the steps on how to fix a load problem if a load fails. The load fails and Monitor shows red, so how do I fix them in the PSA and then allow the load continue with the corrected data into the data target.
    I will appreciate the details steps involved.
    Thanks

    Hi
    First select that request then turn to Red and delete the Request , delete the qeruest then system allow to edit the psa data ,selete psa then selet packet then selet record double click modify the data, dont forget after completing save the data. after competing modification then select psa right click select- start update immediatly......
    thanks
    ram

  • When I try to enter target URLs in my campaign on Direct CPV and click save and continue, the target URLs don't go into my target box. Do I need to do something with the settings on Firefox?

    When I enter target URLs into my Direct CPV campaign, they don't carry over to my target list when I click save and continue. Is there a setting on Firefox I need to change to fix this?

    I only have the problem when trying to load targets into my Direct CPV campaign.

Maybe you are looking for