How to modify a table that is owned by sys?

I connected as sysdba and created a table. So I decided to remove a column from the table and Oracle gave me the following error message:

ORA-12988: cannot remove column of table belonged to SYS

I have read about the error and learned that I better not create tables when you are logged in as sys. So I can drop all the table, but not a column of the table.

Why is that I can modify the table, but can't remove her columns when I am logged in as sys?
Is it possible to remove columns from the table, that I created?
What should I do with this table, I created under sys? Do I have to delete the entire table, because it is immutable?

Published by: artanis April 12, 2010 03:47

Hi Artanis,

See for this just to ensure that everyone connected as user SYS should not intentionally or by mistake be no matter which column of a table that is owned by SYS because the sys user owns all the data dictionary tables and Oracle is not one of these tables in no case be changed or you can say that they do not want anything in the SYS schema should be modified by manual action as any structure of the object changes. This is the reason why it is advisable to do not create user objects in the sys schema.

Tags: Database

Similar Questions

  • How to list a table that grows?

    I have a table that grows based on the end user to input.  I wish that the first column to show the enumeration for the table. For example, the first line after the header will be 1, the second line will be 2, etc..  I need a script that will add the correct number for each row that is created. I KNOW that there is an easy way to do it! Anyone? Anyone?

    Hello

    You can use the index property.

    On the initialize event of your domain you can put the script:

    this.rawValue = this.parent.index + 1;

    See attached example.

    ARO

    Paul Butenko

  • How to build a table that can be filled in by the user?

    I am building a form where the user can easily add a quantity to order a size. I was not able to do other than the addition of a text field for each option. You can create a table that would do the same thing (see my example below)? Better yet, is it possible to get it altogether? Any ideas appreciated!

    Small

    Med

    Large

    XL

    Total

    A style

    Style B

    Hello

    You already have a good start to generate the table. All you need to do is change the cells of static text in a numeric field or text field. You can do so by dragging a numericField library of objects and place it inside the cell.

    Once you have the digital field in place, you can change the properties, police, alignment, currency, validation, etc. Then copy and paste the field in similar cells and change names, e.g. A_small, B_small etc.

    The field 'Total' digital could have a Formcalc in the calculate event:

    $ = A_small + A_med + A_large + A_xl

    It is based on a static table where design you all the lines that will be accessible to the user.

    You can also configure dynamic tables where the EBU can add extra lines. There are many good examples using the LC and the forums.

    Good luck

    Niall

  • Can I build an application using a table that is owned by another user?

    Greetings,

    I am very beginner in Oracle, and I really need help with this point.
    I created 2 user accounts: user1 and user2.

    In User1, I wrote:

    GRANT CONNECT, RESOURCE
    for User2.

    Grant select, insert, update
    on table1
    for User2.


    Now, user2 can see the content of this table, but only in the part SQL (select * from user1.table1)
    How can I create an application that uses the table1 to user2?
    When I go to application builder, I have to choose one of the tables belonging to the user2. But I can't use table1 User1 although that User2 has permission to access.

    Any help?

    Thank you in advance!

    Beginner's daughter

    Hello

    There is a powerful solution, that you can use.

    You can create a view. Some views may be editable (this means that it is possible to update
    the Table for the view) and you can add some constraints (Primay Key) on a view.

    For example:

    CREATE or REPLACE ADVICE {color: Red} User2.view_name {color}
    (col1 {color: red} {color}, col2 {color: red} {color})
    UNIQUE RELY DISABLE NOVALIDATE,
    The CONSTRAINT {color: red} pk_view {color}
    Col1 PRIMARY KEY {color: red} {color}) MATTER DISABLE NOVALIDATE
    ) AS
    SELECT col1 {color: red} {color}, col2 {color: red} {color} OF {color: Red} User1.Table1 {color};

    This example is from the link below:

    [http://www.psoug.org/reference/views.html]

    Hope this can help.
    Best regards
    Jean Valentine

  • How to record a dvd that I own on my computer for later reading

    How can I burn a dvd on my laptop for I can play with it later?

    Hi djjazzyjeff

    Thank you for visiting the Vista Forum.

    Please use www.live.com or your favorite search engine for applications that will do what you asked.

    Windows Media Player is not TEAR DVD, please see the article (link) for confirmation below.
    http://www.Microsoft.com/windows/windowsmedia/KnowledgeCenter/mediaadvice/0090.mspx#EWCAC

    Ken
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to find the tables that are used in a procedure

    Hello
    I need to write a SQL to find (user_source) procedures or triggers (from user_triggers), whose code contains the registerd tables in a table X.
    In other words, I have a table X with files having a column containing tables. I want to write a SQL to obtain these (proc, package and triggers) container objects or use the tables inside
    Can you help me?
    Thank you!

    Mark1970 wrote:
    Hello
    I need to write a SQL to find (user_source) procedures or triggers (from user_triggers), whose code contains the registerd tables in a table X.
    In other words, I have a table X with files having a column containing tables. I want to write a SQL to obtain these (proc, package and triggers) container objects or use the tables inside
    Can you help me?
    Thank you!

    I don't know if I understand your problem, but have you had a glance at the data dictionary views USER_DEPENDENCIES or ALL_DEPENDENCIES?

    It has classified hard dependencies of objects.
    If a table is used directly (not in dynamic SQL code in a string) in an object PL/SQL, the dependency is available in the stated points of view.

  • How to modify the table - webcenter sites v11.1.1.8

    Hello

    My version of sites is 11.1.1.8, then I can't see or go to your colleague, do someone know why?

    Description of e_sitesdatabase_small.png follows

    Hello

    This shape has been deleted. There is a documentation bug opened for her. See Doc ID 1600474.1.

    You can still access the menu via http://{host}:{port}/{context}/ContentServer?form=main&tool=CatalogMgt&pagename=FutureTense%2FApps%2FAdminForms%2FAdminForm&inifile=Variables.inifile

    Kind regards

    Stephan.

  • How to create a table in if/else or structure without 0-case?

    Hello

    I tried to do for a while now.

    I only managed to think about this in three ways:

    1. (what I'm doing right now create the table through a loop for, fills the table in automatic indexing.) Filled it with many of if true and with a '0' if the value false. The idea was to remove the 0 later in the code. However, this seems very inefficient.

    2 make use of a registry change, which automatically adds the correct number of a table. The problem is that the table will keep growing and growing and at the very least would enormously slow down my program. At worst, it would break.

    So my question is: how to create a table that if a comparison is true, it puts the item in and if not, it does nothing?

    I have attached a PNG of my code snippet.

    Kind regards

    David.

    If you want to only affect exactly as much memory as you need for the table, you can count the number of true elements in the table of Boolean everything first and then assign one of exactly this size. In this way, you are more memory and time-efficient whether overuse (such as allocation of an array of I32 as big as the whole table boolean) or underallocating (from zero element and let it grow automatically whenever you add on).

    Count the true values, allocate an array only the great and then replace each value in this new table with indexes / "I ' value where the real exists." An excerpt from VI:

  • How can I make sure that changes in a primary key (in the parent table) would also appear directly in the FOREIGN KEY in the child table?

    Forgive my question. I am very new to Oracle.

    How can I make sure that changes in the key primary supplier_id (concerning the supplier table) would also appear directly in the FOREIGN KEY (supplier_id) in the products table?

    Is that not all the primary key and FOREIGN KEY on?

    My paintings:

    I created 2 tables and connect to apply in the data base referential integrity, as I learned.

    CREATE TABLE - parent provider

    (the numeric (10) of supplier_id not null,)

    supplier_name varchar2 (50) not null,

    Contact_Name varchar2 (50).

    CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)

    );

    CREATE TABLE - child products

    (the numeric (10) of product_id not null,)

    supplier_id numeric (10) not null,

    CONSTRAINT fk_supplier

    FOREIGN KEY (supplier_id)

    REFERENCES beg (supplier_id)

    );

    I inserted the following text:

    INSERT INTO provider

    (supplier_id, supplier_name, contact_name)

    VALUES

    (5000, 'Apple', 'first name');

    I expect that the supplier_id (5000) to the provider of the table also appears in the products table under key supplier_id having the same value which is 5000. But this does not happen.

    How to get there?

    Thanks in advance!

    Hello

    What is a foreign key in Oracle?

    A foreign key is a way to ensure referential integrity in your Oracle database. A foreign key means that the values of a table must appear also in another table.

    Ok!??

    What is now the right way to implement referential integrity in your Oracle database that the values of a table must also be included in another table?

    A foreign key referential integrity indeed enfore in ensuring that the value in the child table must have a corresponding parent key (otherwise you will encounter an error, as evidenced by "SomeoneElse"). However, it will never automatically insert a row in the other table.

    If you are looking for a solution that automatically inserts a record in the other table, maybe you should go for triggers:

    See:

  • How to get a magic number for any table that returns more than 32 k?

    I'm in a unique situation where in I try to extract the values of the multiple tables and to publish as XML output. The problem is based on the condition of a few tables can retrieve more than 32 KB and less than 32 KB of data. Less than 32KB is not a problem, as the generation of XML is smooth. The minute he reached more than 32 k, it generates a runtime error. I was wondering if there is a way to make sure that the minute results of the query is greater than 32 KB, it must break say - if results is 35KO, so should I break this result 32 KB and 3 KB. Once then pass these data to appear as XML output. Again, it is not just for a table, but all the tables which are called in the function.

    Is it possible? I'm unable to get ideas, or did I do something so complex from the point of view of production support. If you'd be grateful if someone can guide me on this.

    The way it is, is the following:
    I have a table named ctn_pub_cntl


    CREATE TABLE CTNAPP.ctn_pub_cntl 
    (ctn_pub_cntl_id          NUMBER(18)
    ,table_name                  VARCHAR2(50)
    ,last_pub_tms              DATE
    ,queue_name               VARCHAR2(50)
    ,dest_system              VARCHAR2(50)
    ,frequency                  NUMBER(6)
    ,status                      VARCHAR2(8)
    ,record_create_tms          DATE
    ,create_user_id                VARCHAR2(8)
    ,record_update_tms          DATE
    ,update_user_id             VARCHAR2(8)
    ,CONSTRAINT ctn_pub_cntl_id_pk PRIMARY KEY(ctn_pub_cntl_id)
    );
    
    

    To do this, the data are:


    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_SBDVSN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,15
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
     ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_TRACK_SGMNT_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN_DN'
    ,TO_DATE('10/2/2004 10:17:44PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,30
    ); 
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms  
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('02/06/2015 9:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.TSZ601.UNP'
    ,'SAP'
    ,120
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FXPLA_TRACK_LCTN2_DN'
    ,TO_DATE('04/23/2015 11:50:00PM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.YRDPLN.INPUT'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_FIXED_PLANT_ASSET'
    ,TO_DATE('04/23/2015 11:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,10
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms 
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT'
    ,TO_DATE('03/26/2015 7:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    INSERT INTO CTNAPP.ctn_pub_cntl
    (ctn_pub_cntl_id    
     ,table_name         
     ,last_pub_tms
    ,queue_name  
     ,dest_system        
     ,frequency          
    )
    VALUES
    (CTNAPP_SQNC.nextval
    ,'TRKFCG_OPRLMT_SGMNT_DN'
    ,TO_DATE('03/28/2015 12:50:00AM','MM/DD/YYYY HH12:MI:SSPM')
    ,'UT.TSD.WRKORD.UNP'
    ,'SAP'
    ,30
    );
    
    /
    
    COMMIT;
    
    

    Once the above data are inserted and committed, then I created a feature in a package:


    CREATE OR REPLACE PACKAGE CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
    TYPE tNameTyp IS TABLE OF ctn_pub_cntl.table_name%TYPE INDEX BY BINARY_INTEGER;
    g_tName tNameTyp;
    
    TYPE tClobTyp IS TABLE OF CLOB INDEX BY BINARY_INTEGER;
    g_tClob tClobTyp;
    
    
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_count OUT NUMBER ) RETURN tClobTyp;
    
    
    END CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
    
    --Package body
    
    CREATE OR REPLACE PACKAGE BODY CTNAPP.CTN_PUB_CNTL_EXTRACT_PUBLISH
    IS
    
         doc           xmldom.DOMDocument;
         main_node     xmldom.DOMNode;
         root_node     xmldom.DOMNode;
         root_elmt     xmldom.DOMElement;
         child_node    xmldom.DOMNode;
         child_elmt    xmldom.DOMElement;
         leaf_node     xmldom.DOMNode;
         elmt_value    xmldom.DOMText;
         tbl_node      xmldom.DOMNode;
         table_data    XMLDOM.DOMDOCUMENTFRAGMENT;
      
         l_ctx         DBMS_XMLGEN.CTXHANDLE;
         vStrSqlQuery  VARCHAR2(32767);
         l_clob        tClobTyp;
         --
         l_xmltype     XMLTYPE;
         --
    --Local Procedure to build XML header     
    PROCEDURE BuildCPRHeader IS
    
      BEGIN
        child_elmt := xmldom.createElement(doc, 'PUBLISH_HEADER');
        child_node  := xmldom.appendChild (root_node, xmldom.makeNode (child_elmt));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_APLCTN_ID');
        elmt_value := xmldom.createTextNode (doc, 'CTN');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
        child_elmt := xmldom.createElement (doc, 'SOURCE_PRGRM_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'SOURCE_CMPNT_ID');
        elmt_value := xmldom.createTextNode (doc, 'VALUE');
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
    
        child_elmt := xmldom.createElement (doc, 'PUBLISH_TMS');
        elmt_value := xmldom.createTextNode (doc, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
        leaf_node  := xmldom.appendChild (child_node, xmldom.makeNode (child_elmt));
        leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value));
        
    END BuildCPRHeader;
    
    --Get table data based on table name
    FUNCTION GetCtnData(p_nInCtnPubCntlID IN CTN_PUB_CNTL.ctn_pub_cntl_id%TYPE,p_Count OUT NUMBER) RETURN tClobTyp IS
        
        vTblName      ctn_pub_cntl.table_name%TYPE;
        vLastPubTms   ctn_pub_cntl.last_pub_tms%TYPE;
         
    BEGIN
                g_vProcedureName:='GetCtnData';    
                g_vTableName:='CTN_PUB_CNTL';
                
            SELECT table_name,last_pub_tms
            INTO   vTblName, vLastPubTms
            FROM   CTN_PUB_CNTL
            WHERE  ctn_pub_cntl_id=p_nInCtnPubCntlID;
        
        -- Start the XML Message generation
            doc := xmldom.newDOMDocument;
            main_node := xmldom.makeNode(doc);
            root_elmt := xmldom.createElement(doc, 'PUBLISH');
            root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
            
          --Append Table Data as Publish Header
            BuildCPRHeader;
            
          --Append Table Data as Publish Body
          
           child_elmt := xmldom.createElement(doc, 'PUBLISH_BODY');
           leaf_node  := xmldom.appendChild (root_node, xmldom.makeNode(child_elmt)); 
           
           DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT','''YYYY:MM:DD HH24:MI:SS''');
           
           vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                        --  ||  ' AND rownum < 16'
                          --;
          DBMS_OUTPUT.PUT_LINE(vStrSqlQuery);
           
           l_ctx  := DBMS_XMLGEN.NEWCONTEXT(vStrSqlQuery);
          DBMS_XMLGEN.SETNULLHANDLING(l_ctx, 0);
          DBMS_XMLGEN.SETROWSETTAG(l_ctx, vTblName); 
           
          -- Append Table Data as XML Fragment
          l_clob(1):=DBMS_XMLGEN.GETXML(l_ctx);  
          elmt_value := xmldom.createTextNode (doc, l_clob(1)); 
         leaf_node  := xmldom.appendChild (leaf_node, xmldom.makeNode (elmt_value)); 
         
         xmldom.writeToBuffer (doc, l_clob(1));
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL);
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<');
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>');
         
         RETURN l_clob;
         
         DBMS_OUTPUT.put_line('Answer is' ||l_clob(1));
         
         EXCEPTION
            
            WHEN NO_DATA_FOUND THEN
            
            DBMS_OUTPUT.put_line('There is no data with' || SQLERRM);
            g_vProcedureName:='GetCtnData';
            g_vTableName:='CTN_PUB_CNTL';
            g_vErrorMessage:=SQLERRM|| g_vErrorMessage;
            g_nSqlCd:=SQLCODE;
            ctn_log_error('ERROR',g_vErrorMessage,'SELECT',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
            
            
            WHEN OTHERS THEN
           
           DBMS_OUTPUT.PUT_LINE('ERROR : ' || SQLERRM);
           ctn_log_error('ERROR',g_vErrorMessage,'OTHERS',g_nSqlCd,p_nInCtnPubCntlID,g_vPackageName,g_vProcedureName,g_vTableName);
           
    END GetCtnData;
    
    
    PROCEDURE printClob (result IN OUT NOCOPY CLOB) IS
        xmlstr   VARCHAR2 (32767);
        line     VARCHAR2 (2000);
    BEGIN
        xmlstr := DBMS_LOB.SUBSTR (result, 32767);
    
        LOOP
           EXIT WHEN xmlstr IS NULL;
           line := SUBSTR (xmlstr, 1, INSTR (xmlstr, CHR (10)) - 1);
           DBMS_OUTPUT.put_line (line);
           xmlstr := SUBSTR (xmlstr, INSTR (xmlstr, CHR (10)) + 1);
        END LOOP;
    END printClob;
    
    END CTN_PUB_CNTL_EXTRACT_PUBLISH;
    
     
    

    If you notice my query:


    vStrSqlQuery := 'SELECT * FROM ' || vTblName 
                          || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
                         ||  ' AND rownum < 16'
                        ;
    

    The minute I comment

    ||  ' AND rownum < 16' ;


    It generates an error because this query returns about 600 lines and all these lines must be published in XML format and the tragedy, is that it is a C program between institutions i.e. C calls my functions of packged and then will do all the processing. This will return the results to the C program. Then obviously C does not recognize the CLOB and somewhere in the process, I convert to VARCHAR or CLOB CLOB, I have to use VARCHAR as a return type. That's my challenge.


    Someone who can help me find the number required of magic and also a brief knows how, I understand that. Thanks in advance.

    Not that I would use it myself but your package can be simplified down, like this:

    create or replace package ctn_pub_cntl_extract_publish is
    
      C_DTFORMAT  constant varchar2(30) := 'YYYY-MM-DD HH24:MI:SS';
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date) return xmltype;
      function getCTNData (p_id in number) return clob;
    
    end ctn_pub_cntl_extract_publish;
    /
    
    create or replace package body ctn_pub_cntl_extract_publish is
    
      function getXMLData (p_table_name in varchar2, p_pub_tms in date)
      return xmltype
      is
    
        v_query  varchar2(32767) :=
                 q'{select * from $$TABLE_NAME where record_update_tms <= to_date(:1, 'YYYYMMDDHH24MISS')}';
    
        ctx      dbms_xmlgen.ctxHandle;
        doc      xmltype;
    
      begin
    
        execute immediate 'alter session set nls_date_format = "'||C_DTFORMAT||'"';
        v_query := replace(v_query, '$$TABLE_NAME', dbms_assert.simple_sql_name(p_table_name)); 
    
        ctx := dbms_xmlgen.newContext(v_query);
        dbms_xmlgen.setBindValue(ctx, '1', to_char(p_pub_tms, 'YYYYMMDDHH24MISS'));
        dbms_xmlgen.setRowSetTag(ctx, p_table_name);
        dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.DROP_NULLS);
        doc := dbms_xmlgen.getXMLType(ctx);
        dbms_xmlgen.closeContext(ctx);
    
        return doc; 
    
      end;
    
      function getCTNData (p_id in number)
      return clob
      is
    
        doc  clob;
    
      begin
    
        select xmlserialize(document
                 xmlelement("PUBLISH"
                 , xmlelement("PUBLISH_HEADER"
                   , xmlforest(
                       'CNT' as "SOURCE_APLCTN_ID"
                     , 'VALUE' as "SOURCE_PRGRM_ID"
                     , 'VALUE' as "SOURCE_CMPNT_ID"
                     , to_char(sysdate, C_DTFORMAT) as "PUBLISH_TMS"
                     )
                   )
                 , xmlelement("PUBLISH_BODY"
                   , getXMLData(t.table_name, t.last_pub_tms)
                   )
                 )
               )
        into doc
        from ctn_pub_cntl t
        where t.ctn_pub_cntl_id = p_id;
    
        return doc;
    
      end;
    
    end ctn_pub_cntl_extract_publish;
    

    Function getXMLData() generates a canonical XML document out of the table that is passed as a parameter.

    Function built getCTNData() code XML "PUBLISH", the document using SQL/XML functions, the getXMLData() call in the process and returns the content serialized as a CLOB.

  • How to keep the style of setting shaped tables that you paste IN when copying old pictures?

    Hi all

    I know that CMD-SHIFT-V works perfectly to keep the text styles you paste IN when you copy another block of text that contains different styles, but how do I do the same thing with a TABLE?

    I have paintings from an InDesign document with a set of styles/table cell styles, etc and am copying into another InDesign document where I have tables that have table styles different styles/cell, etc. The only way I can successfully get the information in one table to another is to copy the information from the old table with the old styles and then paste it into an excel worksheet, and then copy the excel worksheet and paste into new tables in the new InDesign document.

    Now, wouldn't that be so bad if I didn't have SO MANY hundreds and hundreds of paintings I was working with! I am currently working on a big catalogue and this workflow is slowing down a lot:)

    Please note that I have deleted all styles (by removing all styles) tables I am pasting FROM, but chose to keep the formatting.

    Once more, I bet that I I will kick myself when I see how the answer is easy!

    Any help would be so appreciated!

    Thank you kindly,

    Christine

    Try converting your old text table (column separator: tab; line separator: paragraph). Copy, select the style of lines and columns you want to paste the text in and paste without formatting in your new table. It may not work if your table is very complicated, but it worked for me on a test very simple.

  • How the nested table that is stored in the database?

    How the nested table that is stored in the database?
    The nested table column is stored with the table main or separate in the database?

    A nested table is a table that is stored in the structure of another table. It is used to support the columns that contain multivalued attributes.

    If you want to use the same type in multiple places, create them on a global scale and these will be discussed under 'Types'.

  • How to delete all TABLEs in the schema SYS that are created from 09:15?

    Unfortunately a script created a lot of tables in the diagram (= SYS) and bad Tablespace (= SYSTEM).

    How can I delete all TABLES that are created inTablespace = SYSTEM and SCHEMA = SYS (in a DDL command)
    respectively for the past 3 hours from 09:15 to 25 Sep 2011?

    Alternative: How can I move these tables in another schema (for example ATEST) and Tablespace (USERS)?
    Is this possible with Oracle XE or Oracle Enterprise?

    Peter

    You can use ALTER TABLE... MOVE. It offers a TABLESPACE clause, which allows you to choose a different tablespace as target. Refer to the documentation for your version of the database.

  • Table of DB tools list: how to access tables that are in the different SQL database?

    Hi all

    I work on an implementation of database (SQL server) and evaluates the Toolkit OR DB for this project.

    One of the requirements is that I need access to the tables that are in two different database

    (say Table to 1 DB and Table B to 2 DB).

    Our IT guy linked table in DB1 to DB 2 and I verfied this when I use the SQL server management studio.

    When DB 2 tables is filled, table from DB1 is also there. I can also do the same thing using MS Access.

    Table A of the DB1 is available for me enven if I only connect to 2 DB.

    Here comes the problem.

    When I use DB tool list Table.vi to access DB2, it does NOT list A table in DB1. It list only the tables in

    the database (DB2) which I am connection (using DB tool opened Connection.vi with a file DSN)

    So my work around right now is to open a separate connection both DB1 and DB2. However, this approach

    obviously creates a problem when I have to access a separate database constantly in my application.

    What would be a solution to this? I have search the Forum but only to see a post that is somewhat related to

    My question. (And it was published the 2004) Maybe I need to change the code in the orignial VI (DB tool list Table.vi)?

    My computer guy told me that he has not met this scenario since he wrote code in another environment such as

    VB and others and it has always been successful in linking the different database tables.

    I hope my question is clear and healthy because I don't really know much about database terminology.

    Any comment or suggestion is appreciated!

    Thank you

    Chad

    Ok.  Here is some information that I can work with.  Good.

    Your COMPUTER staff created a view called "VISUAL_WORK_ORDER".

    A view isn't a table.  It is a "virtual" table  Views are used to collect data (usually) in several different tables.

    But I guess that the code inside the DB tool list Table.vi returns a list of tables.  Views are not the tables.  Then "VISUAL_WORK_ORDER" does not appear in the list.

    HOWEVER, this should not really matter.  The view is here!  And it can be queried like any table.  So, you can use DB tools Select Data.VI... and wire in "VISUAL_WORK_ORDER" as the name of the table.  This will return the contents of the view.  Alto!

  • How to find the names of tables that have more than 100 columns

    Hi gurus,

    Please help me find the names of the tables that have more than 100 columns in the database.

    Below will be useful for you.

    SELECT atc.OWNER,atc.TABLE_NAME,count(*)
    FROM all_tab_columns atc
    GROUP BY  atc.OWNER,atc.TABLE_NAME
    HAVING count(atc.COLUMN_NAME) > 100
    

    Adding another point, you can use user_tab_columns, all_tab_columns, dba_tab_columns, based on your needs/access.

    Thank you
    Suri

    Published by: Suri on February 23, 2012 11:30

Maybe you are looking for

  • Installed the game 9 GB (Obduction) but I'm not.

    I downloaded a massive 9GB game called "Obduction" and then follow the steps to install it. At the end of this installation, which ended while I was away from the computer, a window was left with a large green checkmark telling him "Installation was

  • Cookie Manager - it allows to backup/restore a cookie in particular.

    Cookie Manager - http://cookiemanager.blogspot.com/Sometimes I connect to a site and he seems to forget that I've been there and the info I entered previously. This is especially irritating if it's a game I've taken at a high level. If doc in support

  • Find a character

    I recently had to reinstall Firefox, and I'll try to find the character I've had on this subject (I don't remember the name unfortunately). It looks like the character of Dark Light, but he also changed the colors of the menu to be too dark. Does any

  • Windows Genuine Advantage Validation Tool installation has failed

    Windows XP reloaded HP_Recovery partition on HP laptop. Several attempts of updates. The above moved

  • Acer Tablet not known

    Someone at - he heard of an acer iconia 8 1A - 820model, because it seems that acer is not