Dynamically call DBMS_XMLINDEX to delete the setting and exit with the exception

Hi all

I am trying to create a procedure to dynamically call DBMS_XMLINDEX.dropparameter.
If the parameter doesn't exist no then gracefully exit with the exception as "the parameter does not exist.
But I keep getting errors because of the dynamic passing.
Procedure is something like:


Create PROCEDURE drop_parameter (p_parameter IN VARCHAR2)
IS
no_parameter EXCEPTION;
PRAGMA EXCEPTION_INIT(no_parameter,-12004);
BEGIN
RUN IMMEDIATELY ' DBMS_XMLINDEX.dropparameter ("| p_parameter |") ';
dbms_output.put_line ('abandoned parameter');
EXCEPTION
WHEN no_parameter THEN
dbms_output.put_line ('parameter does not exist');
END drop_parameter;

For the implementation we can try to create the parameter in the form:

BEGIN
DBMS_XMLINDEX. () REGISTERPARAMETER
'Param1 ',.
' PATH TABLE PathTB1
Paths (INCLUDE (/ a/b / c))
/ d/e/f
))
');
END;
/

The setting above should be deleted or if not existing, then exit gracefully.
Please suggest.

Thank you...

You test the incorrect 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 even once, you do not need code dynamics)

Tags: Database

Similar Questions

  • If I block a caller, can I delete the number and still blocked it

    If I block a caller, can I delete the number and still blocked it?

    Yes. It is possible to block a contact and then delete the contact. They will be still blocked.

  • Once an unapproved site is added as an exception, how can I go back and delete the exception later?

    Once an unapproved site is added as an exception, how can I go back and delete the exception later?

    Thank you, Jefferson. You addressed the issue beautifully and delightfully complete.

    I found and deleted the server where I got the exception.

    "In the future, I suggest, by making an Exception, uncheck the box that adds a permanent exception. In this way, when you exit Firefox, the exception is removed automatically. »

    AHA. It's very good to know. I missed it when granting the exception today.

    The exception I gave (and now deleted) today wasn't really a risky site. I know the owner. Just a little problem in their relationship.

    Thanks again. And thanks Toddy... I did not say clearly what type of exception.

  • I have firefox clear history when it closes and it clears my exceptions to pop up windows whenever it closes. How firefox can erase history without deleting the exceptions to the pop-up windows?

    I have firefox clear history when it closes and it clears my exceptions to pop up every time it closes. How firefox can erase history without deleting the exceptions to the pop-up windows? Allow this makes it difficult to play of Facebook games like farmville, because I have to allow him every time, and I have to type in rather than it to automatically. Thank you, Jamie

    Do not remove the navigation, search and download history on Firefox to clear the "Site preferences".

    Compensation of the "Site Preferences" clears all exceptions for cookies, images, windows pop up, installation of software and passwords.

  • Why is it possible of the ripple is not delete an entry and exit section of a track of the timeline, while that in the same area there is one cut on another way?

    Why is it possible of the ripple is not delete an entry and exit section of a track of the timeline, while that in the same area there is one cut on another way?

    I posted a topic on it as well.  Seems like if update the CC has allowed me to finally extract any section marked in and out of any track independently of any other person when sync lock is disabled.  Very powerful (and very basic) tool!

  • Delete the exception management

    Hi guys,.
    I have a problem in my procedure. There are 3 parameters that I'm passing in the procedure. I am corresponding to these parameters to those of the table to delete one record at a time.
    For example if I want to delete the record with the values (' '900682', 3, July 29, 2008 ') as parameters, it deletes the record of table, but still when I run it with the same parameters must show me an error message but it again says "deleted the request for transcript...". "Can you please help me with this?

    PROCEDURE p_delete_szptpsr_1 (p_shttran_id IN saturn.shttran.shttran_id%TYPE,
    p_shttran_seq_no IN saturn.shttran.shttran_seq_no%TYPE,
    p_shttran_request_date IN saturn.shttran.shttran_request_date%TYPE) IS

    BEGIN

    DELETE FROM saturn.shttran
    WHERE shttran.shttran_id = p_shttran_id
    and shttran.shttran_seq_no = p_shttran_seq_no
    and trunc (shttran_request_date) = trunc (p_shttran_request_date);
    DBMS_OUTPUT. Put_line (' removed the transcript request Seq No. (' | p_shttran_seq_no | student (' | p_shttran_id |') for the requested date (' | p_shttran_request_date |'))) ') ;
    COMMIT;

    EXCEPTION WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT. Put_line (' error: the Notre Dame provided = student ID (' | p_shttran_id |))
    ('), Transcript No Request = (' | p_shttran_seq_no |) ('), Ask Date = (' | p_shttran_request_date | not found.');

    END p_delete_szptpsr_1;


    I have a SELECT statement to use NO_DATA_FOUND?

    A DELETE statement that will remove any line (such as an UPDATE statement that updates no line) is not an Oracle error. Oracle throws no exceptions.

    If you want your code throws an exception, you will need to write this logic. You can throw an exception NO_DATA_FOUND yourself, i.e.

    IF( SQL%ROWCOUNT = 0 )
    THEN
      RAISE no_data_found;
    END IF;
    

    If you go just to catch the exception, however, you could just some embedded code you would use to handle the exception in your IF statement, i.e.

    IF( SQL%ROWCOUNT = 0 )
    THEN
      <>
    END IF;
    

    In your original code, your exception handler is just a statement of DBMS_OUTPUT. It is incredibly dangerous in real production code. You rely on the fact that the customer has allowed him to exit, that the customer has allocated a sufficient buffer, the user will see the message, and that the procedure will never be called to any piece of code that never worry if it succeeded or failed. There are very few situations where those who are sure of things to build on.

    Justin

  • The virus that is being called "Toast Flip" on my system and interfere with my running.

    He appears first as an icon on the top right of the screen. Then later a black window appears on the left side of the screen, trying to settle into my system and finally say "failed to install." It is listed in 'My Computer' and cannot be deleted.

    Brettmcm,

    If you see this "FlipToast" in the Panel and it will not uninstall try to start safe mode and uninstall mode without failure or Mode safe mode with networking.  Also can you find in Program Files and folder to uninstall?  Also check the Menu start... see if he is there... If so, uncheck it and then go find it in Program Files (or wherever it is) and remove it.

    http://social.technet.Microsoft.com/forums/en-us/winservergen/thread/6000e1e9-4E3D-4839-879e-6c4f39f0e992

    Revo is a reputable program that is recommended to solve problems such as you have described: http://www.revouninstaller.com/revo_uninstaller_free_download.html

    Kind regards...

  • delete "Desktop Search" and replace with the original Windows search utility

    Under XP, (files and folders) Windows search has been replaced by "Desktop Search", which doesn't help.  How can I get the search utility original back?

    You can't do that.  There may be 3rd party applications that will do something similar.

    The search in XP has also been replaced in win 7 and win 8.

  • Once an unapproved site is added as an exception, how can I delete the exception?

    using FireFox 27.0
    I want to remove an exception for a website utrusted. There is no tools / Option / security in this version.
    Preferences / security is not the list either.

    See the image:

  • How to decipher the exception of certificate information

    I use Firefox 8 on Windows 7 Professional 64-bit.

    I was watching qriocity.com and received a notification that the identification information does not match (something to that effect). I chose the option to add an exception, thinking that I can easily find and delete the exception. After a lot of Googling, I found that the safe way to do this is got to tools-> Options-> advanced-> ViewCertificates encryption. The only tabs that are not empty are the servers and authorities tabs. On the servers tab, I found an entry under "Comodo CA limited" which looked related on qriocity website:

      Certificate Name: *.support.sonyentertainmentnetwork.com
      Server: qriocity-en-us.custhelp.com:443
    

    Without any other information, I decided to delete this entry. However, I'm wondering if these are in fact the certificate * exceptions * I look at. Thus, knowing * when * the exception has been added to eliminate any doubt that this is the exception, I added earlier. Is there a way to show the date added? Such a field does not seem to exist when I click on "show...". ».

    On a separate but related topic, I've also was looking for something relevant in the References tab. Are these all the powers that I have added, perhaps implicitly and unknowningly? Is it possible (and wise) to reduce this list to what it would be for a Virgin installation of Firefox?

    The entries you see in the Server tab are a permanent exceptions that you have accepted and those that are stored in the cert_override.txt file in the profile folder.

    Entered on the tabs authorities are build-in root certificates or intermediate certificates that Firefox automatically records.

    • Build-in root certificates show like "Builtin symbolic object" on the References tab, in the Certificate Manager.
    • Intermediate certificates stored show as "software security device.
  • Error 50103 - simultaneous analog Vout and wine with start of analog triggering

    Hello

    I'm stuck error 50103.  I looked on the Web site of NOR and worked through the 7 cases and think that my problem is the 6 case - although I'm not sure - and have no idea how to fix this. Basically, what I would do is out my signal and have receive side save after it passes through a noisy channel. To start, I have attached a trigger control so that the transmission or recording start before the input trigger exceeds a certain value (in my case, 3V).

    Could someone please look at my code (attached, called 'Optical_DPPM_V3.vi')) and try to give me an indication as to what I'm doing wrong? Thank you!

    Furthermore, I use examples of OR that I have also included in the .zip for reference file.

    SP

    P.S. hardware: LabView 8.2, NI PCI-6070E

    Hi gt3000,.

    Thanks for your reply. I actually solved the problem I called one of your offices directly and spoke with someone last night.

    Indeed, the problem was "case 6" as it is stated on the page you gave. "." When I spole with one of your colleagues, I was directed to an example that does most of what I wanted. If anyone is interested, you can follow this path to find:

    Help--> find examples--> material input and output--> DAQmx--> synchronization--> multifunction--> multi-function Synch AI - AO.vi

    It seems that the trick is to use an internal digital triggering to synchronize the CLK for VI and VO.

    If people are interested, I can send my final code around for a differential pulse modulator, triggered by an external analog voltage which the receiver registers and stores the values in a worksheet. My next goal is actually write the code for the receiver to demodulate information... here go us!

    Thanks again,

    SP

  • I can't delete a game called Float that gives the message waiting. The cross and the oscillation with delete option appear, but it won't when I select Remove. Any ideas please?

    I have a new mini iPad 4. I can't delete a game called Float that gives the message waiting. The cross and the oscillation with delete option appear, but it won't when I select Remove. I don't know how it came to be. Any ideas please? Thank you.

    First try a reset to see if it finishes downloading. Press and hold the home and power buttons until the Apple logo appears. Release the two buttons. Wait until the iPad tour starts on its own.

    Check if you can remove the application. If not go into settings > general > use iCloud and storage > storage > storage management. Wait for the list of apps to open. See if the float is on the list. If it is delete it from there.

  • With the help of dynamically called screw in TestStand deployment

    I write code to interface with a & Rohde Schwarz ZNB Network Analyzer.  I use LabVIEW 8.2 and TestStand 3.5.  For reference the ZNB driver is available here: R & S of ZNB Driver.  I use a slightly older version of the driver, some before they needed to LabVIEW 2009.  I am writing all the code on a development machine that has the full version of TestStand/LabVIEW and it works on another machine that has the TestStand deployment license.

    This driver is dynamically linked to some things he needs.  I am able to operate with simple LabVIEW EXEs but not in TestStand deployments.  The following excerpt comes from their documentation, explaining a little about how the driver works and how to use in LabVIEW EXEs.

    3.4.2 How to generate executables or libraries in LabVIEW driver kernel drivers instrument based on attributes is dynamically bound to any VI performed during execution. This can be recognized by the LabVIEW application builder. The LabVIEW application builder follows all the static dependencies and include them in the package distributed at the generation of an executable file.

    To create an executable in LabVIEW, please manually add all the screws in the \PREFIX \_utility\callbacks folder to the LabVIEW project. In the case of project based please add private to your project folder. With this reference manual, the driver core is included in the compilation and the driver core is accessible during execution.

    I can't get this to work in TestStand deployments at all.  I can't even connect to the device since the VI Init has these issues.  I get the same error for all the various attempts that I made.  The same error is that when you add manually the screws for the LabVIEW EXE.

    Error-1073807346

    Property in Rohde & Schwarz Vector Analyzer.lvlib:rsidr_core_session_fgv.vi-> network node

    Rohde & Schwarz Vector Network Analyzer.lvlib:rsidr_core_check_error.vi->

    Rohde & Schwarz Vector Network Analyzer.lvlib:rsidr_core_attribute_write_int.vi->

    Rohde & Schwarz Vector Network Analyzer.lvlib:rsidr_core_attribute.vi:3->

    Rohde & Schwarz Vector Network Analyzer.lvlib:rsvna.vi:2->

    Example 1 setting of the Instrument 24Default .vi:1->

    Rohde & Schwarz Vector Network Analyzer.lvlib-> efault Instrument Setup.vi

    Rohde & Schwarz Vector Network Analyzer.lvlib:Reset.vi->

    Rohde & Schwarz Vector Network Analyzer.lvlib:Initialize.vi->

    Connection of ZNB testing.VI

    VISA: (Hex 0xBFFF000E) the given reference of session or the object is not valid.

    So far, I tried the following, all solutions producing this same error.  I struggled with this and turned off for awhile then maybe there are other solutions attempts I forget.

    (1) it looked like a lot of the report to go to the private folder were finished in SupportVIs.  I manually pasted the rest there, too.

    (2) I added all driver files on my workspace and included in the files with the rest of my deployed screws.

    (3) I added all driver files on my workspace and said pilot TestStand to deploy them to the original location in Program Files.

    Someone at - it ideas?  R & S didn't even know what was TestStand, so that they could not help me.

    I was finally able to solve this problem on mine, the other day.  I brought the Network Analyzer to my office and did a lot of tests in this way.  Eventually, I discovered that I needed to include the folder private pilot deployment, what I was doing in one of previous attempts.  It turns out that you must also maintain the original of this file directory structure when you include it, otherwise dynamic calls are not looking in the right place.  Once it worked on my PC, I got it on the machine test and worked as well.

  • Cannot delete the created dynamically symbols.

    I have a dynamically created symbol, enter a div. parent not the scene.

    using the:

    var sym.createChildSymbol = water ("water", "water_pos", 0);

    sin of the var = sym.createChildSymbol ("fishing_boat", "fishing_boat_pos", 1);

    I need 4 scenes animated but only show one at a time. It has been runnng slowly if left running for a while (which is also strange), so I'll try to load than I need.

    The symbols are creating perfectly, but for some reason any that I can't remove them whan I finished with them.

    I can remove the other symbols that were not dynamically created in the project but cannot pin new instances of symbols and delete them.

    I use the API deleteSymbol().

    I tried the right answer here, but it's Delete my screen while leaving a white BG?

    They suggest:

    You use the symbol should be deleted in as parameter for the deleteSymbol() method, as follows:

    sym.deleteSymbol ("Peak1_1");

    http://forums.Adobe.com/message/5283417#5283417

    I'm fooled!

    What I'm missing!

    Thanks for any help or suggestion.

    Johnny

    I found the solution of timjamarillo more on this thread: http://forums.adobe.com/message/4848076

    I took me a while to find so I'll put it here in case someone else needs it!

    .....

    It's probably a question of importance. I recommend to put all the functional code on Stage.compositionReady event, then call these functions from anywhere where you need.

    Put this code on Stage.compositionReady:

    Store your symbol

    sym.mySymbol;

    sym.createParticle = function() {}

    Pull the symbol in the library, add to the scene

    sym.mySymbol = sym.createChildSymbol ("Food_Spanner", "Stage");

    }

    sym.removeParticle = function() {}

    delete the symbol

    sym.mySymbol.deleteSymbol ();

    }

    Place this code on frame 1:

    sym.getComposition () .getStage () .createParticle ();

    Put this code on frame 15:

    sym.getComposition () .getStage () .removeParticle ();

  • I deleted my pictures and videos to free up space on my iPhone 6, but the settings and iTunes still say that I've not left storage. Help, please.

    Hello

    I have an iPhone 6 and uses iOS 9.3.2,and I recently deleted all my pictures and videos to free up space, "Manage the storage" in still however said circles I 23.4 GB of photos/videos like iTunes when I connect my iPhone to my Mac. I deleted my recently deleted folder and follow the instructions of a guy showing a year, which suggests to set my phone date about two years back and deleting the photos recently deleted the file and both of these solutions do not work. I have reset my phone (home and power button operation / stop) and also, it does not work. I don't want to wipe my phone and restore it if possible, but it's the only option I can think of next.

    Are there other solutions before I try this?

    Thanks in advnace

    Ben

    Hey Ben,

    Thanks for stopping by the communities Support from Apple! Looks like you are trying to free up space on your iPhone by deleting all the photos and videos, and you still see 23.4 GB absorbed by these files. You have already made sure to empty your recently deleted album, fix the date of return on your phone and performed a hard reset on your device. You did an excellent job so far, and I'll be happy to give you some ideas to move forward from here.

    Before diving into other troubleshooting procedures, it would be useful to ensure that you have a recent backup of your iPhone is available. This will help us ensure that all your important data is stored safely for you. Here is an article with information on how to backup your device:

    The backup of your iPhone, iPad and iPod touch

    Once it is in place, I recommend you to reset the settings on your phone. This is not the impact of your personal data, but you will have to perhaps adjust the user specific settings, but also re - enter passwords and Wi - Fi networks. To complete this step, go to settings > general > reset > reset all settings. When you restart your phone, check if the local storage on your phone has updated to reflect the changes you did related to your photos and videos.

    Beyond that, you want to look at your phone erase and reset to the factory settings. It is possible that some kind of software corruption causes the divergence of storage that you are experiencing. Set up your phone as a new device via iTunes install a new copy of iOS and also to exclude the corrupted files, etc. in your user data. This is a resource for this process:

    Use iTunes on your Mac or PC to restore your iPhone, iPad or iPod to factory settings

    For later use, it may be useful to use iCloud photo library to transfer and store your photos. There is a feature that allows you to optimize the storage on your iPhone so that your photos and your videos do not have as much local storage space. Check out this resource to learn more about iCloud photo library:

    iCloud Photo library FAQ

    Have a fantastic weekend!

Maybe you are looking for

  • How can I get my Web site and keywords included in the Firefox search engine?

    I'm having a hard time finding the place where I can put my Web site address and its key words for the search engine find me (my site). Is there an address I can go directly to the entrance of my keywords in SEO so potential customers can find my sit

  • 1025nw Jam in Drum area - attention LED still flashes and cannot print the test page

    My Laserjet PRO CP1025nw is only 3 weeks. Everything was normal until I met a paper jam today. I removed the damaged document by opening the back cover and the piece of paper remaining from the feeder. But still, printer flashes driving caution. I tu

  • I was selected by Microsoft as a false Prize winner

    My name is Abdu Nadir Tutu, I am from Sudan. Last month, I received an email from Microsoft Corporation Center of Marketing in London in the United Kingdom where they congratulate me and informed me that my email address was selected as winner in the

  • Installation of Lexmark e120 in Windows 7

    Hello I try to install the Lexmark e120 prineter in Windows 7.Windows is able to recognize the printer and try to install the driver.But, unfortunately, it does not work and the printer remains without a pilot. Is there a specific directive for Lexma

  • Display name of blackBerry Smartphones

    Even if I have the number memorized for an indvidual, when the phone rings it still does not display the name of the person. All solutions? When I miss a call, the name is visible.