Add constraint to the new table

Hello

can someone give me please an idea on this subject?
I created a table to an existing table, how do I add the constraint imposed on the old table newly created table?








Thank you.
Madam.

Hello

If you create a new table using DEC, then he wouldn't copy the old table to the new table constraints.
Some of these options, you can use.
(1) using dbms_metadata for the ddl for all dependent objects on the old table and run against the new table after you change the name of the table name/object.
(2) use imp/exp or impdp/expdp without data to copy the table and dependent objects such as constraints.

Concerning
Anurag Tibrewal.

Tags: Database

Similar Questions

  • steps to create the new table using existing metadata

    Hi all


    That's what I want to achieve,

    I want to create a procedure that will take an input parameter as a table name lets say 'EMP ',.
    This procedure checks if this table exists or not?
    If they don't exist
    It will create a new table with the name _dummy join the existing table name (ex: new table will be EMP_DUMMY).
    and new table should have the same structure of the table, indexes, and constraints on the EMP table.


    NB: It should not be created using select as create table EMP_DUMMY select * from EMP where = condition false;



    Can someone help me please how to achieve this?

    Please, don't post duplicate discussions.

    Check your thread previous stored procedure to create a new table with the existing table structure to further discussions

  • Add bookmark to the new tab does not

    I was trying to understand how to add elements to the "new tab" page in the latest version of mozilla. This latest version, on the new tab page (hit the + tab), my shortcuts are missing but three and they are images all much larger than before.

    When I click on the Hardware tab in the browser, nothing happens. SO I can't switch to classic, empty or improved.

    When I followed the instructions of mozilla for the bookmark, click Show all and try to drag in the new tab page and the rejection, the brand book opens in a new tab instead of create a new shortcut on the new tab. That's what I'm doing: add my favorites back to the new tab page. I use it all the time. Help!

    Hello

    Don't know that if that answers your question, but with the latest update of Firefox, the number of tiles is now determined on the size of the screen - if zoom you or enlarge the window you have several tiles appear.

    If you want to set a fixed number of tiles, I believe you can do it with the following extensions:

    You can also see jscher2000's Solution here: https://support.mozilla.org/en-US/questions/1025414
    It requires the add-on from the elegant but will decrease automatically the tiles on the page:

    With more tiles, you might be able to add your bookmarks in them. I think that you must drag your bookmark in a cage for her to pin on the tile, or between tiles.

  • How to extract 1 ASA and put them in the new table

    Hello

    Can someone tell me how to extract a table and put in the new table. (eg. I have a table with no 1 to 1000, I would extract only 1, 30, 60, 90,...)  ?

    Please advise me.

    Thank you

    concerning


  • I just got a new supplier of cable installed at home and now we find that our usual printer print wireless. How can I add this to the new network?

    I just had a new supplier of cable installed at home and now we recognize that our habit of printing wireless printer, how can I add this to the new network?

    Hello

    • What is the brand and model of the printer?
    • What happens when you try to print?
    • You receive an error message?

    You can view these methods:

    Method 1:

    Disable the firewall and check.

    The Windows Firewall is enabled by default in this version of Windows. To make sure that it has not been disabled, follow these steps:

    1. open the Windows Firewall by clicking the Start button, then Control Panel. In the search box, type firewall and then click onWindows Firewall.

    2. in the left pane, click turn Windows Firewall on or off. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    3. below for each type of network location, click on disable Windows Firewall, and then clickOK. We recommend that you turn on the firewall for all network location types.

    For more information, visit the following link:

    http://Windows.Microsoft.com/en-us/Windows7/Understanding-Windows-Firewall-settings

    Note: Run the computer without antivirus software or firewall is a potential threat to the computer; Be sure to activate security software after completing the troubleshooting steps and after identifying the problem.

    Method 2:

    Printer in Windows problems

    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

    See also:

    http://Windows.Microsoft.com/en-us/Windows7/install-a-printer-on-a-home-network

  • How you add cash for the new Portfolio Manager?

    How can you add cash for the new Portfolio Manager. It is not MSN Money application is simply Money Portfolio Manager.

    Hi Thirualluvar,

    Who is the manufacturer of the application of Portfolio Manager?

    Microsoft, the Portfolio Manager application is Microsoft Money 2008. If you use the same, you can contact Microsoft Money technical support for assistance.
    http://support.Microsoft.com/ph/870/en-us#TAB4

    Hope the helps of information. Please post back and we do know.

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

  • Setting or drop the synonym of synonym for the new table access

    Hello

    Using oracle 11.2.0.3 and we have the suite requirement.

    New, we build a summary table to replace an older.

    Currently reports access a synonymn which in turn accesses the table of old_summary.

    Once built, we would like to change the synonym to point to the new table, ideally with no interruption of service.

    The only thing that could potentially access these synonyms when change is synonymous with points table select stattements.

    Pu questions.

    (1) can you change table points synonym of without deletion and recreation?


    (2) what happens if have a sysnonym of race and drop of select statement to re-create.  It runs until the end sysnonym fact existed early in the race?

    Thank you

    1)  Can you change table synonym points to without dropping and recreating?
    

    He has not ALTER statement for synonyms. As I said the other answering machine use CREATE or REPLACE.

    2)  What happens if have a select statment running and drop sysnonym the recreate.  Does it run to completion fact sysnonym existed at start of running?
    

    All object references are resolved BEFORE the implementation phase. Once a statement begins executing, it is immaterial that the same is a synonym.

  • How to create the new table by using the pertioned table

    Hello
    I use a partitioned table, now I want CPDR a new table with the same structure of my existing partitioned table.
    so can I use this syntax

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    If I use this syntax, he would do the same my existing partitioned table structure?

    and

    When
    We use a syntax such as

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    so he would also make the indexing on the new table if old table exists? If this isn't the case, then how can we create this indexing too at the time of execution of this syntax?


    regards

    N °

    Although the command would create a new table with the same column names and data types, it is NOT a partitioned table. You must explicitly specify the PARTITION BY clause and definitions of Partition when creating the table.

    Similarly, index definitions are not automatically copied. You must explicitly run the CREATE INDEX statements (which you can generate source using DBMS_METADATA. GET_DDL or by using any other tools/utilities).

    (However, if you use Export-Import - for example import to another schema, or to another database, it would create a table partitoned bearing the same name and with the same index definitions).

    Hemant K Collette

  • Cannot add screenshots on the new portal

    Does anyone have the same problem? I see in chrome, it tries to download but love up to 30%, it refreshes the page just then said 'Updated successfully, etc.' but the new screenshtos have been added. I have only 1 screenshot added so far like the last month and I just want to add another 1. total of 2.

    Hi nemory,.

    Leave the page for a few minutes before sending/backup. It could be a problem with the size of the images that you want to download and that they are not quite finished, even if the page says they are.

    Let me know if it works.

    Bryan Van Engelen

    BlackBerry World

  • Create a Trigger - what is the name of the new table?

    Hello

    I want to implement a new trigger (CREATE TABLE) on my database only for specific tables in a table space.
    As far as I know, I have to set the trigger for the entire database and filter tables in the trigger to
    that I want to do any action.

    It's my first try:

    CREATE OR REPLACE TRIGGER compress_new_tables
    AFTER CREATE ON THE DATABASE
    BEGIN
    dbms_output.put_line ("' new Table name");
    END;
    /

    Unfortunately I do not know how to determine the user as well as the name of the table that was created.
    Could someone help please?

    Py wrote:
    Hello

    I want to implement a new trigger (CREATE TABLE) on my database only for specific tables in a table space.
    As far as I know, I have to set the trigger for the entire database and filter tables in the trigger to
    that I want to do any action.

    It's my first try:

    CREATE OR REPLACE TRIGGER compress_new_tables
    AFTER CREATE ON THE DATABASE
    BEGIN
    dbms_output.put_line ("' new Table name");
    END;
    /

    Unfortunately I do not know how to determine the user as well as the name of the table that was created.
    Could someone help please?

    http://www.morganslibrary.org/reference/ddl_trigger.html

  • Insert in the new table if the row update SQL

    Guy
    If I have an update statement that I would like to keep track of wich ranks where actually updates how could I do? Here is what im tryin to acomplishe, I want to update a table column and if this line is put on day of my update statement I would like to insert a new table. Is this possible to do with plain ol' sql? or should I use plsql.

    an example would be great if someone would guide me on this one.
    CREATE TABLE "TEMPLE_FINANCE"."FWICNCL"
      (
        "FWICNCL_INVOICE"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
        "FWICNCL_CANCEL_USER" VARCHAR2(60 CHAR) NOT NULL ENABLE
      )
    Insert into FWICNCL (FWICNCL_INVOICE,FWICNCL_CANCEL_USER) values ('I0003711','L_BANNER');
    Insert into FWICNCL (FWICNCL_INVOICE,FWICNCL_CANCEL_USER) values ('I0003710','L_BANNER');
    -My update statement wich I have in a procedure. Note that at this point I would insert each record in fobappd anything. I just want to insert the fwicncl records that actually fit and updated fabinvh.


    UPDATE FABINVH 
    SET FABINVH_CANCEL_IND = 'N',
    FABINVH_CANCEL_DATE = TRUNC(SYSDATE),
    FABINVH_CANCEL_USER = (SELECT fwicncl_cancel_user FROM FWICNCL WHERE FABINVH_CODE = fwicncl_INVOICE),
    FABINVH_CANCEL_ACTIVITY_DATE = trunc(SYSDATE)
    WHERE EXISTS 
    (SELECT fwicncl_INVOICE
          FROM FWICNCL 
          WHERE FABINVH_CODE = fwicncl_INVOICE);
    COMMIT;
    
    
        INSERT INTO FOBAPPD (FOBAPPD_SEQ_CODE,
                         FOBAPPD_DOC_NUM,
                         FOBAPPD_ACTIVITY_DATE)
        (SELECT '3', fwicncl_INVOICE, TRUNC(SYSDATE) FROM  FWICNCL);
          COMMIT;
    Thank you for your help in advance.

    Well, you can use the RETURN clause IN the UPDATE statement to get all of the values that must be returned to a collection.

    Refer to the RETURN clause IN the PL/SQL user's Guide

    http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14261/returninginto_clause.htm

    The bottom of the page has links to examples that show how to do this. This is one of the examples.

    Example 7-6 Dynamic SQL Inside FORALL Statement
    
    DECLARE
       TYPE NumList IS TABLE OF NUMBER;
       TYPE NameList IS TABLE OF VARCHAR2(15);
       empids NumList;
       enames NameList;
    BEGIN
       empids := NumList(101,102,103,104,105);
       FORALL i IN 1..5
          EXECUTE IMMEDIATE
            'UPDATE employees SET salary = salary * 1.04 WHERE employee_id = :1
             RETURNING last_name INTO :2'
             USING empids(i) RETURNING BULK COLLECT INTO enames;
    END;
    /
    
  • Create the new table with the new calculated entries

    Hello
    I had a little problem.
    I have a table which includes the employee vacation time. Vacation time was periodic, so I divide them into days. Now, I want to calculate the exact days. Sometimes ago weekends included I need to subtract. I have flaged everyday, I know exactly what day is a business day and that one is not. Is it possible that I have only the sum of the days without weekends?

    Table Vacation_Times:

    EMPL - V_Start_D - V_End_D - Date-day - D_Name
    Mr.A---01.05.11---06.05.11---01.05.11---6---mercredi
    M.-a---01.05.11---06.06.11---02.05.11---6---jeudi
    Mr.A---01.05.11---06.05.11---03.05.11---6---vendredi
    M.-a---01.05.11---06.06.11---04.05.11---6---Samedi
    Mr.A---01.05.11---06.05.11---05.05.11---6---dimanche
    M.-a---01.05.11---06.06.11---06.05.11---6---Lundi

    NEW table:

    EMPL - V_Start_D - V_End_D - Date-day - D_Name - Actual_Days
    Mr.A---01.05.11---06.05.11---01.05.11---6---mercredi---4
    M.-a---01.05.11---06.06.11---02.05.11---6---jeudi---4
    Mr.A---01.05.11---06.05.11---03.05.11---6---vendredi---4
    M.-a---01.05.11---06.06.11---04.05.11---6---Samedi---4
    Mr.A---01.05.11---06.05.11---05.05.11---6---dimanche---4
    M.-a---01.05.11---06.06.11---06.05.11---6---Lundi---4


    THX

    Hello

    VR;

    SELECT Empl ,V_Start_D ,V_End_D ,Date ,Days ,D_Name , count(*) as Actual_Days
    FROM vacation v
    JOIN datelist d ON d.day between  V_Start_D and V_End_D and d.is_working_day='Y'
    GROUP BY Empl ,V_Start_D ,V_End_D ,Date ,Days ,D_Name 
    

    Kind regards
    Carsten.

  • Add records in the target table

    Hi all
    I HAV done an interface for a simple source data transfer to the target. When I run it, the records are stored in the target table. Now, I want to launch the interface (for the same or different source table) and add the records to existing records in the target table.

    Kindly guide me, explaining how shud I do the addition in the target table.

    Thanks in advance.

    Hello

    You can use the IKM control add... it will add records...

    Thank you.

  • Copy data from one table to the new table

    Hello

    I copy data from columns of a table to another table and my query is
    INSERT INTO TestTable (empno, empName, deptno)
    SELECT empno, empname, deptno
    WCP

    and it works fine but I want to insert a data column in testTable based on emp.deptno
    as if emp.deptno = 10 it will add 1 to the testtable.class column,
    If emp.deptno = 20 it will add 2-column testtable.class,
    If deptno = 30 it will add 3 to the testtable.class column,


    TestTable structure is
    EMPNO NUMBER (20)
    ENAME VARCHAR2 (50)
    DEPTNO NUMBER (20)
    CLASS NUMBER (20)

    Can someone please help me write this procedure.
    Thank you

    You can use a case statement as

    INSERT INTO TestTable (empno, empName,deptno,class_column )
    SELECT empno, empname,deptno, case when emp.deptno=10  then 1
                                       when emp.deptno=20  then 2
                                       when emp.deptno=30  then 3
                                  end
    FROM emp
    

    See you soon
    Katia

  • Oracle9i Exim - user ID are different in the new table dba_users

    We did an export to a new database. Users in the base of the 'new' got assigned to different ID in the dba users table. We have an application that depends on the user ID, so when he did a search, the user ID has pointed out various user names. Is it possible to have import assign the same user ID as the original db IIN? If this is not the case, the user ID can be changed manually so they correspond to the "correct" the original users? Thank you.

    The value of user_id is used internally by Oracle to manage information in the data dictionary in the same way that object_id is. It should not be invoked by the activity of the application that you do not control the way in which it is created - you may not use the object_id to refer to a table, so why would you want to do with a user. Apart from anything else, if you are using this for an audit trail, what happens when the user is deleted?

    An import works normal syntax of create user and the user_id is not specified - Oracle will be chosen the value because it creates the folder.

    The only way to ensure the same ID values is to clone the source database, rather than using export/import. However, a better solution would be to create user data in a table separate app as well using id values of a table that you can control.

Maybe you are looking for