How to put the ";" at the end when using dbms_metadata.get_ddl?

Hi there,
Is there a to put the semicolon ";" at the end of each DDL when I use dbms_metadata.get_ddl for (TABLE or TRIGGER)?
Thanks

Use:
exec dbms_metadata.set_transform_param(DBMS_METADATA.SESSION_TRANSFORM, 'SQLTERMINATOR', TRUE );

Similar Messages

  • How to suppress SCHEMA_OWNER when using DBMS_METADATA.GET_DDL

    Hi,
    I was wondering, is it possible to suppress the owner when using dbms_metadata.get_ddl?
    SQL> select * from v$version where rownum = 1
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    SQL> exec dbms_metadata.set_transform_param (dbms_metadata.session_transform,'SEGMENT_ATTRIBUTES',false)
    SQL> select dbms_metadata.get_ddl('TABLE','EMP') from dual
    DBMS_METADATA.GET_DDL('TABLE','EMP')                                           
      CREATE TABLE "SCOTT"."EMP"                                                   
       (     "EMPNO" NUMBER(4,0) NOT NULL ENABLE,                                      
         "ENAME" VARCHAR2(10),                                                         
         "JOB" VARCHAR2(9),                                                            
         "MGR" NUMBER(4,0),                                                            
         "HIREDATE" DATE,                                                              
         "SAL" NUMBER(7,2),                                                            
         "COMM" NUMBER(7,2),                                                           
         "DEPTNO" NUMBER(2,0)                                                          
       )I would like to get rid of the "SCOTT". Alternatively to change it into something else.
    Is that possible, without post processing the output, that is?
    Regards
    Peter

    Hi Karthick,
    I was afraid that would be the answer. It can be done, but it seems rather convoluted:
    SQL> create or replace function get_table_ddl(table_name    varchar2
                                            ,schema        varchar2 default user
                                            ,new_owner     varchar2 default null)
       return clob
    is
       v_handle        number;
       v_transhandle   number;
       v_ddl           clob;
    begin
       v_handle := dbms_metadata.open('TABLE');
       dbms_metadata.set_filter(v_handle, 'SCHEMA', schema);
       dbms_metadata.set_filter(v_handle, 'NAME', table_name);
       v_transhandle := dbms_metadata.add_transform(v_handle, 'MODIFY');
       dbms_metadata.set_remap_param(v_transhandle,'REMAP_SCHEMA',schema,new_owner);
       v_transhandle := dbms_metadata.add_transform(v_handle, 'DDL');
       dbms_metadata.set_transform_param(v_transhandle,'SEGMENT_ATTRIBUTES',false);
       v_ddl := dbms_metadata.fetch_clob(v_handle);
       dbms_metadata.close(v_handle);
       return v_ddl;
    end;
    Function created.
    SQL> select get_table_ddl('EMP') from dual
    GET_TABLE_DDL('EMP')                                                           
      CREATE TABLE "EMP"                                                           
       (     "EMPNO" NUMBER(4,0) NOT NULL ENABLE,                                      
         "ENAME" VARCHAR2(10),                                                         
         "JOB" VARCHAR2(9),                                                            
         "MGR" NUMBER(4,0),                                                            
         "HIREDATE" DATE,                                                              
         "SAL" NUMBER(7,2),                                                            
         "COMM" NUMBER(7,2),                                                           
         "DEPTNO" NUMBER(2,0)                                                          
    1 row selected.Regards
    Peter

  • Stange error when using dbms_metadata.get_ddl in PL/SQL procedure

    Basic info:
    Oracle 10.2.0.4.0 on linux.
    I'm trying to extract ddl of indexes that I drop and recreate frequently during monthly loads and store it in a table.
    This statement works on the command line:
    insert into saved_indexes
    select index_name,dbms_metadata.get_ddl('INDEX',index_name,owner_name)
    from sys.all_indexes
    where owner = owner_name
    and table_name = table_name;
    commit;
    The table 'saved_indexes' is a two column table with a varchar2(40) and a CLOB.
    When I use the following procedure, I get 'ORA-04044 procedure, function, package, or type is not allowed here -4044' every time.
    PROCEDURE SAVE_INDEXES (v_table IN VARCHAR2, v_owner IN VARCHAR2) IS
    v_errorcode number(8);
    v_errortext varchar2(1000);
    v_start_time date;
    BEGIN
    insert into saved_indexes
    select index_name,dbms_metadata.get_ddl('INDEX',index_name,v_owner)
    from sys.all_indexes
    where owner = v_owner
    and table_name = v_table;
    commit;
    EXCEPTION
    WHEN others THEN
    v_errorcode := sqlcode;
    v_errortext := substr(sqlerrm, 1, 1000);
    dbms_output.put_line(v_errortext || ' ' || v_errorcode);
    END;
    Alternatively I have tried it this way:
    PROCEDURE SAVE_INDEXES (v_table IN VARCHAR2, v_owner IN VARCHAR2 ) IS
    v_errorcode number(8);
    v_errortext varchar2(1000);
    v_index_ddl CLOB;
    BEGIN
    for x in (select index_name
    from sys.all_indexes
    where owner = v_owner
    and table_name = v_table)
    loop
    select dbms_metadata.get_ddl('INDEX',x.index_name,v_owner) into v_index_ddl from dual;
    insert into saved_indexes
    values(v_table,v_index_ddl);
    end loop;
    commit;
    EXCEPTION
    WHEN others THEN
    v_errorcode := sqlcode;
    v_errortext := substr(sqlerrm, 1, 1000);
    dbms_output.put_line(v_errortext || ' ' || v_errorcode);
    END;
    Always with the same result. I have poured over the documentation on this and have not found anything. All objects are in the same schema, so there is not an issues with invokers rights, or privileges.
    Any suggestions would be helpful...

    qwe11126 wrote:
    When I use the following procedure, I get 'ORA-04044 procedure, function, package, or type is not allowed here -4044' every time.There is nothing wrong with SP. Post a snippet of SQL*Plus code showing how you call SP along with errors.
    SY.

  • HT2534 I bought an ipod touch at the pawn shop and I am needing to know how to put my ID in it when there's one already there

    I bought an ipod touch at the pawn shop and I am needing to know how to put my ID in it when there's one already there

    Restore it and set it up as new.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

  • How to put distinct in the query

    Hi all,
    How to put distinct in the query.I checked in RPD , Distinct supported is already available. I marked the distinct check box in advance option still then i'm not getting distinct in the query.
    any idea , please help...

    In the RPD i have join between base table and view .i'm selecting 2 columns one from base table and other from view . which gives cartesian product . to avoid that i want to put distinct . I'm not using any measure . I'm taking direct columns.
    I'm getting distinct keyword if i'm accessing the report directly . but when i'm accessing it from dashboard in the back end while preparing the query it's writing distinct but the actual query which is sending to db does not have distinct.
    ==================================================
    RqList distinct
    VW_SCNR_114000074_TA_DATA.Match Identifier as c1 GB,
    VW_SCNR_114000074_TA_DATA.Tot Trans Amt as c2 GB,
    VW_SCNR_114000074_TA_DATA.Tot Trans Ct as c3 GB,
    case when VW_SCNR_114000074_TA_DATA.Alert Quality Code = '1' then 'Productive' when VW_SCNR_114000074_TA_DATA.Alert Quality Code = '2' then 'Non Productive' else 'Indeterminate' end as c4 GB,
    VW_SCNR_114000074_TA_DATA.Batch Identifier as c5 GB
    DetailFilter: Alert TA Data.Run Id > 0 and Alert Scenarios.Scenario Name = 'ScnroName' and Alert TA Data.Batch Id > 0
    OrderBy: c4 desc
    =================================================
    -------------------- Sending query to database named KYC1.1DEV-179 (id: <<16315>>):
    select T353.BATCH_ID as c1,
    case when T353.QLTY_RTG_CD = '1' then 'Productive' when T353.QLTY_RTG_CD = '2' then 'Non Productive' else 'Indeterminate' end as c2,
    T353.TOT_TRXN_CT as c3,
    T353.TOT_TRXN_AM as c4,
    T353.BREAK_ID as c5,
    T117.SCNRO_NM as c6
    from
    KDD_SCNRO T117,
    KDD_TA_DATA T130,
    KDD_TSHLD_SET T171,
    VW_SCNR_114000074_TA_DATA T353
    where ( T117.SCNRO_ID = T130.SCNRO_ID and T117.SCNRO_ID = T171.SCNRO_ID and T130.SCNRO_ID = T171.SCNRO_ID and T130.SCNRO_ID = T353.SCNRO_ID and T130.TSHLD_SET_ID = T171.TSHLD_SET_ID and T171.SCNRO_ID = T353.SCNRO_ID and T171.TSHLD_SET_ID = T353.TSHLD_SET_ID and 0 < T130.BATCH_ID and 0 < T130.RUN_ID )

  • How to put wallpaper on the homescreen on ipod touch 3g?

    I have an ipod 3g and I am wondering how to put wallpaper on the homescreen,I tired to go to settings,but it still won't work??

    Just so we don't spin our wheels, please confirm that it is indeed 3rd-gen (there was a 32GB 2nd-gen iPod touch). You may well be correct, but other people have been mistaken in what they have, so I've learned to confirm. The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the iPod. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.
    Assuming you do indeed have a 3rd-gen iPod, what version of iOS is it running? And when you say "won't work", do you mean that you don't see the option, or you see the option but when you try and change the wallpaper it doesn't change?
    Regards.

  • I have bought a Macbook Pro Retina, and the iPhoto which comes with it, has a different iPhoto Book menu.  I cannot see how to put text at the bottom of the pages of photographs, instead of the default place in the middle.  Is there a way to do this?

    I have bought a Macbook Pro Retina, and the iPhoto which comes with it, has a different iPhoto Book menu.  I cannot see how to put text at the bottom of the pages of photographs, instead of the default place in the middle.  Is there a way to do this?

    There are different templates for iPhoto books and they differ from version of iPhoto to iPhoto, so explore the other options.

  • How to put name in the application toolbar

    how to put name on the button in the application tool bar while it is created with selection screen

    I've never seen this done this way.  Learn something new everyday.  Anyway, here is a sample program that will show you what you need to do to add text to your function button,  this also adds an icon.
    report zrich_0002.
    Tables: sscrfields.
    selection-screen function key 1.
    select-options: s_datum for sy-datum.
    INITIALIZATION.
      MOVE '@49@ Export'  TO SSCRFIELDS-FUNCTXT_01. "ICON_EXPORT
    If this has solved your problem, please award points accordingly and mark this post as solved.  Thanks.
    Regards,
    Rich Heilman

  • I have new music on the itunes but have not a clue how to put it on the iphone, it only seems to want to put the old songs on

    i have new music on the itunes but have not a clue how to put it on the iphone, it only seems to want to put the old songs on

    http://support.apple.com/kb/HT1386
    Are you manually managing your songs?
    In itunes - music do you see checkmarks next to your musis/songs.  IF so go find your new songs click on it and then sync your music again.

  • Can we set the dynamic data source when using getReportParameters() ?

    Hello!
    I have a report where one of its parameters refers to a list of values (LOVs). This list of values is an SQL Query type. When the data source used in the report is defined in the BI Publisher server, I'm able to get the report parameters using the getReportParameters() function in my application. However, if the data source is not defined the function throws an exception, which is understandable.
    I decided to dynamically set the data source so that even if the data source used by the report is not defined in the BI Publisher server, it still will be able to get the LOVs for the parameter. I tried setting the JDBCDataSource of the dynamicDataSource for the ReportRequest object that I passed to the getReportParameters() function. Please see the sample code below:
    reportRequest.dynamicDataSource = new BIP10.BIPDataSource();
    reportRequest.dynamicDataSource.JDBCDataSource = new BIP10.JDBCDataSource();
    setReportDataSource(reportRequest.dynamicDataSource.JDBCDataSource, connectstr, jdbc, dc); //function to set the values for JDBCDataSource object
    reportParams = webrs.getReportParameters(reportRequest, uid, pwd); //call the getReportParameters
    I was expecting this to work as this is what I did to dynamically set the data source before calling the runReport function. So, my question is -- can we set the dynamic data source when using getReportParameters() ? I tried this both in versions 10g and 11g. It does not seem to work on both versions.
    Regards,
    Stephanie

    report_id column of apex_application_page_ir_rpt can help us uniquely identify each saved report.
    We can assign this report_id value to a page item and this page item can be put in the Report ID Item text box of the Advanced section of the Report Attributes page of the IR.
    This should load the saved report identified by report_id and you can get rid of javascript
    Regards,
    Vishal
    http://obiee-oracledb.blogspot.com
    http://www.packtpub.com/oracle-apex-4-2-reporting/book
    Kindly mark the reply as helpful/correct if it solves your problem

  • Photoshop CS6 crashes all the time and especially when using the type tool... please help!

    Photoshop CS6 crashes all the time and especially when using the type tool... please help!

    Since I did not have this problem with CS5 or CS4, I can only assume something is not right with Photoshop CS6... below is my video card info:
    ATI Radeon HD 4850:
      Chipset Model:          ATI Radeon HD 4850
      Type:          GPU
      Bus:          PCIe
      PCIe Lane Width:          x16
      VRAM (Total):          512 MB
      Vendor:          ATI (0x1002)
      Device ID:          0x944a
      Revision ID:          0x0000
      ROM Revision:          113-B9110C-425
      EFI Driver Version:          01.00.383
      Displays:
    iMac:
      Resolution:          2560 x 1440
      Pixel Depth:          32-Bit Color (ARGB8888)
      Main Display:          Yes
      Mirror:          Off
      Online:          Yes
      Built-In:          Yes
      Connection Type:          DisplayPort
    Cinema HD:
      Resolution:          1920 x 1200
      Pixel Depth:          32-Bit Color (ARGB8888)
      Display Serial Number:          2A80273WXMN
      Mirror:          Off
      Online:          Yes
      Rotation:          Supported

  • CDPOS for the moving avenge price when using MIRO, MIGO & VL31N etc.

    Hi
    Is there a way of tracking all changes with CDPOS for the moving avenge price when using MIRO, MIGO & VL31N etc.
    We can show changes for MR21 in CDPOS but we need to reflect all changes made to the moving avenge price for MIRO, MIGO & VL31N etc. We need to run a report that will show all these changes.
    We run a report to look at all the change records for Moving Avenge Price, We use tables CDPOS & CDHDR, then Change the document Object for both tables to material, so when the report is run you can identify the material by the object value field
    u201CIf you look at CDPOS the fields where reading the data from in the u201CNew Value fieldu201D is CDFLDVALN when I do an F1u201D
    u201CIf you now check MBEW on the u201CMoving Avenge Price fieldu201D, the data reads from VERPR which is the field we need to reflect the changes. If we can change this then the report will worku201D
    Can you help please?
    Edited by: Derrick smith on Nov 28, 2008 1:51 PM

    Hello Jürgen,
    Thank you for your quick reply. I read the note -- it describes the symptom perfectly, and gives example cases which match our situation. However, no solution or recommendation is given. Does it mean that this way of valuating cancellations is not seen as a malfunction, and cannot be changed?
    Thanks in advance.
    Regards,
    Sergei

  • What does the RHD symbol mean when using the multiple speakers?

    i have two 1st gen apple TVs and when i pull up the multiple speakers prompt, i see an acronym "RHD" after each device.
    what does the RHD symbol mean when using the multiple speakers?
    typically i was used to seeing the Apple TV-1  vs. Apple TV-1-RHD??
    What is the difference?

    It's been modified to run Remote HD.
    http://remotehd.com/

  • Will the indexes be ignored when using IMPDP...TABLE_EXISTS_ACTION=SKIP?

    Hi guys,
    11gr2
    suppose that i have a .dmp file which has tables, indexes, and data,
    and i also have a schema A which already contains tables and data, without indexes
    is it possible to use IMPDP to import(or say create) all indexes from .dmp to schema A?
    the relevant question is, when using IMPDP...TABLE_EXISTS_ACTION=SKIP, if the table already exists, will IMPDP ignores the relevant indexes creation?
    thank you!!!

    thanks for the reply.
    actually, i have imported over 100G data to the new server, but after look into the new server, most of the indexes are missing somehow, i don't want to drop the schemas and re-import, it will cost me a whole day to finish, any suggestions?
    many thanks.

  • Do i need to remove the micro sim card when using home wi fi on ipad2

    do i need to remove the micro sim card from the i pad 2 when using wi fi sat home?

    thank you Ralph may i just ask you if your home wifi network is not working do you then have to actively seek the data connection?i suppose i am asking do you need to choose from a menu ?

Maybe you are looking for

  • Mail & Mavericks & Keychain Access

    Hello, After updating to Mavericks (from Mountain Lion), I noticed that there's a new keychain called "local items" inside Keychain Access App. so I have a couple of questions regarding this and my usage of Mail: 1) from what I read in this forum, "l

  • Error while sending XML SOAP message to other network

    Hi, I have a java application using SOAP through which I am sending request to a machine in the same network. It is giving the response in xml and i am able to parse it. But when I tried to give the IP in the destination i.e the IP in the other netwo

  • IPod Touch 4G not showing up in My Computer (Windows 7)

    Hello, I'm new to the forums and I don't know whether this is the right place for a Windows user to post a problem. If not, disregard this thread. My iPod Touch 4G doesn't always show up in My Computer making video/picture transfer impossible. So far

  • Does a Mac Pro work with a 5 GHz router?

    Hi, My Mac Pro is connected to a 2.4 / 5Ghz D-Link router via a ethernet cable. I know I get 2.4 Ghz, but can I get it to work at 5Ghz? Thanks -Dean

  • Show different lists depending on subtype

    Hi, In transaction PA30 it is possible to show a list. Normally you define the list screen number in the customizing for infotypes, so just 1 different screen is possible. Now I want to know if it is possible to use  2 different screens for the list