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>

Tags: Database

Similar Questions

  • Cannot connect to a WPA - PSK with WLAN DW1520 Wireless-N particular, but can when no security is set to wireless. How can I get the card to use WPA - PSK?

    I have a DW1520 Wireless-N WLAN Half-Mini card in an Alienware M17X10. I am trying to connect my home through a TRENDNet TEW-435BRM access DSL issue in WPA - PSK.

    I was able to get the card to use the accounts wireless WPA2-PSK and WPA - PSK in other areas is not a problem directly related to WPA - PSK.

    I can get it to connect to the network when the diffuse TRENDnet without security (free release) and when directly plugged into the wireless router, cable - but every time I go to dissemination of WPA - PSK it can't connect?

    While in WPA - PSK the WLAN card can 'see' the network and wireless router can see the 'computer' (and is a 'trust machine'). I have one couple of other previous model Dells connected to the network without problem or needed changes if any ideas why I would have questions here?

    The driver installed is the 'last' to 5.60.48.35.

    I tried to restart the router and the computer without success. I use Windows Firewall.

    No bright sparks that can point me in the right direction?

    Thank you

    Declan

    Hello

    Try resetting the password in the part of the router wireless, then copy and paste it to the wireless card.

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • How to get the table without segment tablespace

    Hello

    I have a few tables in 11.2, which were created with creation of deferred segment and did so no segment/measure not yet. They already appear in dba_tables thus identical to the tab$, but do not have a defined tablespace.

    However, using dbms_metadata.get_ddl () the DOF resulting has the correct tablespace name. But what a view or table that I must query for this information with SQL?

    Thank you

    Robert

    Hello

    No, none of these tables is temporary, but it turns out that all the affected tables are ITO and so I have to check dba_indexes for the tablespace and the dba_indexes index_name when looking for a segment.

    Thank you

    Robert

  • How do I get the table cells?

    It's my get code that any object in propagation.

    Int32 childCount = parent-> GetChildCount();

    for (int32 /IndexEnfant = 0; childIndex < childCount; /IndexEnfant ++)

    {

    InterfacePtr < IHierarchy > child (parent-> QueryChild (childIndex));

    ChildUIDRef = UIDRef: GetUIDRef (child);

    TextFrame table

    }

    How do I get the table cells?

    You can access the table using ITableModel and GridAddresscell.

    But to get to the ITableModel since ITextModel implies some complexity.

    Few things to understand:

    -L'interface that corresponds to the written document is ITextModel

    -The recommended method to iterate tables in a story done by ITextStoryThreadDictHier

    -Get the ITextStoryThreadDictHier on the history and the main thread as ITextStoryThreadDictHier::NextUID()

    -Now get ITextStoryThreadDict for UID and query for ITableModel. If you get ITableModel, then you have found the table.

    Once you have ITableModel you can get ITableCell as follows:

    ITableModel:QueryCellContentBoss(GridAddress); Give ITableCell

    You can refer to SnipperRunner (SnpManipulateTextModel).

    Download text template table model:

    InterfacePtr textModel (storyUIDRef, UseDefaultIID());

    InterfacePtr textStoryDictHier (textModel, UseDefaultIID());

    NextUID UID = sourceStory.GetUID (); / / Download the main thread dictionary

    Now loop the dicthier to iterate through all the threads dicts.

    InterfacePtr textStoryThreadDict (sourceStory.GetDataBase (), nextUID, UseDefaultIID());

    InterfacePtr tableModel (textStoryThreadDict, UseDefaultIID());

    If (tableModel) / / the storythreaddict represents a table

    {

    You are now in a table

    }

  • In Windows Mail, I get the following script error: unexpected call to method or property access - URL: res://ieframe.dll/preview.js

    Original title: HELP

    {Moderator note: version of Windows has not been confirmed}

    In microsoft mail I get the following script error and cannot print emails, then the error lock the computer.

    Script error

    An error has occurred in the script on this page

    Line 215

    1 tank

    Unexpected call to method or property access

    Code 0

    URL: res://ieframe.dll/preview.js

    Do you want to continue running scripts on this page

    Yes No

    I can print other documents.

    Please help I need to be able to print my emails.

    Thank you

    Windows Mail uses the Internet Explorer print engine to print.  You can print from Internet Explorer?  It is possible that your antivirus software might be the cause.  You can try to turn off and then restart and see if it will print.  Otherwise, you will need to provide more detailed information depending on your version of Windows, what e-mail program, you are using and what version of Internet Explorer you are using.

    Steve

  • get the storage you use vCloud API

    I'm trying to figure out how to get the storage you use in an organization using vCO.

    There is information about the storage profiles used to an Org - vDC, but this information contains only the limit.

    My code looks like this:

    for each (var vdc in {org.getVdcs ()})

    for each (var profile in {vdc.toAdminObject () .getStorageProfiles ())}

    System.log (Profile.ToXml ();

    }

    }


    In the XML dump I only see the limit configured for this Org - vDC but not the consumption of this limit.

    The information are present in the Web GUI vCloud, how do I get this information from a code?

    Thank you

    Cristian

    LOL, favorite of this place, it will be VERY valuable to you... now, regarding your question, this help?

    This task scriptable takes an object provider VDC as input:

    System.log("============ Provider VDC: "+providerVdc.name+" ============");
    System.log("NOTE: If allocatedMB = 0, then the org vdc has been configured for 'unlimited'");
    var vdcs = providerVdc.getAdminVdcs();
    var host = providerVdc.getHost();
    for each (vdc in vdcs){
    System.log("====== Processing Org VDC: "+vdc.name + " ======");
    var queryService = host.getQueryService();
    var profs = vdc.getStorageProfiles();
    for each (var prof in profs) {
    var expression = new VclExpression(VclQueryAdminOrgVdcStorageProfileField.HREF, prof.getReference().href , VclExpressionType.EQUALS);
    var filter = new VclFilter(expression);
    var params = new VclQueryParams();
    params.setFilter(filter);
    var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDCSTORAGEPROFILE,params);
    
    while (resultSet != null) {
    var records = resultSet.getRecords(new VclQueryResultAdminOrgVdcStorageProfileRecord);
    //System.log(records.length + " records found");
    for each (var record in records) {
    System.log("Storage Profile Name (usedMB/allocatedMB): " + record.name + " ("+record.storageUsedMB+"/"+record.storageLimitMB+")");
    }
    resultSet = resultSet.getNextPage();
    }
    }
    System.log("");
    }
    
    // --------------------------- End code Snippet
    
    Sample output:
    [2013-03-21 12:27:03.553] [I] ============ Provider VDC: pVDC1 ============
    [2013-03-21 12:27:03.554] [I] NOTE: If allocatedMB = 0, then the org vdc has been configured for 'unlimited'
    [2013-03-21 12:27:03.763] [I] ====== Processing Org VDC: demo ======
    [2013-03-21 12:27:03.859] [I] Storage Profile Name (usedMB/allocatedMB): Shared (0/409497)
    [2013-03-21 12:27:03.861] [I]
    [2013-03-21 12:27:03.863] [I] ====== Processing Org VDC: tiny ======
    [2013-03-21 12:27:03.959] [I] Storage Profile Name (usedMB/allocatedMB): Local (1792/6144)
    [2013-03-21 12:27:03.963] [I]
    [2013-03-21 12:27:03.965] [I] ====== Processing Org VDC: CimVDC ======
    [2013-03-21 12:27:04.016] [I] Storage Profile Name (usedMB/allocatedMB): Shared (231680/0)
    [2013-03-21 12:27:04.020] [I]
    March 21 at 12:29 pm
    
  • What is the Action Script (using AS2) code when you loop once a scene and then re-read and intervention

    What is the Action Script (using AS2) code when you loop once a scene and then re-read and slaughter on a certain slice?

    Basically, you need keep a count and use it as your stop control.  In the first image, it takes something to assign the value, but you do not want to assign an initial value, so you could use...

    var County;

    if(Count == undefined) {}
    Count = 0;
    } else {}
    Count ++;
    }

    Then in the frame where you want to stop after that a loop is completed you can have...

    if(Count == 1) {}

    Stop();

    }

  • After the installation, I get the message "cannot use this product under a guest account. That is what it is?

    I installed Acrobat Pro XI (academic edition).  But I get the message "cannot use this product under a guest account.  What should I do?

    Run as admin / talk to your IT Department.

    Mylenium

  • I keep trying to log on a Web site and I get the message to turn on cookies, but they are activated.

    original title: cookies

    I keep trying to log on a Web site and I get the message to turn on cookies, but they are activated.

    Put the security and confidentiality in the middle.

  • I just changed the administrator to standar account now the Dungeon of computer on request for the password that I continue to put the one I use to have but nothing happens whats rong whit this

    Just change the administrator account for standar now the computer keep on asking the password I continue to put the one I use to have but nothing happen how to find the password, usted an i have I removed it now what?

    Hello

    see if that can help you with this status has changed for the account

    worth a try

    You may be unable to connect to Windows Vista or Windows 7 in the following scenarios:

    • Scenario 1: You recently set a new password for the protected administrator account. However, you don't remember the password.
    • Scenario 2: You type the correct password. However, Windows Vista or Windows 7 does not accept the password because the system is damaged.
    • Scenario 3: You delete a protected administrator account. Now, you cannot connect to another administrator account.
    • Scenario 4: You change an administrator account protected with a standard user account. Now, you cannot connect to another administrator account.

    http://support.Microsoft.com/kb/940765

  • When I try to open the keyboard screen, I get the prompt and click to connect, but it does not connect.

    OT: On the keyboard interface.

    When I try to open the keyboard screen, I get the prompt and click to connect, but it does not connect. My hard keyboard is dysfunctional and now I can't type my password to connect. Is there a way to get around this? Thanks for any help.

    There is a problem with the KB3004394 update that causes what you see as well as other issues.

    Uninstall this update, your system should return to normal.

    While in Windows Update, select View Update History then installed updates. Go to the bottom of the list to KB3004394, right-click on it and choose uninstall.

    Microsoft has removed the update of the distribution.

    I would try to borrow a keyboard if you can so that you can perform the uninstall.

  • tried to create a private folder for the work of the book as the in-laws use our computer but don't know where to start and it seems to have sent the info im trying to hide anywhere please help

    tried to create a private folder for the work of the book as the in-laws use our computer but don't know where to start and it seems to have sent the info im trying to hide in every sense, please help, its windows 7 we have, I will learn more about computer but now I have to stop my son-inlaw through my belongings on the computer

    Nancy

                                                   

    Hi Nancy,.

    Encryption of files and folders is a way to protect against unauthorized access. EFS (ENCRYPTING File System) is a Windows feature that you can use to store information on your hard disk in an encrypted format. Encryption is the best protection that Windows provides to help you keep your information secure.

    You can make a folder and then encrypt it.

    http://Windows.Microsoft.com/en-in/Windows7/encrypt-or-decrypt-a-folder-or-file

    Good day!

    Answer please if you face concerns.

  • Hi I'm window7 user, I bought a creative cloud for students and teachers. but all the downloadable test app. That's why I tried 'buy now' button, "that assign the right to use" CC redownloading but "unlicensed" pop up. Help me.

    Hi I'm window7 user, I bought a creative cloud for students and teachers. but all the downloadable test app. That's why I tried 'buy now' button, "that assign the right to use" CC redownloading but "unlicensed" pop up. Help me.

    Hi decoen,.

    Your subscription is activate kindly try to disconnect from Creative Cloud app and reconnect.

    Please consult Creative Cloud applications unexpectedly back in the test mode. CCM, CS6

    Troubleshooting FAQ: What should I do if I have a subscription, but my application acts as if I had a trial?

    It could be useful!

    Rayyan

  • Get the storage you use of a via powercli virutal machine

    Is there a oneliner where I can get the storage you USE a virtual machine?

    example:

    windc configured server used 100 GB 55GO

    I'd like to type something like: get - vm winDC |   Get-usedstorage

    and I want to go 55GO

    I wasn't able to find a good word

    Something like that?

    Get - VM | Select Name, UsedSpaceGB

  • How to insert data into the table by using the expression builder in the assign activity

    How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
    Can someone help me please

    Hello

    I don't think that oraext:query-database() can insert data into the table.

    What are your needs?
    Can not you plan to use the DB adapter with the insert operation?

    Kind regards
    Neeraj Sehgal

Maybe you are looking for

  • My Ipad mini is frozen

    My Ipad Mini is frozen.  I tried to reset it by turning it off, but which is fixed.  I thought that if she lacked power afterwards and went away, it would reset but it shows 100% responsible for about 10 hours. Help, please! Laura

  • Just reinsstalled thundrebird, is there a way to recover my files and favorite addresses.

    My computer crashed several weeks ago. I just installed Thunderbird on the new computer. I've never had a password for my e-mail address I saw only it from my computer. Is it possible to recover my address book and files?

  • Pavilion 500-314: finance alert

    Someone at - he was infected by an adware Alert finance?   I uninstalled it from the control Panle but I still get ads. Same for GeniusBox. None of them does not appear in my list of installed programs anymor, but they are still operative and a PITA

  • LabelFields/managers not refreshing properly on parchment

    I have a screen, on which I have added several VerticalFieldManagers. These VFMs contain some LabelFields but also other VFMs. This last set of optimization of resources is also contain LabelFields. I have a problem when the low value for money is no

  • ACS - the clean access server

    Hi guys,. I have a doubt about the own ACS and access server. The clean access server can do the job of the ACS? for example, act as a VMPS server, AAA server, or radius server. Thank you