lib/arjdbc/as400/adapter.rb
def execute_and_auto_confirm(sql, name = nil)

      begin
        execute_system_command('CHGJOB INQMSGRPY(*SYSRPYL)')
        execute_system_command("ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')")
      rescue Exception => e
        raise unauthorized_error_message("CHGJOB INQMSGRPY(*SYSRPYL) and ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')", e)
      end

      begin
        result = execute(sql, name)
      rescue Exception
        raise
      else
        # Return if all work fine
        result
      ensure

        # Ensure default configuration restoration
        begin
          execute_system_command('CHGJOB INQMSGRPY(*DFT)')
          execute_system_command('RMVRPYLE SEQNBR(9876)')
        rescue Exception => e
          raise unauthorized_error_message('CHGJOB INQMSGRPY(*DFT) and RMVRPYLE SEQNBR(9876)', e)
        end

      end
    end
def execute_and_auto_confirm(sql, name = nil)

      begin
        execute_system_command('CHGJOB INQMSGRPY(*SYSRPYL)')
        execute_system_command("ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')")
      rescue Exception => e
        raise unauthorized_error_message("CHGJOB INQMSGRPY(*SYSRPYL) and ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')", e)
      end

      begin
        result = execute(sql, name)
      rescue Exception
        raise
      else
        # Return if all work fine
        result
      ensure

        # Ensure default configuration restoration
        begin
          execute_system_command('CHGJOB INQMSGRPY(*DFT)')
          execute_system_command('RMVRPYLE SEQNBR(9876)')
        rescue Exception => e
          raise unauthorized_error_message('CHGJOB INQMSGRPY(*DFT) and RMVRPYLE SEQNBR(9876)', e)
        end

      end
    end
def execute_and_auto_confirm ( sql , name = nil ) begin execute_system_command ( 'CHGJOB INQMSGRPY(*SYSRPYL)' ) execute_system_command ( "ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')" ) rescue Exception => e raise unauthorized_error_message ( "CHGJOB INQMSGRPY(*SYSRPYL) and ADDRPYLE SEQNBR(9876) MSGID(CPA32B2) RPY('I')" , e ) end begin result = execute ( sql , name ) rescue Exception raise else # Return if all work fine result ensure # Ensure default configuration restoration begin execute_system_command ( 'CHGJOB INQMSGRPY(*DFT)' ) execute_system_command ( 'RMVRPYLE SEQNBR(9876)' ) rescue Exception => e raise unauthorized_error_message ( 'CHGJOB INQMSGRPY(*DFT) and RMVRPYLE SEQNBR(9876)' , e ) end end end
Holy moly batman! all this to tell AS400 "yes i am sure"
Holy moly batman! all this to tell AS400 yes i am sure