To get rid of Schema name in output using DBMS_METADATA

Hi all,
Would someone be able to tell me how to get rid of the schema name output given by the below select stmt.
Query
Select Dbms_metadata.Get_ddl('FUNCTION','ACCOUNT_CODE')
from dual;
Result
CREATE OR REPLACE FUNCTION "GOINGLIVE"."ACCOUNT_CODE" (PTransCode VarChar2,.............
I checked for the documentation, but could manage to eliminate only storage clauses, tablespace etc. but not teh schema name.
Please provide your advise on this.
Thanks
- Sandeep

Which version are you on?
In 10g, you can use DBMS_METADATA.SET_REMAP_PARAM to get rid of schema name:
SQL> create table md_test(x int, y varchar2(10));
Table created.
SQL> declare
  2    l_ctx number;
  3    l_ctxt number;
  4    l_ddl sys.ku$_ddls;
  5  begin
  6    l_ctx := dbms_metadata.open('TABLE');
  7    dbms_metadata.set_filter(l_ctx, 'NAME', 'MD_TEST');
  8    l_ctxt := dbms_metadata.add_transform(l_ctx, 'MODIFY');
  9    dbms_metadata.set_remap_param(l_ctxt, 'REMAP_SCHEMA', user, null);
10    l_ctxt := dbms_metadata.add_transform(l_ctx, 'DDL');
11    dbms_metadata.set_transform_param(l_ctxt, 'SEGMENT_ATTRIBUTES', false);
12    l_ddl := dbms_metadata.fetch_ddl(l_ctx);
13    dbms_output.put_line(l_ddl(1).ddltext);
14    dbms_metadata.close(l_ctx);
15  end;
16  /
CREATE TABLE "MD_TEST"
   (    "X" NUMBER(*,0),
        "Y" VARCHAR2(10)
PL/SQL procedure successfully completed.In 9i, you have to resort to some manual tricks (with REPLACE, probably):
SQL> create table md_test(x int, y varchar2(10));
Table created.
SQL> declare
  2    l_ctx number;
  3    l_ctxt number;
  4    l_ddl sys.ku$_ddls;
  5  begin
  6    l_ctx := dbms_metadata.open('TABLE');
  7    dbms_metadata.set_filter(l_ctx, 'NAME', 'MD_TEST');
  8    l_ctxt := dbms_metadata.add_transform(l_ctx, 'DDL');
  9    dbms_metadata.set_transform_param(l_ctxt, 'SEGMENT_ATTRIBUTES', false);
10    l_ddl := dbms_metadata.fetch_ddl(l_ctx);
11    dbms_output.put_line(
12      replace(l_ddl(1).ddltext, '"' || user || '".'));
13    dbms_metadata.close(l_ctx);
14  end;
15  /
CREATE TABLE "MD_TEST"
   (    "X" NUMBER(*,0),
        "Y" VARCHAR2(10)
PL/SQL procedure successfully completed.
SQL> select * from v$version where rownum = 1;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - ProductionHope this helps,
Andrew.

Similar Messages

  • How to get the current schema name

    Hi,
    Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
    Thanks
    Jogesh

    ok folks, I found the answer at Tom's as usual.
    http://asktom.oracle.com/tkyte/who_called_me/index.html
    I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
    cheers,
    paul
    create or replace
    FUNCTION SELF_EXAM (
       p_call_stack VARCHAR2,
       p_type VARCHAR2 DEFAULT 'SCHEMA'
    ) RETURN VARCHAR2
    AS
       str_stack   VARCHAR2(4000);
       int_n       PLS_INTEGER;
       str_line    VARCHAR2(255);
       found_stack BOOLEAN DEFAULT FALSE;
       int_cnt     PLS_INTEGER := 0;
       str_caller  VARCHAR2(30);
       str_name    VARCHAR2(30);
       str_owner   VARCHAR2(30);
       str_type    VARCHAR2(30);
    BEGIN
       str_stack := p_call_stack;
       -- Loop through each line of the call stack
       LOOP
         int_n := INSTR( str_stack, chr(10) );
         EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
         -- get the line
         str_line := SUBSTR( str_stack, 1, int_n - 1 );
         -- remove the line from the stack str
         str_stack := substr( str_stack, int_n + 1 );
         IF NOT found_stack
         THEN
            IF str_line like '%handle%number%name%'
            THEN
               found_stack := TRUE;
            END IF;
         ELSE
            int_cnt := int_cnt + 1;
             -- cnt = 1 is ME
             -- cnt = 2 is MY Caller
             -- cnt = 3 is Their Caller
             IF int_cnt = 1
             THEN
                str_line := SUBSTR( str_line, 22 );
                dbms_output.put_line('->' || str_line);
                IF str_line LIKE 'pr%'
                THEN
                   int_n := LENGTH('procedure ');
                ELSIF str_line LIKE 'fun%'
                THEN
                   int_n := LENGTH('function ');
                ELSIF str_line LIKE 'package body%'
                THEN
                   int_n := LENGTH('package body ');
                ELSIF str_line LIKE 'pack%'
                THEN
                   int_n := LENGTH('package ');
                ELSIF str_line LIKE 'anonymous%'
                THEN
                   int_n := LENGTH('anonymous block ');
                ELSE
                   int_n := null;
                END IF;
                IF int_n IS NOT NULL
                THEN
                   str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
                 ELSE
                   str_type := 'TRIGGER';
                 END IF;
                 str_line  := SUBSTR( str_line, NVL(int_n,1) );
                 int_n     := INSTR( str_line, '.' );
                 str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
                 str_name  := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
              END IF;
           END IF;
       END LOOP;
       IF UPPER(p_type) = 'NAME'
       THEN
          RETURN str_name;
       ELSIF UPPER(p_type) = 'SCHEMA.NAME'
       OR    UPPER(p_type) = 'OWNER.NAME'
       THEN
          RETURN str_owner || '.' || str_name;
       ELSIF UPPER(p_type) = 'TYPE'
       THEN
          RETURN str_type;
       ELSE
          RETURN str_owner;
       END IF;
    END SELF_EXAM;

  • A friend gave me an older Nano 3rd generation. Can anyone tell me how to delete what is on there and how to get rid of his name. It does not connect to my itunes. I cannot even find the source or the place to restore it as suggested in the owners manual.

    I have a 3rd generation ipod that a friend gave me. I cannot find anything on how to get rid of his name and music on it. This is what the owners manual says:
    "Select ipod nano in the soiurce list and click the summary tab" I cannot find the source or the summary tab on itunes. Can any one help me? I would like to delete everything on it and start over but I am afraid I cannot add anything back on it. I know this is detailed and a lot, but I really need help.

    Restore
    Note: Because Restore erases all of the songs and files on iPod, make sure toback up any files you've saved on the iPod disk. All of your songs, videos, podcasts, audiobooks, and games can be loaded back to your iPod provided that you have them stored in your iTunes Library.
    How to restore your iPod:For Windows:
    1. Make sure you've reinstalled the latest version of iTunes.
    2. Open iTunes, and then connect your iPod to your computer.
    3. After a few moments, it will appear in the source list in iTunes. If the iPod's display doesn't show "Connected" or "Do not disconnect" you may need to put the iPod into disk mode to proceed.
    4. Select your iPod in the source list and you will see information about it appear in the Summary tab of the main iTunes windows.
    5. Click the Restore button. You will be prompted with one or more restore options that may prompt iTunes to automatically download of the latest iPod Software. The 4 possible restore options are:
    Restore Option 1: Restore - Restores with same iPod Software version already on iPod.
    Restore Option 2: Use Same Version - Restores with same iPod Software version already on iPod even though a newer version is available.
    Restore Option 3: Use Newest Version - Restores with the latest iPod Software on your computer.
    Restore Option 4: Restore and Update - Restores with the latest iPod Software on your computer.
    6. A progress bar will appear on the computer screen indicating that the first stage of the restore process has started. When this stage is completed, iTunes will instruct you to leave iPod connected to your computer to complete restore.
    7. During the stage 2 of the restore process, the iPod will show an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remains connected to the computer or iPod Power adapter during this stage. Note: The progress bar may be difficult to see since the backlight on the iPod display may be off.
    8. After stage 2 of the restore process is complete and the iPod is connected to the computer, the iTunes Setup Assistant window will appear asking you to name your iPod and choose your syncing preferences similar to when you connected your iPod for the first time.
    For Mac:
    1. Make sure you've reinstalled the latest version of iTunes.
    2. Open iTunes, and then connect your iPod to your computer.
    3. After a few moments, it will appear in the source list in iTunes. If the iPod's display doesn't show "Connected" or "Do not disconnect" you may need to put the iPod into disk mode to proceed.
    4. Select your iPod in the source list and you will see information about it appear in the Summary tab of the main iTunes windows.
    5. Click the Restore button. You will be prompted with one or more restore options that may prompt iTunes to automatically download of the latest iPod Software. The 4 possible restore options are:
    Restore Option 1: Restore - Restores with same iPod Software version already on iPod.
    Restore Option 2: Use Same Version - Restores with same iPod Software version already on iPod, even though a newer version is available.
    Restore Option 3: Use Newest Version - Restores with latest iPod Software version on your computer.
    Restore Option 4: Restore and Update - Restores with latest iPod Software version on your computer.
    6. A message will appear prompting you to enter an administrator's name and password.
    7. A progress bar will appear on the computer screen indicating that the first stage of the restore process has started. When this stage is completed, iTunes will instruct you to leave iPod connected to your computer to complete restore.
    8. During the stage 2 of the restore process, the iPod will show an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remains connected to the computer or iPod Power adapter during this stage. Note: The progress bar may be difficult to see since the backlight on the iPod display may be off.
    9. After stage 2 of the restore process is complete and the iPod is connected to the computer, the iTunes Setup Assistant window will appear asking you to name your iPod and choose your syncing preferences similar to when you connected your iPod for the first time.
    Source:
    iPod nano (3rd generation) Troubleshooting Assistant
    Message was edited by: michael08081

  • How do I get rid of group names

    How do I get rid  of group names in contacts, I seem to have loads of group names ??

    Those are not users. They're computers or printers on the network. Your Wi-Fi network may be insecure. Check the router settings to make sure you're using WPA 2 security, and if you are, change the password to a random string of at least ten upper- and lower-case letters and digits. Any password that you can remember is not good enough.

  • Get rid of domain name

    Hi all,
    How to get rid of domain name from global_name?
    db_name = test
    db_domain =
    select * from global_name
    global_name
    test.oracle.com
    Is there any parameter to set so that only "test" will be displayed in global_name not "test.oracle.com"?

    Try:
    db_domain="" ;
    edit the network files:
    sqlnet.ora - delete the entry for the default domain
    tnsnames an listener : edit the service_name
    Cheers,
    Dobby

  • I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    Reading some older threads from 2012 and 2011 it appears the problem was present even then.  Part of the problem was due to people using multiple or different account id's on the various devices.  In my case, I only have one ID and it is the same on all devices yet the iPhone and iPad are still throwing the same error when I try turning on iTunes Match.  This is very frustrating . . . any help out there?  Thanks.

  • I was on a free dictionary website and it asked me if it would like to send me push notifications and i allowed it but i don't want them anymore...how do i get rid of that? I'm using my macbook pro by the way

    I was on a free dictionary website and it asked me if it would like to send me push notifications and i allowed it but i don't want them anymore...how do i get rid of that? I'm using my macbook pro by the way

    Go to the site and look for an unsubscribe link. Or, contact the site and ask them to stop.

  • Get rid of the initial asterisk when using PasswordField masking in console

    Hi!
    How can I get rid of the initial astrerisk when using the PasswordField script from Sun?
    I've tried to check whether the BufferedReader is empty or not, but with no succes.
    Here comes the code:
    PasswordField.java
    import java.io.*;
    public class PasswordField {
        *@param prompt The prompt to display to the user
        *@return The password as entered by the user
       public static String readPassword (String prompt) {
          EraserThread et = new EraserThread(prompt);
          Thread mask = new Thread(et);
          mask.start();
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
          String password = "";
          try {
             password = in.readLine();
          } catch (IOException ioe) {
            ioe.printStackTrace();
          // stop masking
          et.stopMasking();
          // return the password entered by the user
          return password;
    }EraserThread
    import java.io.*;
    class EraserThread implements Runnable {
       private boolean stop;
        *@param The prompt displayed to the user
       public EraserThread(String prompt) {
           System.out.print(prompt);
        * Begin masking...display asterisks (*)
       public void run () {
          stop = true;
          while (stop) {
             System.out.print("\010*");
          try {
             Thread.currentThread().sleep(1);
             } catch(InterruptedException ie) {
                ie.printStackTrace();
        * Instruct the thread to stop masking
       public void stopMasking() {
          this.stop = false;
    }

    Hello Yajai,
    The example program will use the default value for timeout, 10 seconds. To change this, you will have to set the Stream.Timeout value. I inserted this function into the example and set it equal to -1, and the program will wait indefinitely for the trigger signal without timing out. Please see the attached image to how this was implemented.
    I hope this help. Let me know if you have any further questions.
    Regards,
    Sean C.
    Attachments:
    SetTimeout.bmp ‏2305 KB

  • When opening safari i get a message that says major security issue please contact apple immediately suspicious activity might have been detected. what is this and how do i get rid of it so i can use my internet?

    when opening safari i get a message that says major security issue please contact apple immediately suspicious activity might have been detected. what is this and how do i get rid of it so i can use my internet?

    A misleading and malicious popup. Launch Safari with the Shift key held down; if that doesn't work, temporarily disconnect the computer from the Internet.
    (121307)

  • How do I get rid of myinfotopia? I am using Firefox

    How do I get rid of myinfotopia? I am using Firefox

    hello, this sounds like a problem possibly caused by adware on your pc.
    please go to ''firefox > addons > extensions'' & remove any suspicious entries (toolbars, things that you have not installed intentionally, don't know what purpose they serve, etc).
    <br>also go to the windows control panel / programs and remove all toolbars or potentially unwanted software from there.
    <br>finally, run a full scan of your system with different security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] & [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner].
    [[Remove a toolbar that has taken over your Firefox search or home page]]
    [[Troubleshoot Firefox issues caused by malware]]

  • How to get rid of "click to activate and use this control"

    Hi,
    Any idea how to get rid of "click to activate and use this control".
    I don't want user to click to start working with the form.
    We are using IE6, forms9i and 10g application server.
    Thanks in advance.
    Kumar

    I got the solution...
    Metalink - Note:357545.1
    Kumar

  • In Mail I have a "no name" card in email address list that has a known address but when I click on "no name" all adresses in email list go to relevant out going address box-can't get rid of "no name" in email address list

    In Mail email list I have a "no name" card with a known email address. When I click on this card all names on list go to outgoing address box-I cannot get rid of this card

    In Mail email list I have a "no name" card with a known email address. When I click on this card all names on list go to outgoing address box-I cannot get rid of this card

  • How do I get rid of my name in Lion Login ID on Top Right of Menu

    In Lion, my user id (My full name) is at the top right of my menu screen - next to spotlight.  Im trying to figure out how to get rid of my full name because
    a) Theres only one user on this computer & I know who I am
    b) I have other apps with menu icons and I cant use them because there's not enough space due to my name.
    I basically need to clear up some real estate space, and cant figure out how to do it.  Ive kept checking system preferences but can't find out where this resides.  I want my full name to continue being my account admin id/user.  I just dont want it to be on the screen so that my apps' icons can live on the top menu bar.
    Thanks

    Thank you..  I knew it was something simple but I just couldnt figure out how to get it.  I remember the 'expert' technician setting it up had to ask someone how to make the name appear...and now I was realizing that I dont really need it up there and it's taking up valuable real estate.
    One other thing in case you know since it's somewhat related.  Ive got my computer set up so I can type foreign languages so Ive got virtual keyboard options from my menu bar.  For some reason, whenever Im asked to put my system ID password in -  like the steps you just told me to follow -  the virtual keyboard automatically pops up at the same time as the window asking me to put in my password.  Its not a big deal but its just frustrating that its there, and Im wondering why as I know its not supposed to be.  I dont see anything in Keyboard Preferences That would Be causing this.  Any thoughts?
    Thanks again for your help  Im constantly surprised at how much more helpful Support Communites has been than Applecare of the so-called trainers at the retail stores.

  • How to get rid of file name that pops up with mouseover?

    When a user is on my website and mouses over a link to another page, the name of that page comes up - for example, if I mouse over the link to the Mums Night Out page (while on the home page) the file name pops up (mumsnightout.html)
    Any idea on how to get rid of that annoying issue?
    Thanks,
    roxpat

    Is this question now solved?
    Excuse me if it is, but I am really freaking out about this and don't know what to do.
    I don't want to launch my website before everything is perfect and I really want the yellow-pop-up-box-bstrd to go away.
    I am using this code which works fine in ff and safari but not in ie:
    <script type='text/javascript'>
    function clearTooltip() {
    _links = parent.document.links;
    for (i=0; i<_links.length; i++) {
    _links.setAttribute('title', '');
    chkFooter = setInterval('checkFooter()', 100);
    function checkFooter() {
    if (parent.document.getElementById('footer_layer') != null) {
    clearTooltip();
    clearInterval(chkFooter);
    </script>
    Should I modify it in some way? Any ideas?

  • I can't get rid of layer names from the Ultiboard PCB properties-General layers tab

    A bunch of DXF layer names were erroneously entered into Ultiboard 10.1 a few years ago during a DXF importing operation. I upgraded to 12.0 recently and hoped that the old layers would be eliminated. I have been wanting to get rid of them for a long time. I tried deleting the ub_config file in AppData, but it didn't remove them. Is there anything you can think of to extract them from the program's grasp? Thanks, Tod
    Solved!
    Go to Solution.

    Hi Tod,
    I suspect one of your design file is causing this.  If you go to Options>>PCP Properties>>General Layers, do you see the DXF layers in here?  If you see the layers, can you select it then press the Delete button?
    Tien P.
    National Instruments

Maybe you are looking for