DBMS_METADATA. GET_DDL - how it forms the exit

I call "DBMS_METADATA. GET_DDL' to get the source code for the package body, see example call below.
Can I be always sure that this will continue:
1 return the before schema name the name of the package as, for example, that: "MYSCHEMA". "" COLLECTSTATS ". Or can he return sometimes without schema/owner-name the name of the batch as a "CREATE OR REPLACE PACKAGE BODY"COLLECTSTATS"IS".
2 he will always be in uppercase letters the part "owner.packagename"?
3 wil lthere always be quotation marks surrounding the package name and the name of the owner as "MONSCHEMA". "' COLLECTSTATS '?
 select DBMS_METADATA.GET_DDL('PACKAGE_BODY','COLLECTSTATS','MYSCHEMA') from DUAL;

Result:

 CREATE OR REPLACE PACKAGE BODY "MYSCHEMA"."COLLECTSTATS" IS

    PROCEDURE save_log(p_logrec IN LiveStatsLog%ROWTYPE) IS

There are a number of things that you can control the output of dbms_metadata using the procedures of set_transform_param. Apparently, at least in 10G, is not one of them, even if I thought it was.

Consult the manual of the PL/SQL Packages and Types reference for your version of Oracle to see what is available.

John

Tags: Database

Similar Questions

  • How to take the exit at a different voltage

    Hi I have a vi cross which i want to output voltage special such as 1, 4, 7, 11 volts instead to increase the voltage (1, 2, 3, 4), what type of input control should I use in while loop. Help, please. I joined vi.

    Outside. And I said TO the loop.

  • How to take the exit for some time on a loop to do comparison

    Hi all!

    I had a problem with my labview project, asking me to make the comparison with

    2 output values, both of which are within his time looping.

    To clarify this issue, I have 2 data entries, they are read in 2 loops while respectively once.

    Now I need to extract these values outside read the while loop to make the comparison. However simply

    the 2 outputs out of wiring to a comparison function does not work. The enforcement highlight function

    I can see that the data coming out of the loop!

    So, I would ask if anyone has any idea, thanks!

    Chao


  • get the table script using dbms_metadata.get_ddl but with clob field

    Thus, Oracle 11g R2...
    I use dbms_metadata.get_ddl for table scripts and it works fine...

    now, I have a table with clob field, and it does not work... I got an error "missing a closing parenthesis (ora-0907) '...
    I could paste a script I had, but I don't think that it makes no sense...

    does anyone have an experience on the use of this package on clob tables?


    TNX

    See this code.

    DECLARE
      myddl clob;
      PROCEDURE print_clob(p_clob in clob) as
        l_offset number default 1;
      BEGIN
        loop
          exit when l_offset > dbms_lob.getlength(p_clob);
          dbms_output.put_line(dbms_lob.substr(p_clob, 255, l_offset));
          l_offset := l_offset + 255;
        end loop;
      END print_clob;
      FUNCTION get_metadata return clob is
        h   number;
        th  number;
        doc clob;
      BEGIN
        h := dbms_metadata.open('TABLE');
        dbms_metadata.set_filter(h, 'SCHEMA', 'HR');
        dbms_metadata.set_filter(h, 'NAME', 'EMPLOYEES');
        th := dbms_metadata.add_transform(h, 'MODIFY');
        th := dbms_metadata.add_transform(h, 'DDL');
        --dbms_metadata.set_transform_param(th,'SEGMENT_ATTRIBUTES',false);
        doc := dbms_metadata.fetch_clob(h);
        dbms_metadata.CLOSE(h);
        return doc;
      END get_metadata;
    BEGIN
      myddl := get_metadata;
      print_clob(myddl);
    END;
    

    This procedure of print_ddl I took of the documentation.
    Use of the long VALUE. See, in the first example out put is truncated.

    SQL> SELECT dbms_metadata.get_ddl('TABLE','EMP','SCOTT') FROM dual;
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
    
    SQL> set long 10000
    SQL> /
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    
    SQL> SET LINESIZE 132
    SQL> SET pagesize 0
    SQL> SET LONG 1000000
    SQL> /
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    
    SQL>
    
  • How to disable the icon menu iin Forms 6i

    Hello world
    I would like to know how can I disable the menu of the icon in forms 6i, who appears every time that you run a form that has all the icons associated with the backup, the exit, then save, etc.

    Thanks in advance!

    The default menu is by DEFAULT & SMARTBAR (Module of Menu module-level property). If you remove SMARTBAR, you will have no smartbar at all.

    Published by: InoL on March 31, 2011 11:55

  • How to call dbms_metadata.get_ddl of ODP?

    This package function returns a CLOB.

    Whenever I call it, I get the error ORA-22275.

    I looked at the examples and I can't figure out what I need to do. From what I can find by looking at examples of Microsoft, I need create sort of a temporary CLOB in the database, and then somehow a back reference in my call to the package.

    Does anyone have an example on how to do this?

    Here is the code I have, but it keeps returning ORA-22275

    using (OracleConnection oraConn = OracleConnection (targetConnString)) new
    {
    OracleParameter parmObjectType = new OracleParameter();
    parmObjectType.OracleDbType = OracleDbType.Varchar2;
    parmObjectType.ParameterName = 'OBJECT_TYPE ';
    parmObjectType.Value = objectType;

    OracleParameter parmObjectName = new OracleParameter();
    parmObjectName.OracleDbType = OracleDbType.Varchar2;
    parmObjectName.ParameterName = "NAME";
    parmObjectName.Value = objectName;

    OracleParameter parmObjectOwner = new OracleParameter();
    parmObjectOwner.OracleDbType = OracleDbType.Varchar2;
    parmObjectOwner.ParameterName = 'SCHEMA ';
    parmObjectOwner.Value = objectOwner;

    oraConn.Open ();

    OracleCommand cmd = new OracleCommand();
    cmd connection group oraConn;.

    cmd.CommandText = "declare clob xx; begin dbms_lob.createtemporary (xx, false, 0); : tempclob: = xx; end; « ;
    cmd. Parameters.Add (new OracleParameter ("tempclob", OracleDbType.Clob)). Direction = ParameterDirection.Output;

    cmd ExecuteNonQuery());

    OracleClob tempclob is cmd (OracleClob). Parameters [0]. Value;
    cmd Parameters.Clear ();

    OracleParameter parmScript = new OracleParameter();
    parmScript.OracleDbType = OracleDbType.Clob;
    parmScript.Direction = ParameterDirection.ReturnValue;
    parmScript.Value = tempclob;


    cmd.CommandText = "dbms_metadata.get_ddl";
    cmd.CommandType = CommandType.StoredProcedure;
    cmd. Parameters.Add (parmObjectType);
    cmd. Parameters.Add (parmObjectName);
    cmd. Parameters.Add (parmObjectOwner);
    cmd. Parameters.Add (parmScript);

    cmd ExecuteNonQuery()); <-this is where the code does not work!


    oraConn.Close ();

    }

    Published by: [email protected] on March 23, 2009 14:43

    Hi Enzo,

    Have you run my code CORRECT, exactly as planned?

    It's just that I look back on your original post that looks like you can add parameters in the right order. ODP is BindByPosition, so you must ensure that the Clob gets first instruction executed ultimately added to the collection will be something like start: 1: = dbms_metadata.get_ddl (: 2:3.. etc).

    If I intentionally add parameters to the collection in the wrong order, 22275 results. If happens?

    Greg

  • How to reset the form filling on windows 7

    He worked that suddenly stopped working. How to reset the function so it will work again? I have windows 7 on a new laptop

    See:

    • Tools > Options > privacy > History: "Remember search and form history" [X]
  • Pavilion Touchsmart all-in-One: how to install the SSD in Touchsmart F234? What form factor is necessary?

    Will be HP 20-f234 enhancement by replacing the HDD with SSD.  Two questions:

    1. is there a video (or even a set of complete step by step instructions would be) Bay of any place that illustrates how to get the HARD disk inside?  (Remove screws, etc.)

    2. what form factor SSD is supported?  That is, will I need an adapter of some sort support if I have a 2.5 SSD "?

    Thank you.

    Seems to be a 3.5 "desktop drive

    How to replace the hard drive

    http://support.HP.com/us-en/product/HP-Pavilion-20-all-in-one-desktop-PC-series/5359028/model/5365334/document/c03690508/

    Your support page

    http://support.HP.com/us-en/product/HP-Pavilion-TouchSmart-20-F200-all-in-one-desktop-PC-series/5359028/model/5365334/how-to

  • How to move the top of the screen (active form)

    Hi all

    How to move the top of the screen (active form),

    Suppose I have 5 screens in the battery, I want to make the screen at the bottom of the stack as Active (top screen) without pushing and poping

    Of the display is a battery.  To move round on screens requires push and pop, as it would to move items in a stack.  Sorry, if you want to see the screen that currently is the bottom of the stack, then you either have everything that is above him, the pop or pop and push up.

    But here, we are talking about instances of the screen, not the specific screen class.  To understand the difference here is an example.

    I have two screens in my application, a list screen and a detail screen.  My application starts with the list screen.  The user selects an item (X) and displays details on the subject using the details screen.  While displaying the detail, the user decides that he wants to see a different list.  So, we start a new instance of the list screen, showing a different list.  Then, the user decides to view some details of one of the items on the list (Y) and if the application displays a new instance of the details screen.

    So now that the user has 4 screens on the display stack.  The top of the screen is a detail showing the item detail screen, the screen below is an example of the display of the list, the screen under that is another detail screen, showing the point X this time, and under that is a list screen.

    Does that help?

  • How to rename the HFM web form

    Hi all

    How to rename the HFM web form

    Thanks in advance

    Concerning

    Satheesh.s

    Hello

    Unfortunately, you cannot rename a form online.

    In order to change the name of an existing one, you need to:

    • Save the existing one with a different name
    • Remove the previous and start using the new

    See you soon,.

    Thanos

  • How to compile the single form?

    Hi all

    EBS R12.2.4

    RHEL6.5

    How do you compile a single form? or all forms in a single module as AR?

    In fact, I have compiled all forms for all modules in our case of BSE, and it took a lot of time. After that, the functional a user issue has been resolved.

    Now, I do not understand why another encounter similar error again functional:


    While it opens a form, the FRM-40735 displayed error message: a TIME-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-20002

    Capture1.PNG

    Capture2.PNG

    Capture3.PNG

    Capture4.PNG

    ---------------------------------------
    Current form
    ----------------------------------------
    Request form: claims
    Name: ARXRAATR
    Train path: /u01/appuat/UAT/fs2/EBSapps/appl/ar/12.0.0/forms/US/ARXRAATR.fmx
    Form Version: 12.0.30.12020000.2
    Last modification of the form: $Date: 2013/03/10 06:49 $

    How to compile this form ARXRAATR.fmx?

    Help, please...
    Thank you very much
    JC

    Check this document:

    Accounting revenue and sales credits: unexpected error while initializing FRM-40735: trigger once - new - form - Instance (Doc ID 1386372.1)

    Kind regards

    Bashar

  • How to change the color of the text in a form?

    I hae a standard Muse contact form in my site, and I don't see how to change the color of the text in the form labels and the text that is in a field before seizure is produced, but how do change you the color of the text that is entered in a field by a user?

    Hello kevinb,.

    The solution in this thread provided by Connor - change the attributes of text on turnover of muse , that's what you have to do.

    Let me know if you need additional information.

    Kind regards

    Ankush

  • How to remove the list item empty forms of oracle?

    Hello

    How to remove the list item EMPTY forms of oracle?

    I create two list items

    (1) basic

    (2) advanced

    But when I select list or display the runtime display form element 3 element EMPTY automatically, but I add what it shows I want to delete! How?

    He has named REQUIRED = NO item property

    If you set YES and then it does not show. but you must give an initial value.

    Hamid

  • How can I get the exit code of a script .bat for Java back to PL/SQL?

    When you call a .bat script, only the exit code 1 returns. How can I get 7 back to the PL/SQL in the code example below?

    C:\Users\pwatson\src\java > type vv.sql

    set echo on

    -call dbms_java.grant_permission ('SYSTEM', 'SYS:java.io.FilePermission', '< < all FILES > >', 'run');

    HOME @EXIT/b ECHO 7 > vv.bat

    TYPE of HOST vv.bat

    CREATE OR REPLACE AND COMPILE THE SOURCES NAMED AS VV JAVA

    import of java.lang.Runtime;

    public class VV

    {

    public static int execute()

    survey java.io.IOException, java.lang.InterruptedException

    {

    int exitCode = 0;

    Duration rt = java.lang.Runtime.getRuntime ();

    Process proc = rt.exec ("cmd.exe /C v.bat 1 > NULL 2 > ZERO");

    proc.waitFor ();

    exitCode = proc.exitValue ();

    return exitCode;

    }

    }

    /

    CREATE OR REPLACE FUNCTION JavaRunShellCommand

    RETURN NUMBER

    IN THE JAVA LANGUAGE

    NAME 'VV.execute () return oracle.sql.NUMBER;

    /

    DISPLAY ERRORS

    NUMBER VARIABLE n;

    CALL JavaRunShellCommand() IN: n;

    PRINT n

    DISPLAY ERRORS

    SELECT JavaRunShellCommand() AS R FROM DUAL;

    DISPLAY ERRORS

    HOST DEL v.bat

    OUTPUT

    It is strange that there are no errors. If the Java code does not work, I would expect an exception. Without an exception in the code handler, I expect to be propagated all the way to the top of the call stack and be displayed by the client. But there is no exception.

    So that means, in my view, that there is nothing wrong with the code Java itself. He made the appeal successfully to run this external process. The fact that the external process falls down, is not an issue/error in Java.

    If this is the case, then the first thing that comes to mind, is that the Oracle (oracle.exe) process that is currently running, runs as a service of the o/s. And that the service will try to run a command through the command shell script. There may be a security or problem access here that prevents the oracle.exe running as a service to do this.

  • How to change the color of form fields

    I don't know how to change the color of form fields. They default to gray, but I don't know how to make a different color.

    Gray does not match the color scheme of my landing page!

    Thank you!

    I think you have two options when you are working on a landing page with an embedded format:

    • You can change the background color of the entire form field set by selecting the shape, and then clicking on the Toolbox. In the window that opens go to the second (on a paint brush icon) and select the background color you want.
    • You can change the background color of the actual fields in the form by adding CSS styles. Select the Toolbox, go to the last tab (Tools Extract page) and in the middle of this window, you will see "head | CSS | JS"- select this average CSS tab and enter the style code to get the color you want. Here is an example of code you can put in it. Note that #000000 is the color code for black. Here is more information about the code: css - background in the input fields and text color? - stack overflow

Maybe you are looking for