How to insert in the table, the description of the table of the table

Dear all,

I need to take the description of the table of the table and I need to insert this description in a new column in the table, please help me how to write the query for the latter.
Thanks in advance

Louison P

Looking for a way to extract the DDL and stored in another table?

SQL> drop table dt;

Table dropped.

SQL> create table dt(x clob);

Table created.

SQL> insert into dt select dbms_metadata.get_ddl('TABLE', 'T') from dual;

1 row created.

SQL> select * from dt;

X
--------------------------------------------------------------------------------

  CREATE TABLE "TEST"."T"
   (    "X" NUMBER(*,0)
   ) PCTFREE 10 PCTUSED 4

SQL>

Tags: Database

Similar Questions

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • [11g] ORA-31061/ORA-19202 - how to insert data xmltype table/validation of the schema (just well formed)

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Here's the demo program:

    ==============================

    create a global temporary table GTT_Test(data xmltype) validation delete rows;

    - and run this

    declare

    v_data xmltype.

    Start

    -It does not work

    /*

    v_data: = xmltype ("< itf:meta > < node / > < / itf:meta > '");

    */

    - but it works

    v_data: = xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1);

    - but try to insert into the table in the same way fails again:

    insert into GTT_Test (data)

    values (xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1));

    end;

    ==============================


    It translates errors ORA above and suspicion: "prefix 'my' is not declared".


    I need to create the TWG somehow different to accept without diagram validation?


    -Thanks!


    Kind regards

    Frank

    Hello.

    Try to declare to your XML namespace.

    for examplehttp://youaddress">

    "If you don't have a schema, try xmlns: my =" "(espace en blanc)."

  • I have Adobe Acrobat Pro XI.  I went to special characters from the Edit menu and choose some emoji as Favorites, but I can't understand how to insert in the document.  How can I insert special characters into a document?

    How can I insert emoji or other special characters in a document using Adobe Acrobat Pro XI?  I went to special characters from the Edit menu and may not understand how to insert the special character in the document.

    He's not that kind of editor. You can use the characters in a font. If you can select a font with the emoji, which fits into the case, and then enter the characters, it can work.

    This suggests that you try to do TOO MUCH with a PDF file. It is a common thing, but the message should be: everything simply because you can edit a PDF file, does not mean that it is the most effective way for you to do your job.

  • How to insert into DB tables of bean

    I want to insert in some custom tables of bean. How

    (1) get the connection?

    (2) can someone please give me the code?

    (3) how to engage? or the transaction AM will assign commit?

    (4) I intend to do so in the following manner, but I am getting error "getDBTransaction method not found" even if I imported all needed packages

     

      DBTransaction trans = getDBTransaction();

          CallableStatement statement = null;

          int rows = 0;   

          String plsql =

                " BEGIN "

              + " INSERT INTO EMPLOYEES "

              + " VALUES (?,?,?);"

              + " END; ";

           

          statement = trans.createCallableStatement(plsql, 3);

          try{

              statement.setInt(1, empName);

              statement.setInt(2, empId);

    statement.setInt(3, deptId); 

             rows = statement.executeUpdate();

    (5) I'm doing right thing by inserting Backing Beans? Ideally, I know we do h, but how I read AM screen values?

    All the world done this before? any help?

    Thank you

    Rahul

    Do not like that!

    I would do the following:

    -Create an entity object, then a view based on this object to insert lines.

    -Write an Application Module method that gets values that must be inserted as parameters. Get the VO, create a new line, set the values and insert the line.

    -To make this method available in the interface of the AM AM.

    -Create the binding of the method in the user interface.

    -Use this method within managed bean and run the validation using binding validation operation.

    I hope this helps.

    Kind regards

    Linda

  • How to insert in a table column

    Hi all

    How can I insert in a table column


    create table test (det varchar2 (2));

    In this table, I want to insert & symbol.

    How can I insert & inthi symbol table.


    Thank you

    Franck wrote:

    SQL>set scan off;
    SQL>insert into test values ('Add&Symbol');
    

    Sqlplus ORACLE asked not to enter the value.

    SET SCAN OFF is obsolete...

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/APC.htm

  • How to insert automatically the numbers of

    Hi friends,

    I have a table with a column sl_no create table t1 (sl_no number (10))

    I need to insert values 1-5000...
    How do I do that?
    pls help

    INSERT INTO SELECT FROM dual CONNECT BY level t1 level<>

  • How to insert along the reflow?

    Any ideas? Pretty important thing to link the words "fluid" design responsive

    It is not possible to do in reflow today. We use contentEditable 'a' when you change the text and the browser is still a regular space followed by space not breakdown model so you can get a length of spaces together, but they will always break because it's a mixture of rupture and nonbreaking spaces.

    Sorry, that the explanation is not really helping you do what you want. You can always add the nbsp at your code after you export your design.

    Thank you for using reflow,

    Chris

  • How to insert data with &amp; table...

    Hello

    I want to insert following data to the table

    SQL > insert into emp values ("company & co");

    Enter the value for co:
    How to avoid this?
    set define  off
    sql>insert into emp values('company & co');
    

    It will work

  • How to insert data into tables using sql loops

    Oracle 10.2 g

    using Oracle sql * more

    Table amounts is
    create table student(id)
    as
    select distinct student_id
    from students_table;
    now
    desc student; will retrieve 
    
    student
    ======
    Name         Null?    Type
    ===========================
    ID                  VARCHAR2(10)
    Now create a sequence
    create sequence st_seq;
    alter table student add column no;
    select * from student
    
    no       id
    =========
            234
            298
    ..........
    This is the main part

    There are 100 student in the table

    now, I want to fill the table with sequences using seq.next_val

    How to use a loop to insert 100 auto generated numbers in the table.

    Thank you.

    Expected result
    Select * from student
    
    no     id
    =========
    1     234
    2     298
    .........
    Why I'm doing this instead of
    create table student(no,id)
    as
    select st_se.nextval,student_id
    from students;
    This will cause the duplication of the upn

    using separate throws an error.
    create table student(st_id,id)
    as select distinct st_seq.nextval,academicyear
    from student
    as select distinct st_seq.nextval,academicyear
    *
    ERROR at line 2:
    ORA-02287: sequence number not allowed here
    Thank you.

    Hello

    As you discovered, you cannot use SELECT DISTINCT and sequence. NEXTVAL in the same query.

    You can SELECT DISTINCT in a subquery, like this:

    CREATE TABLE     student
    AS
    WITH     distinct_ids     AS
    (
         SELECT DISTINCT     student_id     AS id
         FROM     students_table
    )
    SELECT     st_seq.NEXTVAL     AS st_id
    ,     id
    FROM     distinct_ids;
    
  • How to insert data in table form fields

    Hai

    My problem is

    Consider this as an example

    This is a table contains fields of teas

    empcode empname, barcode, timein, timeout...

    and I created a form and retrieve data from text file, that the fields are

    barcode, bardate, bartime

    so now, I need to write code to move my data in the table. Is that my form should be moved to this table if the table is empty, then we need to insert and if it is not null then update

    I tried a logic and give me some solutions and measures to solve


    declare
    pin_no varchar2 (25);
    pin_date varchar2 (25);
    date of pin_time;



    Start
    Select * from dailyattend1 where emplcode =: bar code;


    loop


    If timein not null then
    "Update dailyattend1 set = timein: bartime where emplcode = ': bar code."
    else timein is null then
    insert into dailyattend1 (timein) values(:bartime);



    end if;
    end loop;


    commit_form();


    What are the corrections to do tell me Pls...

    Concerning

    srikkanth. M

    srikkanth,

    Check your post previous order by clause

    Kind regards

    Manu.

  • How to insert collection, no table lines?

    I need to insert rows in a table to a collection, that are not in the table. For example, if the table has lines (1,1) and collection of the rows (1,1) and (2.1), then I need to insert (2.1) in the table. Here is the configuration.
    create table dt 
    ( id1 number not null
    , id2 number not null
    , constraint dt_pk primary key ( id1, id2 )
    );
    
    create or replace type dt_ot as object
    ( id1 number
    , id2 number
    );
    /
    create or replace type dt_ntt is table of dt_ot;
    /
    
    declare
      l_dt dt_ntt := dt_ntt();
    begin
      l_dt.extend(1);
      l_dt(1) := dt_ot(1,1);
      insert into dt
      select * from table( l_dt );
    end;
    /
    declare
      l_dt dt_ntt := dt_ntt();
    begin
      l_dt.extend(2);
      l_dt(1) := dt_ot(1,1);
      l_dt(2) := dt_ot(2,1);
      insert into dt
      select * from table( l_dt );
    end;
    /
    Here, the second insert fails due to violation of primary key.

    Thank you

    Sanjeev,

    What is your version of oracle, if its 10g, you can use following example as is.

    exec dbms_errlog.create_error_log('dt');
    
    DECLARE
       l_dt   dt_ntt := dt_ntt ();
    BEGIN
       l_dt.EXTEND (2);
       l_dt (1)   := dt_ot (1, 1);
       l_dt (2)   := dt_ot (2, 1);
    
       BEGIN
          INSERT INTO dt
             SELECT *
             FROM table (l_dt)
          LOG ERRORS INTO err$_dt ('error') REJECT LIMIT UNLIMITED;
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 200));
       END;
    
       COMMIT;
    END;
    

    Concerning

  • How to insert a video caption to the current point rather than at the end of the Group

    I have two video groups

    + Subtitles

    + Videos

    I add captions to various locations along the timeline. Whenever I do it adds after the last item in this group, rather than the position of the timeline slider (which is where I want to). I then have to go to the end of this group and then drag it to the point of origin.

    Anyone knows how to insert at the current point?

    I don't think you can do it the way that you what. The place command is under the main menu: file > Place > Embedded.

  • How to insert an InlineGraphicElement beginning of line

    When I insert InlineGraphicElement it insert end of line

    How to insert at the beginning of line

    insertInlineGraphic (source:object, width:object, height:object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
    the value of Appiles to change the place of the chart online
  • How to insert data into the table of plain text stored as a CLOB in another table

    Hi people,

    Maybe it's an easy question for someone who is more frequently used files and CLOB.

    I have a table that stores text files in the CLOB column. Files text includes some basic data that I want to load in the other - a text line = a new insert for me. Is there a "trick" how to do it effectively?

    Here is my model:

    Table OS_IMPORT_DOCS, stores the complete files as CLOB
    SQL> desc OS_IMPORT_DOCS
    Name          Type           Nullable Default Comments 
    ------------- -------------- -------- ------- -------- 
    OBJECT_ID     NUMBER                                   
    DATUM_ZMENY   DATE                    sysdate          
    FILE_PATH     VARCHAR2(4000) Y                         
    FILE_NAME     VARCHAR2(4000) Y                         
    FILE_SIZE     NUMBER         Y                         
    LAST_MODIFIED DATE           Y                         
    DOCUMENT      CLOB           Y                         
    STATUS        VARCHAR2(15)   Y        'NEW'  
    Sample data from OS_IMPORT_DOCS
    SQL> select *
      2    from os_import_docs d
      3  order by d.last_modified desc
      4  ;
     
     OBJECT_ID DATUM_ZMENY FILE_PATH                      FILE_NAME       FILE_SIZE  LAST_MODIFIED DOCUMENT    STATUS
    ---------- ----------- ------------------------------ --------------- ---------- ------------- ----------- ---------------
       1815043 13.8.2012 1 d:\data\C120813.DAT            C120813.DAT          16800 13.8.2012 16: <<CLOB>>    NEW
       1815042 13.8.2012 1 d:\data\C120812.DAT            C120812.DAT           3600 12.8.2012 22: <<CLOB>>    NEW
       1815041 13.8.2012 1 d:\data\C120811.DAT            C120811.DAT           1800 11.8.2012 13: <<CLOB>>    NEW
    Example of file CLOB - stored text data (select d.document from os_import_docs d where d.object_id = 1815042 ;)
    061053120820120000AGT000002Osoby                   0000000042301000000017210632
    062322120820120000AGT000002Osoby                   0000000012301000000017197566
    063526120820120001AGT000002Osoby                   0000000012301000000017197566
    064234120820120001AGT000002Osoby                   0000000103301000000162218777
    Above the example text includes "columns" in plain text:
    timestamp - 1-14, SSMIHH24DDMMYYYY position format
    flag - post 15-18
    company code - position 19-27
    etc...

    How can I query data stored within the OS_IMPORT_DOCS. The DOCUMENT column, divide it into columns and insert into another table?
    I have to read this method of 'online' file?


    Thank you very much
    Tomas

    For the first three columns:

    SQL> create type TRecord is object (
      2    ts           timestamp
      3  , flag         varchar2(4)
      4  , company_code varchar2(9)
      5  );
      6  /
    
    Type created
    
    SQL>
    SQL> create type TRecordTable is table of TRecord;
      2  /
    
    Type created
    
    SQL>
    SQL> create or replace function parse_clob (p_doc in clob)
      2  return TRecordTable pipelined
      3  is
      4    lf      number;
      5    eol     varchar2(2) := chr(10);
      6    eollen  number := length(eol);
      7    line    varchar2(32767);
      8    offs    number := 1;
      9  begin
     10    loop
     11      lf := dbms_lob.instr(p_doc, eol, offs);
     12      if lf != 0 then
     13        line := dbms_lob.substr(p_doc, lf - offs + 1 - eollen, offs);
     14        offs := lf + eollen;
     15      else
     16        line := dbms_lob.substr(p_doc, dbms_lob.getlength(p_doc) - offs + 1, offs);
     17      end if;
     18      pipe row (
     19        TRecord(
     20          to_timestamp(substr(line, 1, 14), 'HH24MISSDDMMYYYY')
     21        , substr(line, 15, 4)
     22        , substr(line, 19, 9)
     23        )
     24      );
     25      exit when lf = 0;
     26    end loop;
     27  end;
     28  /
    
    Function created
    
    SQL>
    SQL> select t.*
      2  from os_import_docs d
      3     , table(parse_clob(d.document)) t
      4  where d.object_id = 1815042;
    
    TS                                     FLAG COMPANY_CODE
    -------------------------------------- ---- ------------
    12/08/12 06:10:53,000000               0000 AGT000002
    12/08/12 06:23:22,000000               0000 AGT000002
    12/08/12 06:35:26,000000               0001 AGT000002
    12/08/12 06:42:34,000000               0001 AGT000002
     
    

Maybe you are looking for

  • Binds the data object graph, causing memory

    Hello I want to create a WPF application that uses Measurement Studio to display the data points on the graph. We have already implemented a HAL, the data in the reports of the UI (after a few manipulations), using the DAQmx. I saw in your examples y

  • Lab View FTP Put file

    Hello I am trying to use the FTP put file VI to get the images out of my smart camera of NEITHER and I can't just not work, and I have no idea what I'm doing wrong. I use FileZilla Server as FTP server on my host PC. The images are saved in the folde

  • Vista - Service Pack 2 won't install and I tried everything.

    Hello I am new to the Forum and its nice to meet you all. I have a question about my Service Pack 2 to my Windows Vista 64 bit, not wanting to download. I tried follow these tips to make it work and I also tried to re download from different sites. I

  • How do I encrypt my e-mail individual Marshall hotmail?

    How do encrypt me individual e-mail on hotmail?

  • Wireless connections do not appear in the network connections

    Running XP Home Edition with Service Pack 3.  Setup new rounter wireless.  Went to the Panel of control/NetworkConnections.  The LAN network icon is there, but no icon of wireless networks.  Is on a MacBook Pro running XP in Parallels and there is no