How to copy columns from one table to another

Hai All


How to copy the contents of the array to another

For example, first name of the table is T1 and I have 10 columns and data are here and I need to create a table T2

But I don't need the header, but not the values of all the 10 columns of T1 to T2, but not values


Thanks and greetings

Srikkanth.M

Why not?

create table test1
as
   select * from emp
   where 1 = 2;

Kind regards.

LOULOU.

Tags: Database

Similar Questions

  • Shutter button to copy records from one table to another;  ORA-04091:

    Hello

    I am trying to create a trigger that will move data from one table to the other.

    I have two tables (Trial1, Trial2) two of them contains the same attributes (code, c_index)

    I want to spend each new record inserted in (code Trial1) (code in Trial2)

    It's my trigger:
    Create or replace trigger trg_move_to_trial2
    After Insert on Trial1
    for each row
    Start
    insert into Trial2 (code)
    Select: new.code of Trial1;
    end;
    He compiled, but when I insert a new record (the code) in (Trial1), it shows this error:
    Error report:
    SQL error: ORA-04091: table STU101. TRIAL1 is changing, function of triggering/can not see
    ORA-06512: at "STU101. TRG_MOVE_TO_TRIAL2', line 3
    ORA-04088: error during execution of trigger ' STU101. TRG_MOVE_TO_TRIAL2'
    04091 00000 - "table %s.%s is changing, function of triggering/can not see.
    * Cause: A trigger (or plsql user-defined function that is referenced in)
    This statement) attempted to watch (or modify) a table that has been
    in the Middle being modified by the statement that shot.
    * Action: Rewrite the trigger (or function) so it does not read this table.
    I know matter what it means error, but I did not how to fix the error.

    ..................................................................................................

    I tried to change the (insert after on Trial1) before (insert on Trial1); It worked, but not in a good way. When I insert value in (code Trial1) new and refreshed Trial2 table, just as much as the records I have 2 test they will be duplicated. For example
    Trial2
    code
    111
    222
    333
    when I insert in Trial1
    Trial1
    code
    444
    Trial2 will be:
    code
    111
    222
    333
    444
    444
    444
    can you please tell me how to fix this?

    Kind regards

    Published by: 1002059 on April 23, 2013 17:36

    You should not select Trial1 - you already have data. Simply insert this value.

    Create or replace trigger trg_move_to_trial2
    After insert on Trial1
    for each row
    
    begin
    
    insert into Trial2 (code)
    values (:new.code);
    
    end; 
    

    Kind regards
    David

  • Correspondence of the columns from one table to another

    I have a database column that contains the name of a person. I have another table that has a column that contains the names separated by a comma.

    I want to match records where all records of two columns have a corresponding name. I tried this:

    < cfquery name = "MyQuery" datasource = "myds" >

    SELECT *.

    OF TBL_A

    WHERE TBL_A.customername IN (#DifferentQuery.ListOfNames #)

    < / cfquery >

    Everything that I try results in only get a recording. Basically, I want to get all records from a table where one of its columns contains the name of a column in another table.

    It's a many-to-many relationship. That is to say an editorial can be linked to many ads, and vice versa.  He is best represented with three tables. Such as:

    Table: [Editorial] column: [EditorialID (PK), EditorialText,...]

    Table: Columns of the [advertiser]: [AdvertiserID (PK), AdvertiserName]

    Table:   [Editorial_Advertisers] columns: [EditorialID, AdvertiserID]

    The name of the advertiser throw himself into a column...

    my client can decide which ads get related to which editorials

    The third table stores the relationship between ads and editorials.  So instead of storing a list of advertisers, you need to insert record for each EditorialID + AdvertiserID combination. You can then use joins to retrieve all the advertisements for EditorialID 123.

    SELECT  a.AdvertiserName
    FROM     Editorial_Advertiser ea INNER JOIN Advertiser a ON ea.AdvertiserID = a.AdvertiserID
    WHERE   ea.EditorialID = 123
    
  • Copy columns from one Table to the other with PL/SQL in Apex

    So my goal long-term is to throw this PL/SQL statement in a trial DMBS_SCHEDULER Apex 4.1 to create historical snapshots of the data a week but I'm hooked on this code:

    declare
    V_DEKIT_ID varchar (255);
    V_NT varchar (255);
    Number to resume;
    Date of V_DDATE;

    Start
    for DEKIT_ID in (select * from DKT_HIST)

    loop

    Select DEKIT. DEKIT_ID in V_DEKIT_ID of DEKIT;
    Select DEKIT. NT in DEKIT V_NT;
    Select DEKIT. QUANTITY back of DEKIT;
    Select CURRENT_DATE in double V_DDATE;

    insert into DKT_HIST (DEKIT_ID, NT, QUANTITY, DDATE)
    values (V_DEKIT_ID, V_NT, V_QUANTITY, V_DDATE);
    end loop;

    end;

    I enter this code in the SQL prompt in the SQL workshop and it is said that she is treated, but when I look at the destination table (DKT_HIST), there is no data. Any help would be appreciated.  In this code I want to copy the three columns of the DEKIT table as well as the current date and copy them to DKT_HIST for each row in the table DEKIT.

    Thank you

    -Steve

    The reason why your code did nothing is probably because your loop, using the history table. And since there no data in the historical table first, there is nothing to loop.

    BUT!

    Good code is the task with the least possible effort. Which in your case should result in a code similar to this:

    begin
       insert into DKT_HIST (DEKIT_ID,NT,QUANTITY,DDATE)
       select DEKIT_ID,NT,QUANTITY, trunc(sysdate)
       from DEKIT;
    end;
    
  • transfer of some columns from one table to another table...?

    I had 2 table... .one is PAYMAST n other TBL... In PEXMAST & TBL 10 collar each, I had and I want to transfer 4 columns of TBL to PEXMAST...

    How do I do this. ???

    A table must be regarded as line and column.

    When you say a column, it should be associated with a line.

    Here is an example

    Let's say I have two table T1 (ID, NAME) and T2 (ID, Name1)

    Now if I say I want to spend for T2 T1 name1, what I will do?

    1 create a column name1 in T1.

    alter table t1 add name1 varchar2(50)
    

    2. put up-to-date T1 by joining T1.ID and T2.ID like that.

    update t1
       set t1.name1 = (select t2.name1 from t2 where t2.id = t1.id)
    

    As you can see you need a column ID to define the relationships between the two table T1 and T2. If you have one, you can do the same with yours.

  • How to copy photos from one HD to another

    Noticed that my 10 000 entire iPhoto library is stored only on one of the three external HD that I have - and not on my Mac itself.  How can I copy / duplicate the library on another HD so that I have a backup?  Thanks in advance.

    Click the source, use the command + C to copy, select the destination, and then command + V to paste. However if you back up your computer using Time Machine you probably already have at least 1 backup. It's a good idea to have redundant backups, but you can use the copy and paste the solution in addition to using Time Machine.

  • How replicates all records from one table to another table without using expdp, impdp

    Hi I have two database in a database, that I have a table called t1 and another base data, I have the second table .so, my first table have records, that I need to transfer all records second T2 without use of expdp and impdp in every 5 min... what I do

    ??

    The best solution for this scenario is to use Oracle Golden Gate

    However, it requires a license, and you must pay for it.

    If this is not possible, you can create a job scheduler that uses a link DB in order to reproduce the recordings of the target database, but it will take the entire table to the target database and then INSERT AS SELECT truncate the data of the entire table every time that the job is running (because you can't follow only the records that have been changed or modified).

    In addition, read here on the replication of data using materialized views.

  • How to transfer files from one user to another in Windows Vista?

    How to transfer files from one user to another under Vista?

    How to transfer files from one user to another under Vista?

    A simple way is to move the file to the Public folder.
    Public folder is accessible by all users.

    How...
    Right click on the file > click Move To > navigate to the Public folder > click on move.

    If you do not Move To option in your right click context Menu, here is the tutorial...
    http://www.Vistax64.com/tutorials/89196-context-menu-add-copy-folder-move-folder.html

    Use an easier method.

    PS you can also use methiod drag-and-drop rather than pass to the method. I prefer the latter.

  • Copy data from one schema to another. Reopen the Question

    Hello

    I had asked this question earlier to copy data from tables of one schema to another in the same database using the database link. In my previous post have mentioned below.
    Re: copy data from one schema to another.
    Now I am faced with the question for the remote copy of database

    I have created a DB connection between my local system and the remote database. with the chain of connection as shown below
    CREATE THE DATABASE PUBLIC LINK "MERU_DEV_LOCAL_DEV".
    CONNECT TO MERUDEV IDENTIFIED BY MERUDEV WITH THE HELP OF "MERUPROD";
    In the above script
    LOCAL DEVELOPMENT scheme IS
    REMOTE schema is MERUDEV
    I try to copy remote database to my local database tables using the script below.
    network_link DEVELOPMENT impdp = schema MERU_DEV_LOCAL_DEV = MERUDEV remap_schema = MERUDEV:DEVELOPMENT TABLE_EXISTS_ACTION = REPLACE
    But the copy of the table does not occur. What could be the problem? Please suggest me or do I need to modify the script

    Thank you
    Sudhir

    You can:
    -monitor the BONE with ps - ef
    -monitor data pump: jobs are dba_datapump_jobs and dba_datapump_sessions
    -monitor with logops: v$ session_longops

  • copy data from one database to another

    Hello

    I want to copy data from one database to another.

    I have two patterns such as

    dev1/dev@ORCL
    DEV2/dev@DCEL


    I have same tables dev1 and dev2 (tables)
    but I have not given in dev2 (tables).
    now, I want to copy dev1 (tables) in dev2 (tables).

    You can also use the database link:

    select * from dev1.emp@orcl;
    

    What database are you connected to?
    You must create and use the links in the database for all other databases.

    For example if you are connected to the database A and to retrieve data from database B, you must create a connection of database in base B

    create database link B connect to  identified by  using 'B';
    

    Then you can retrieve data from database B with

    select * from [yourschema.]yourtable@B;
    

    This will work only for tables that are visible to the user that you used in the definition of database link.

    Published by: hm on 10.08.2011 22:15

  • How to migrate code from one environment to another in the MFT 12 c

    Hi all

    How to migrate code from one environment to another in the MFT 12 c.

    Thank you and best regards,

    Tilquin.

    MFT has t2p plugin that can be used to migrate the metadata for production test.

    There is an export option in the transfer page in the MFT UI that can be used to export metadata data transfer.

    This exported zip can be imported in any other environment after making the necessary changes.

  • When I copy something from one page to another, it seems to change text color or background, that I do not understand why he never used to do.

    When I copy something from one page to another, it seems to change text color or background, that I do not understand why he never used to do.

    Whether it's text or only a shape it changes its color to something else when I copy and paste on.

    Do you mean 'page' or 'site '?

    If you copy something from another site, the reason may be, to have different, but all also named colours on each site.

    It would be normal and causes the noticed effect.

  • How to transfer acrobat from one PC to another? I do not have the license # and CD on hand.

    How to transfer acrobat from one PC to another? I do not have the license # and CD on hand.

    You need to install. You will need these things.

  • Copy sheets from one workbook to another

    Hello
    Is it possible to copy sheets from one workbook to another in the same sector of activity? (discoverer more 10g v 10.1.2.55.26)
    Thank you
    Select this option.

    Hello
    It is not possible to use the most.
    It is possible to do so using the Discoverer Desktop edition.

    with office, follow these steps:
    1. connect to the discoverer desktop computer and open the workbook you want to copy from.
    2. open the workbook you want to copy.
    3. While both are open, press the "Restore down" button in the upper right area of the worksheet. (the Center button of the 3 to minimize, restore down, and close).
    4. now change the size of windows so that you will be able to see two worksheets side by side 1.
    5. place the mouse on the name of the new worksheet, press left click and drag the worksheet in the second workbook.

    You move the worksheet from one to the other, if you copy the worksheet to another workbook, and then before you start duplicate the worksheet and accomplish the foregoing on the duplicated worksheet.

    Tamir

  • Copy from one table to another

    Is there a simple way to copy/add all the records from one table to a master table?

    INSERT INTO master_table (Field1, Field2, field3)
    SELECT field1, Field2, field3
    From other_table
    WHERE everything what

    If the data types, order and the column names are the same for both tables, then it would also work to copy all other_table lines in master_table:

    INSERT INTO master_table
    SELECT *.
    From other_table

    Phil

Maybe you are looking for

  • j k flip

    HelloI'm trying to built a flop flip j k as below with on the clock I always get an unstable state I'm looking for in nor I found a few j k flip.vi but it complex I find that the shift register both initially run fake and wrong in sequential logic, t

  • I have an Aspire V17 Nitro (VN7 - 791 G-72MY). Slow startup

    For the last 6 weeks, the time taken to show the ACER screen then screen password W10 is taken longer and longer. This morning 25 mins toget screen Acer showed. Anything appearing in the bios to explain it and when she started the machine runs all te

  • HP 2000: System disabled need BIOS password

    Laptop HP 2000 I forgot the bios password System off and get [97082565] Help, please!  Thanks a lot for your time!

  • Upgrade Windows 8 / / Touchpad doesn't work is not right - Acer Aspire V5 - 531

    Hello Ive upgraded to Win 7 Home Premium to Win 8 Pro using the Acer Windows 8 Upgrade Tool everything was completed with success not at all last night but today Ive turned on the laptop and my touchpad does not work well and the cursor acts as if so

  • Error code: 80070017 (cannot install updates)

    OK so I tried to fix my computer grandfathers for the last three days and he repeated to me that there are 2 important updates but I'm trying to install and a code 80070017 error keeps popping until I do?