Question related with loop exception

Hello
I got 4 database , i am using dblinks to check some tables and write the results to one table. I created also  one table to hold instance names so my loop check it and execute my procedure.
declare
  sql_string1   VARCHAR2(4000);
  sql_string2   VARCHAR2(100);
begin
sql_string2:='truncate table  Backup';
execute immediate sql_string2;
   for r in (select INSTANCE_NAME,HOST_NAME from del)
   loop
sql_string1:= 'insert into Backup 
SELECT '''||r.HOST_NAME||'''  '||', '''||r.INSTANCE_NAME||'''  '||' ,
INPUT_TYPE,STATUS,START_TIME,END_TIME FROM V$RMAN_BACKUP_JOB_DETAILS@'||r.INSTANCE_NAME;
          execute immediate sql_string1;
       COMMIT;
   end loop;
   exception
  WHEN OTHERS THEN
    NULL;
end;
If all listeners are working or dbs are working this procedure work without any problem but if one of them is closed it is just insert the values until it gets error but i want that if it gets error to goes other value.How can i do that?
I changed values of del table
SYS@crofxd01:WSTORED: >select instance_name from del;
INSTANCE_NAM
BLABLA
BLABLA
BLABLA
BLABLA
FPT
only FPT is real instance after i execute procedure , i wanna see that FPT values inserted to db.
Thanks

Hi,
When control passes to an EXCEPTION section, it can not return to the block where the error occurred.  If you want to continue execution, the code to be executed after the exception is handled must be in a separate block.
Use a nested BEGIN block, like this:
declare
    sql_string1   VARCHAR2(4000);
    sql_string2   VARCHAR2(100);
    err_code   NUMBER;
begin
    sql_string2 := 'truncate table  Backup';
    execute immediate sql_string2;
    for r in (select INSTANCE_NAME,HOST_NAME from del)
    loop
        sql_string1 := 'insert into Backup 
                        SELECT ''' || r.HOST_NAME || '''  , ''' || r.INSTANCE_NAME ||
                        '''   , INPUT_TYPE,STATUS,START_TIME,END_TIME FROM V$RMAN_BACKUP_JOB_DETAILS@' ||
                        r.INSTANCE_NAME;
        BEGIN
              execute immediate sql_string1;
        EXCEPTION
            WHEN OTHERS THEN
                err_code := SQLCODE;
                IF  err_code  IN (-1234, -1236, ...) -- Find out actual numbers
                THEN
                    NULL;
                ELSE
                    RAISE;
        END;
       COMMIT;
   end loop;
end;
"EXCEPTION WHEN OTHERS THEN NULL" is usually a terrible idea.  Find out exactly what error codes will be generated for the routine problems that you want to ignore (I just made up numbers -1234 and -1236 above) and test specifically for them.

Similar Messages

  • MM question related with Materail...

    Hello !
    I had one plant in Bangalore and one plant in Pune.
    At Bangalore plant I am manufacturing a Finished Product, which is a Semi Finished Product for my Pune plant. My question is How to show this Finished Product at Pune plant and as what?

    hi,
    i would be suggest to extend the finished material to Pune Plant and you can view the material in Pune plant.
    for more information:
    1. Raw Material: (a) It is the Basic Input material which you use for Production of your desired Product. Generally raw material is procured from outside sources or purchased from vendors. So for Raw Material Purchasing View needs to be there.
    (b) Some industries Sell the Raw Materials also. So in order to sell the Raw Material, you have to extend Sales Views for that Material.
    2. Semi-fin: (a) Semi-fin product is a product which is produced either from RAW MATERIAL or any other Semi-finished Product. So generally, a semi-fin product gets produced in industry itself. So no Purchasing View or Sales View needs to be maintained. But for Production of a Product, you need to Maintain MRP Views and Work Scheduling Views (Must Condition).
    3. Finished Prod: A product which is ready to be sold to Customers. So in order to sell it, Sales Views needs to be Maintained. If you are purchasing your Fin-mat from outside then you need to extend the Purchasing View.
    Regards,
    PK.

  • Question relating with DB Link

    How will i know whether the db link that has been created is a PUBLIC or Private ??
    I wanted to know the System tables(views) for the same.

    Hi,
    you can query all_db_links:
    select * from all_db_links
    where db_link = 'database_link_name_you_search';The column OWNER gives then "PUBLIC" for a public DBLINK or the name of the owner if it is a private one.
    Herald ten Dam
    http://htendam.wordpress.com

  • Related with the royalty of the sound tracks

    Hi
    I have a question related with the royalty of the sound tracks in final cut, I used one of the soundtracks in one of our videos and when we try to upload it to dailymotion, they refuse because they said it has copyright issues, any idea why?
    I was with the idea it was royalty free and we could use it, is this true?
    Regards

    I had a similar issue with youtube a number of years ago.  Seems Apple licensed some samples from APM.  When I uploaded, the youtube censoring software read the copyright metadata and bounced the file.  Had to do a bunch of e-mails back and forth, and finally got uploaded.
    If it's part of your soundtrack install, it is royalty-free and you can use it.

  • Sir you have replied for my question, and i updated my software and all those things, yet it is showing unable to connect network, but i can use internet by sim, is it the problem related with hardware? can you tell me a solution for it?

    sir you have replied for my question, and i updated my software and all those things, yet it is showing unable to connect network, but i can use internet by sim, is it the problem related with hardware? can you tell me a solution for it?

    you seem to be referring to an ongoing issue
    click here to respsond -> sir help me to enable my network connection, my iphone 4s is not connecting with any wireless connection, what i should do for enabling network connection?
    CCC

  • The PowerShell script failed with below exception

    I'm receiving the following errors on all SQL Express Servers (every machine that has SQL Express inside).
    it seems that the discovery has found SQL Express but could not connect to the instance.
    details on the alerts:
    Date and Time:
    10/22/2013 12:04:22 PM
    Log Name:
    Operations Manager
    Source:
    Health Service Modules
    Generating Rule:
    Collect Power Shell Module Events
    Event Number:
    22406
    Level:
     Error
    Logging Computer:
    SQLEXPRESS.DOMAIN.COM
    User:
    N/A
    Description:
    The PowerShell script failed with below exception
    System.Management.Automation.RuntimeException: Exception calling "Fill" with "1" argument(s): "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not
    accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
    At line:44 char:19
    + $SqlAdapter.Fill <<<< ($DataSet)|out-null
    at System.Management.Automation.FlowControlNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
    at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
    at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
    Script Name: StolenServerMemory2008.ps1
    One or more workflows were affected by this.
    Workflow name: Microsoft.SQLServer.2008.DBEngine.StolenServerMemoryMonitor
    Instance name: SQLEXPRESS
    Instance ID: {9705795C-4F3B-C2EF-AA7D-C736B40FD6A4}
    Management group: SCOMGROUP 

    Some additional inf.
    http://stackoverflow.com/questions/6466974/unable-to-connect-to-sql-express-error-26-error-locating-server-instance-speci?rq=1
    anyway you can disable this rule/monitor as no control from monitoring solution in that case. Or try to rewrite the same monitor...
    The problem in your case is when function tries to get Max Server Memory MB by connecting to master DB, but you can replace it with performance counter like Target Server Memory (KB)...
    just see the function main in StolenServerMemory2008.ps1 and what you need to replace
    $api = New-Object -comObject "MOM.ScriptAPI"
    $bag = $api.CreatePropertyBag()
    $msg = [Environment]::NewLine
    $err = [Environment]::NewLine
    #try {
    $maxMemoryMB = GetMaxServerMemoryMB $ComputerName $InstanceName
    $stolenPages = (Get-Counter ("\" + $PerformanceCounterObject + ":Buffer Manager\Stolen Pages")).CounterSamples[0].CookedValue
    $pakeSizeKB = 8
    [double]$stolenMemoryMB = $stolenPages * $pakeSizeKB / 1024                                      
    [double]$stolenMemoryPercent = 0
    if($maxMemoryMB -gt 0){
    [double]$stolenMemoryPercent= 100.0 * $stolenMemoryMB / $maxMemoryMB
    $bag.AddValue("StolenMemoryMB", $stolenMemoryMB)
    $bag.AddValue("StolenMemoryPercent", $stolenMemoryPercent)                                  
    $msg += "StolenMemoryMB=$stolenMemoryMB StolenMemoryPercent=$stolenMemoryPercent"
    $msg += [Environment]::NewLine                          
    #debug $api.LogScriptEvent("SQL 2008 Stolen Server Memory data source", $SCRIPT_EVENT_ID, $INFORMATION_EVENT_TYPE, $msg + $err)                     
    #catch {
    #             $header = "Managegement Group: $Target/ManagementGroup/Name$. Script: {0}" -f ($MyInvocation.MyCommand).Name.ToString()
    #             $msg += "Error occured during SQL 2008 Stolen Server Memory data source executing.{0}Computer:{1} {0}Reason: {2}" -f [Environment]::NewLine, $env:COMPUTERNAME, $_.Exception.Message
    #             $api.LogScriptEvent($header, $SCRIPT_EVENT_ID, $ERROR_EVENT_TYPE, $msg + $err)                           
    $bag

  • Question related to SCJP 6 certification

    Hi Everyone,
    Just have question related to SCJP Exam.
    I have started to prepare for SCJP 6 from yesterday (3-4 hours in a day) and I am planning to take SCJP exam in march last week. can u suggest books, which I need to go through..and also I need to write exam at earliest..Do I need to take more than one month for preparation....or less than that is it possible for good knowledge and score?
    Thanks,
    Naveen

    Hello Naveen,
    I am also goining to write SCJP1.6 exam(hopefully this month end).
    I am referring Kathy Sierra, Bert Bates SCJP1.6. It is an awesome book and it include 350+ mock question excluding the ones you get at end of each chapter.
    I dont know whats the level of your Java knowledge. In my opinion someone who has a fair amount of knowledge of the subject should take atleast 2 month of preparation before taking the exam. Syllabus for SCJP6 is more or less easy(except for few concepts) but you know what makes it a difficult exam is the minor details which we tend to ignore while studying the Java subject.
    Also the questions will contain more than 1 correct answer which you cant answer correctly unless you have pracised a lot of mock exams.
    So my advise to you is :take time to brush up the minor details of the subject and do lot of mock tests. That ways you can ensure good marks.Dont hurry, else you may clear the exam but not with good percentile.
    Thats all knowledge I wish to give you.
    Let me know if you want some more.
    Best of Luck for your exam,
    Best regards,
    Suvojit CHAKRABORTY

  • Question related to combining rows...

    Hi,
    I have a question related to combining rows...
    From our typical tables.... Dept and Emp.
    I want a result set like....
    Dept# | Employees
    10 | <Emp1>, <Emp5>, <Emp6>
    20 | <Emp7>, <Emp2>, <Emp8>, <Emp9>
    30 | <Emp10>, <Emp11>
    40 | <Emp12>
    Plesae give me the query...
    Thanks
    Abdul.

    How about this solution looks like?
    create or replace
    function fnc_concat_data(p_query VARCHAR2,P_ID NUMBER) RETURN VARCHAR2
    AS
    type res_tab is table of varchar2(20);
    result_tab res_tab;
    v_retval varchar2(256);
    begin
    execute immediate p_query || p_id BULK COLLECT into result_tab;
    FOR i IN 1..result_tab.COUNT LOOP
    v_retval := v_retval||','||result_tab(i);
    END LOOP;
    v_retval := substr(v_retval,2);
    return (v_retval);
    exception
    when others then
    return('Error');
    end fnc_concat_data;
    sql> select deptno, fnc_concat_data('select ename from emp where deptno=', deptno) employees from emp group by deptno
    deptno employees
    30     ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    20     SMITH,JONES,SCOTT,ADAMS,FORD
    10     CLARK,KING,MILLER

  • Receiving error: Terminating app due to uncaught exception 'MFSQLiteException', reason: 'inserting mailbox url' abort() called terminating with uncaught exception of type NSException

    Today, I received this error when I re-added two email accounts that are tied in to my domain. The error is: "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'inserting mailbox url' abort() called terminating with uncaught exception of type NSException"
    Two days ago, at my wits end with email issues, I googled how to Reset Mail.app and followed the recommendation found here: https://discussions.apple.com/thread/2266399?tstart=0
    That's. all. I've. done.
    What should I do correct the error I'm receiving when adding my email accounts?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • Will the new 10.6.8 update fix SATA3 issues related with 2011 MacBook Pros?

    Will the new 10.6.8 update fix SATA3 issues related with 2011 MacBook Pros?

    It is against TOU to speculate on these message board.  Suggest you post your question on the Mac Rumors site.
    As I already stated, there is no 10.6.8 update.  If there was, it would be listed in Software Update.

  • Table Relation with Payment and Invoice of Vendor

    Hi all,
         I have one question about Table Relation with Payment and Invoice of Vendor.
         the scenario is.
         2 Purchase Order number : 100000001/100000002
         1 Invoice document number : 200000001 which include  2 Purchase Order.
         1 Payment document number : 300000001
         How should I found out table relation from Payment document number - Invoice document number - Purchase Order number. ?
          I try to link the following table, but it does not work.
          RBKP     *     Invoice Receipt
          RSEG     *     Invoice Receipt document line item
          BKPF     *     Accounting Document Header
    BSEG     *     Accounting Document Segment
    PAYR          Payment Medium File
    BSIK          Accounting: Secondary Index for Vendors
    BSAK          Accounting: Secondary Index for Vendors (Cleared Items)
    BSIS          Accounting: Secondary Index for G/L Accounts (Open Items)
    Does any one know about it ?
    Regards
    KY Chuang

    Hi Venkatesh,
    Thnx a lot for the reply. This has almost solved my problem, however there's one thing left. when I'm trying to take a print out after exporting the info into an excel sheet, the information really looks scattered, i.e.,  is there a way where we can go ahead and get the info in a rather unscattered manner.
    I've tried to take a print directly without actually transferring the info into an excel sheet, then each of the vendor is printed in a separate page, which again they feel is a problem.
    So, if you have an idea pls suggest.
    Thnx again for the information.
    regards
    sandhya

  • Questions relating to Groupware Integration (Outlook)

    Hello,
    I have few questions relating to groupware integration for Outlook:
    Q1) The "Relate to CRM" option in outlook add-in for end user is available only  in client side integration? Is it not available for server sider integration (i.e. in server side, end user cannot directly assign CRM account or Transaction to object in outlook the way it is done in client side)?
    Q2) Is there any end user interface (like add-on) available in server side?
    Q3)In client side - Can the outlook add-on for SAPCRM be enhanced for different business logic or look n feel?
    Thanks,
    Vicky

    Hello Vicky,
    1) Yes the Relate to SAP CRM function is part of Client-side groupware only.
    2) The Add-in is only available with Client-side groupware.
    3) The Add-in cannot be customized. However the results can be influenced by parameters in transaction GWIPROFILE.
    The information displayed in the Business information Pane can be changed.
    Best Regards,
    Gervase Auden

  • Basic Questions related EHPs for SEM

    Hi Guys,
    I've some basic questions related to EHPs: -
    1. If we don't mean to implement any of the new functionalities does it make any sense to implement EHP? In other words do EHPs also have some general improments other than the functionalities which can be specifically activated?
    2. If we just activate a functionality and don't implement/ use it can there be any negative impact?
    3. In case of a pure technical upgrade from SEM 4.0 to SEM 6.0 which EHP would be recommended?
    4. Is there a quick way to find all relevant notes in EHPn which are related to corrections for EHPn-1?
    Thanks in advance,
    -SSC

    HI,
    If you see some of my older posts I have had many issues with certain features of the EHP2 functionality but that doesn't mean I would recommned against it.
    BCS 6 EHPs 3 & 4  (BCS 6.03 / 6.04) - enhancement packs worth implementing?
    BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack
    My recommendation is to implement the EHPs but not necesarrily activate the functions (in SFW5) unless you need them - this means that you will only have to test once after EHP implementation and will have the ability to activate the other features as and when required (although testing is required after activation of course) whereas it might be difficult to persuade your client/basis team to implement EHP4 later if you don't do it now.
    In the features of EHP2 (activate FIN_ACC_GROUP_CLOSE) it states that there is a general performance improvement - although I have yet to experience it! From OSS note 1171344 "The functionality which is available in EHP2 consists of...
    ... Performance improvements of status management, reporting and initial start-up of consolidation workbench and monitor.
    Since activating FIN_ACC_GROUP_CLOSE I have had many OSS notes requiring application but i discovered that when the technical team implemented the EHPs (before i joined this client) they somehow forgot the latest SP (support packs) and didn't upgrade to the current level - so make sure that you get the right SPs too (see the links in Greg's link above) to avoid the many OSS notes.
    As for your question - "is there a list of OSS notes to specific to EHP upgrades? - the answer is most definietly "NO" - I already asked OSS in desperation!
    however, you can see the OSS notes that i have applied listed in the above link ( BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack )

  • SQL Server Agent ... Relation with BizTalk.

    Hi All,
    I know that there are jobs in SQL Server Agent which are used to perform some activity on scheduled basis like Purging,backup etc...
    what happens if SQL server agent service is in Stop mode(is it mandatory to have it started) and does it have any relation with BizTalk BAM.
    Praj Dixit

    Yes, you have to make sure the SQL Server Agent is running on the SQL Server. When the SQL Server
    Agent is stopped, the built-in BizTalk SQL Server Agent jobs that are responsible for database maintenance cannot run. This behaviour causes database growth, and this growth may cause performance issues. 
    SQL Server Agent jobs except the MessageBox_Message_Cleanup_BizTalkMsgBoxDb job should be enabled and running successfully. 
    You can learn about the SQL Server Agent jobs at Description of the SQL
    Server Agent jobs in BizTalk Server
    Regarding BizTalk BAM,
    Yes Backup BizTalk Server Job takes the backup of BAM Primary Import, SQL NS as
    well as other BizTalk databases. The BAM Analysis database, BAM Star Schema Database and Tracking Analysis Server database store content in SQL Server Analysis Services cubes. The Backup BizTalk Server job does not back up these databases. Instead, to
    backup these databases, it uses SQL Server Analysis Manager.
    I found this utility (BizTalk Monitoring
    Automation Utility) very useful to automate the monitoring of
    your BizTalk environment. If you have liberty to go with a paid tool,
    BizTalk360 a monitoring and support tool is the one for you.
    Rachit

  • Some questions related to SAP XI

    Hello!
    I would like to know the answers for the following questions regarding SAP XI-context (if it possible with Yes/No and a short comment/explanation)
    <b>CAPACITY PLANNING GUIDELINES</b>
    a) Guidelines to size the server(s)?
    b) Guidelines for sizing the over all environment for High-Availability
    <b>ARCHIVING CAPABILITIES</b>
    a) Approach to archiving of obsolete data
    <b>PLATFORM SUPPORT</b>
    a) Software supported on HP-UX 11.i V2 (r6) on Itanium.
    b) software supported on Windows 2003 sp1 (x64) on AMD Opteron 
    c) software support aligned with release roadmaps for future versions of HP-UX and/or Windows Server
    d) Software supported on OS clustered servers  (If mutliple products, please indicate if all are support or list areas where clustering may not be recommended and why)
    <b>RELATIONAL DATABASE </b>
    a) Does your system run native to the Oracle 10g RDBMS (RAC) and database tools?  If not, please explain the databases and tools supported.
    b) database monitoring tools be used to manage impending maintenance needs and potential problems and performance impacts (i.e., tool will monitor and detect prior to real problem occurring)
    c) standard pre-defined SQL queries and related calculations provided for use with industry standard reporting tools
    d) database accept binary-large-objects (BLOBs) and  be referenced via the relational engine.
    Thank you in advance!
    Regards!
    A.Henke

    two questions related to this:
    1. Why Java is designed to only permit single
    inheritence, any stories behind the scene? I think
    some major reasons why "prefer interfaces toabstract
    classes" is accepted is rooted in this limitation.Yes, one of the reasons interfaces are better is that
    you can only extend one class, but implement many
    interfaces. Say you have a concrete class that should
    "implement" two different types. If those types were
    defined as abstract classes, you could only use one
    type. You could implement both types if they were
    interfaces though. So why java is designed to have this limitation? There may be some arguments before this is settled down. I always like to hear this kind of stories:)
    2. Base on the fact that once an interface is outof
    box and widely implemented, it is almostimpossible
    to change it. So how you guys design yourinterfaces?
    Could you share some? In my idea, I would designmy
    interfaces as compact as possible.You could extend the interface and start using that
    if you didn't want to break existing code. You
    couldn't use that implementation as an Interface1
    though, since the new methods only exist in
    Interface2, so that's not an optimal solution.So we may always need to add a new interface when we just want to add a new method.

Maybe you are looking for