Dynamically call DBMS_XMLINDEX to drop parameter and exit with exception

Hi All,
I am trying to create a procedure to dynamically call DBMS_XMLINDEX.dropparameter.
If the parameter does not exist then gracefully exit with exception as 'Parameter does not exist'.
But I keep on getting errors due to dynamically passing.
Procedure is something like:
Create PROCEDURE drop_parameter(p_parameter IN VARCHAR2)
IS
no_parameter EXCEPTION;
PRAGMA EXCEPTION_INIT(no_parameter,-12004);
BEGIN
EXECUTE IMMEDIATE 'DBMS_XMLINDEX.dropparameter( ''||p_parameter||'') ';
dbms_output.put_line('Parameter dropped');
EXCEPTION
WHEN no_parameter THEN
dbms_output.put_line('Parameter does not exist');
END drop_parameter;
For implementaion we can try creating parameter as :
BEGIN
DBMS_XMLINDEX.REGISTERPARAMETER (
'Param1',
'PATH TABLE PathTB1
PATHS (INCLUDE ( /a/b/c
/d/e/f
END;
The above parameter should be dropped or if not existing, then exit gracefully.
Please suggest.
Thanks...

You're testing the wrong error code...
ORA-12004 : http://docs.oracle.com/cd/E11882_01/server.112/e17766/e9858.htm#sthref3299
Try with ORA-44737, for example :
SQL> set serveroutput on
SQL>
SQL> BEGIN
  2  DBMS_XMLINDEX.REGISTERPARAMETER (
  3  'Param1', 'PATH TABLE PathTB1 PATHS (INCLUDE ( /a/b/c /d/e/f ))');
  4  END;
  5  /
PL/SQL procedure successfully completed
SQL>
SQL> CREATE PROCEDURE drop_parameter(p_parameter IN VARCHAR2)
  2  IS
  3    no_parameter EXCEPTION;
  4    PRAGMA EXCEPTION_INIT(no_parameter,-44737);
  5  BEGIN
  6    DBMS_XMLINDEX.dropparameter(p_parameter);
  7    dbms_output.put_line('Parameter dropped');
  8  EXCEPTION
  9    WHEN no_parameter THEN
10        dbms_output.put_line('Parameter does not exist');
11  END;
12  /
Procedure created
SQL> exec drop_parameter('Param1');
Parameter dropped
PL/SQL procedure successfully completed
SQL> exec drop_parameter('Param1');
Parameter does not exist
PL/SQL procedure successfully completed
(and again, you do not need dynamic code)

Similar Messages

  • Types of variables and exits with screen shots

    Hi folks,
    I want to know types of variables and Exits and  how they are useful in reporitng.
    Please can body send me the docs or procedures how to use this.
    Useful docs/screen shotts will be hightly appreciated n wiil be assigned points.
    thanks in advance.
    Urs,
    raki

    Hi,
    Variable types:
    http://help.sap.com/saphelp_nw04/helpdata/en/c1/759b3c4d4d8d15e10000000a114084/frameset.htm
    Customer Exits :
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
    regards
    Happy Tony

  • Iphone drops gsm and wifi with certain apps s.a. maps

    Some apps where the iPhone drops gsm and wifi signal:
    e.g. In google Maps, I want to download a map of my region by typing th command “ok maps” into the map's app search bar and tap search. Dowloading starts, but then the iPhone drops gsm and wifi signal before the download is complete, then the signals come on again after a couple of seconds.
    e.g. in google+ idem drops gsm and wifi signal, which come on again after a couple of seconds.
    How come and is there a solution?
    Thy

    Hey svenaerts228!
    Here is an article that can help you troubleshoot this issue with your connection to data signals:
    iPhone: Troubleshooting No Service
    http://support.apple.com/kb/ts4429
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • RoboHTML.exe exits with exception

    I've just installed RoboHelp Office V10. Everything seems fine except for one problem. If I try to generate printed documentation, then RoBoHTML.exe exits with an exception.
    I have Microsoft Office 2010 installed also.
    Any idea who this should be reported to and how?
    Anyone seen anything similar, and have a fix?
    TIA
    Mick Mathers

    The problem I have seen always enables the option within a few minutes so clearly something else is wrong.
    According to Adobe's page on Activation, other causes are you have Volume Licensing, the product is part of a suite and you need to deactivate that, or you cannot connect. I had to get our IT guys to approve the link before Update would work. What I am not following is that unless you are a government department or similar, you have to activate online, no exceptions. What request / response code are you talking about as we have been through the activation issue before and there are NO exceptions.
    This is all getting away from the problem though of being able to print. Where does your Normal.dot template reside? We have seen issues when IT put it on a network drive.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • ApplicationDidReceiveMemoryWarning and exit with "error status 101"

    My application crashed with memory error. It doesn't show any memory leak, but handles a large database and it looks like, its cache causes this problem.
    I fixed it by closing database and reopen it inside "applicationDidReceiveMemoryWarning".
    It works great on the first call to applicationDidReceiveMemoryWarning (actually significantly dropping the memory usage). But the function is never called again, and my application eventually crashes after a few minutes of heavy usage with "error status 101" .
    My understanding is that "error status 101" happens when app doesn't release memory properly on didReceiveMemoryWarning, but in my case, it just crashes without giving me a chance to clean up.
    Any idea on what's going on here?

    Yes, actually, the other answer you got was wrong.
    Just throw an error inside the script, probably (given what you want to do) at the end. For example:
    osascript -e 'error "This is a test." number 9000'
    on the command line will give (on the command line) something like:
    6:22: execution error: This is a test (-128)
    If you read the man page for osascript, you will see that by default script errors are written to stderr; if you have your shell script watch stderr between the start of the script and the end of it, you'll catch the result message.
    A few things to keep in mind:
    --> AppleScript can catch its own errors using a "try" block, similar to in other languages. The basic syntax is:
    try
         (* Do some stuff here *)
    on error msg number num
         (* Process the error here *)
    end try
    --> If you throw an error yourself, try to use an error number which is "safe". Most of the negative numbers are already in use as standard signals. For example, -128 is "User canceled", while -43 is "file not found" (which pops up if you cast a string to an alias and the string does not describe a path to a valid item in the filesystem -- that's actually a very simple way to test for file existence). If you use numbers starting with 9000, which seems to be the consensus starting point, then you have the additional advantage of being able to figure out where things went wrong.

  • Try to call wfs.exe (MS fax and scan) with webutil_host !!

    hi,
    I would call from Forms the MS scan and fax application “wfs.exe”.
    This is found under windows\system32.
    call:
    WEBUTIL_HOST.NONBLOCKING ('cmd /c C:\windows\system32\wfs.exe');
    Unfortunately, nothing happens. No error message and no cmd-process remains open in the taskmanager.
    with other applications it works. For example:
    WEBUTIL_HOST.BLOCKING('cmd /c C:\Windows\System32\notepad.exe');
    WEBUTIL_HOST.BLOCKING('cmd /c C:\Windows\System32\calc.exe');
    I use Forms 10.1.2.3 on Windows 7.
    Does anyone have any idea or can test that if it works?
    thx Alfred

    you can use
    WEBUTIL.client_HOST ('cmd /c C:\windows\system32\wfs.exe',hide_screen);
    instead of
    WEBUTIL_HOST.NONBLOCKING ('cmd /c C:\windows\system32\wfs.exe');
    which will run the wfs.exe file located in the windows\system32 directory. if client machine is on the windows O/S
    you can view the process list by tasklist command on the command prompt.
    you can use cmd /k option for remaining in that session for the errorlevel checking.

  • No point of using Skype.. calls are getting drop f...

    No point of using Skype.. calls are getting drop frequently..
    I have waisted time and money too here.
    My calls are getting dropped again and again.. now i am thinking how to finish available balance.
    anybody can suggest me how to use my rest money because calling someone is not worth.

    Please,  run the DirectX diagnostics tool. Go to Windows Start  and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post. Be aware that you will have to zip this file before attaching it here.

  • Profiler API - Locks, Threading.Monitor.Enter and Exit

    I'm using the Profiler API in a project in order to track the locks made using Monitor.Enter, Monitor.Exit, and the lock keyword. I planned to do this by outputting using a pipe, the events from the FunctionEnter3WithInfo and FunctionLeave3WithInfo callbacks.
    These callbacks are called when methods are entered and exited, and appear to be functioning fine regarding their implementation - they generate a large output of methods that had been entered and left, but I'm not receiving callbacks for the following:
    ENTER: Monitor.Exit
    LEAVE: Monitor.Enter and Monitor.Exit
    Oddly enough, I do get receive a callback for entering Monitor.Enter. Other than these problematic methods, I appear to be getting calls from the Profiler API for everything else. 
    Is there a known issue regarding these methods not being reported by the API? 
    Alternatively, if there's a better way of achieving my goal than the way I'm doing it, feel free to point me in the right direction :)
    Thanks,
    Olu

    Thanks for the reply Brian,
    I don't get a JITInlining callback for Monitor.Exit (however I do for some Monitor.Enter calls). For FunctionTailcall3WithInfo, I also don't get a callback for Monitor.Exit (but I do for some Monitor.Enter calls).
    I'm not getting anything from ExceptionUnwindFunctionEnter, though when manually tested by throwing an exception within a try-catch, I get a callback.
    If it helps, I have the following flags set for events:
    COR_PRF_MONITOR_ALL
    COR_PRF_ENABLE_FUNCTION_ARGS
    COR_PRF_ENABLE_FUNCTION_RETVAL
    COR_PRF_ENABLE_FRAME_INFO
    Additionally, I've tried the following flags to see if it resolves the issue:
    COR_PRF_DISABLE_INLINING
    COR_PRF_DISABLE_OPTIMIZATIONS
    Edit 1: Using COR_PRF_DISABLE_OPTIMIZATIONS now means I get a callback to FunctionLeave3WithInfo when Monitor.Enter leaves, however there is still no sign of Monitor.Exit
    Edit 2: As a test, in the small application that I'm profiling, I've wrapped the Monitor.Exit and Monitor.Enter method calls in another class, so I can call them as so:
    CCMonitor.Enter(obj) and CCMonitor.Exit(obj).
    The profiler reports both the enter and leave of these functions correctly.
    Thanks,
    Olu

  • WiFi Dropping On and Off

    I got my 3g iPhone over the weekend, and have had trouble staying connected to WiFi networks. I've tested on three different WiFi networks and had the same results:
    1. iPhone takes awhile (maybe a minute or so) to find the network in order to sign on initially.
    2. iPhone often does not show full strength on the WiFi signal indicator, even when I am within 5-10 feet of the wireless router, with nothing between iPhone and router.
    3. iPhone will lose WiFi connection within 1-3 minutes, and periodically pick it up again, dropping on and off with no perceivable rhyme or reason. This happens at very close distances to the router, and farther away (25-50ft.), and it happens without moving the iPhone...sitting on a table or desk, it will just drop WiFi and pick it up.
    Anyone have any thoughts on this? Thanks.

    Trey Miller wrote:
    I am open to changing the channel on the wireless network, but given the zero-distance scenario above, >isn't it safe to rule out interference?
    No. The devices described in the article above can still cause interference.
    Is there any chance this is an iPhone hardware issue? If so, what are my potential remedies, given that I >bought it less >than a week ago? It seems unlikely to me, but I hate beating my head against the wall >unnecessarily.
    This does not sound like a hardware issue with the iPhone but, if you believe it is, you can make a reservation to see a Mac Genius. The Mac Genius can take a look at the iPhone and test it with the open Wi-Fi network at the Apple retail store.
    http://www.apple.com/retail/geniusbar/
    I recommend restoring the iPhone to rule out software issues.
    http://docs.info.apple.com/article.html?artnum=305744
    Make sure the wireless router has the latest firmware updates available. Also, try to hard reset the router to factory default settings and reconfigure it.
    Jason

  • OS X Server 10.4 won't boot: AppleFileServer: Server crashed and exited...

    OS X Server 10.4 won't boot. Starting in verbose mode the error is :
    /usr/sbin/AppleFileServer: Server crashed and exited with status 4.\n
    Ran fsck, and reported errors. Ran DiskWarrior and those errors seem to have cleared up. Running fsck now reports clean. Running disk utility reports no errors.
    Must be a corrupt config file, but where to begin?
    Any help appreciated. Thanks!

    Your enclosure is locked.
    When the enclosure is locked, keyboard input is disabled (as a security measure).
    Unlock the enclosure (the little lock wheel on the front of the server) and your keyboard will magically start working.

  • How do i Call an a method on and object that is a parameter

    I have thee code as below.
    I want to call the method setValue and set the value and pass it a String. i want it called on the jobject param1.
    What do i need to call todo that given the below code.
    JNIEXPORT jobject JNICALL
    Java_PassObjectAndDoSomething_nativeMethod(JNIEnv *env, jobject obj, jobject param1) {
        jstring jstr;
        jclass cls2 = (*env)->GetObjectClass(env, param1);
        jmethodID mid3 = (*env)->GetMethodID(env, cls2, "setValue", "(Ljava/lang/String;)V");
        if (mid3 == NULL) {
            return NULL;
        jstr = (*env)->NewStringUTF(env, "My brand new JString");
        if (jstr == NULL) {
             return NULL;
        /*This causes errors when called*/
        (*env)->CallObjectMethod(*env, param1, mid3, jstr);
        return param1;
    }

    daniel_p wrote:
    /*This causes errors when called*/Presumably you mean a system exception and not java exception of some sort.
    (*env)->CallObjectMethod(*env, param1, mid3, jstr);Why is the asterisk in front of the env parameter in CallObjectMethod()?
    return param1;Since you passed that in it is obviously pointless to return it. But that has nothing to do with your problem.

  • How to open new form and exit from the calling form on dual/multi language?

    using form 10g 10.1.2.0.2.
    i have dual language application 1 english & 1 arabic and i created forms identically each respectedly to call and switch every forms when user choose any language it uses.
    say im in currently in english. how we can call the arabic module and exit totally in english module , vice versa?
    also the form system messages. how we can switch it between two language?

    NEW_FORM() will totally replace the calling module.
    Francois

  • I did the software update ios 7 and now i cant hardly get wifi and my calls are being dropped.

    I did the software update ios 7 and now i cant hardly get wifi and my calls are being dropped.Can anyone help me?

    I updated my ipad to the ios7.4 and my wifi connection just wouldn't work any longer.

  • I have made a ztabale 'zres_approval-pernr' and selection screen which is working fine  . Now i want to call transection MB22 on parameter s_rsnum ..

    MR Authorization Process Steps:
    REPORT  zsat_project.
    TABLES : zres_approval .
    DATA: v_ecode LIKE zres_approval-pernr_d.
    DATA: v_posid1 LIKE zres_approval-posid1,
           v_posid2 LIKE zres_approval-posid2,
           v_posid3 LIKE zres_approval-posid3,
           v_posid4 LIKE zres_approval-posid4,
           v_posid5 LIKE zres_approval-posid5,
           v_posid6 LIKE zres_approval-posid6,
           lv_kostl LIKE rkpf-kostl.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
    SELECTION-SCREEN BEGIN OF LINE .
    SELECTION-SCREEN COMMENT 1(15) text-007  .
    PARAMETERS : s_rsnum TYPE rsnum OBLIGATORY .  " TABLE NAME - RESB
    SELECTION-SCREEN END OF LINE .
    SELECTION-SCREEN BEGIN OF LINE .
    SELECTION-SCREEN COMMENT 1(15) text-002 .
    PARAMETERS:  s_ecode TYPE pernr_d OBLIGATORY . " TABLE NAME -
    SELECTION-SCREEN COMMENT 65(15) text-003 .
    PARAMETERS: s_pwrd TYPE password OBLIGATORY .
    SELECTION-SCREEN END OF LINE .
    SELECTION-SCREEN END OF BLOCK b1 .
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-004 .
    SELECTION-SCREEN BEGIN OF LINE .
    SELECTION-SCREEN COMMENT 1(15) text-005 .
    PARAMETERS:s_opwrd TYPE password .
    SELECTION-SCREEN COMMENT 65(15) text-006 .
    PARAMETERS: s_npwrd TYPE password .
    SELECTION-SCREEN END OF LINE .
    SELECTION-SCREEN END OF BLOCK b2 .

    Call transaction MB22, put the cursor on reservation field and press F1, then press either F9 or click on technical information, there you should find the Parameter ID to fill. Here you are lucky there is one so just SET PARAMETER ID and CALL TRANSACTION ... AND SKIP FIRST SCREEN.
    Just some remarks.
    Were you unlucky (next time ?) you may be required to look at PBO modules (or report event like INITIALIZATION) to find if and where the transaction looks for the initial values.
    Remember that the SKIP may not be performed if the dynpro number of the transaction initial screen is statically specified as its next dynpro
    If no solution found, you may be required to build a small BDC.
    Regards,
    Raymond

  • My iphone hangs any time.I see a call coming but i cannot attend. My call drops anytime and i cant even end the call.The settings page doesnt respond many times.I have given the phone to Apple care , they update the software and return it back to me

    My iphone hangs any time.I see a call coming but i cannot attend. My call drops anytime and i cant even end the call.The settings page doesnt respond many times.I have given the phone to Apple care , they update the software and return it back to me.IT WORKS FINE FOR 3-4 DAYS AGAIN THE SAME. Its under warranty and i am disappointed with the Apple product and service

    If you used your backup to restore the data after it got returned, set it up as new device and don't use the backup data afterwards. It seems that some data inside the backup are corrupt. Follow this article and set up the account info and other setting manually after that:
    Use iTunes to restore your iOS device to factory settings - Apple Support

Maybe you are looking for

  • How can I cancel my iCloud Storage Upgrade?

    I enthusiastically upgarded my storage to 100GB the other day, thinking that iCloud would suit my needs.  However, I am on Google Apps for my business and it seems that iCloud will not sync, and I am not willing to switch to all iCloud at this time.

  • How can I get my iMac to reconize my LG Optimus 5 phone so I can transfer itunes. When I plug it in it does not recognize the phone

    I have an iMac that I want to transfer stored itunes to my Optimus LG 5 android phone. When I plug my phone into the computer the computer does not recognize the phone. What can I do to so I can then transfer my tunes?

  • DOUBTS FOR MIGRATION FROM 10.1.2 TO 10.1.3

    Hi all, I have done an attempt to migrate a simple web app from 10.1.2 (using UIX technology) to 10.1.3; the migration seem ok, but at run-time appear the error in the browser: 500 Internal Server Error Cannot get request dispatcher for path /test.ui

  • Enlarging/​reducing document size when scanning.

    Is it possible to enlarge/reduce a document size on the Deskjet 2540? My wife uses that function for her sewing patterns. If not capable, could someone please recommend software? Thank you, Tom This question was solved. View Solution.

  • A BEX Error From Word 2013

    Hello, I got a BEX error message when I use IE to open a word  document with word  in a B/S Application System. The error message "Microsoft has stopped working", below are the problem details: Problem signature: Problem Event Name: BEX Application N