Need to create a new line in the table with the same data as the primary key, but new PK

Hello gurus,

I have a table with a column as a primary key, I need to create a new row in the table, but with the same data in one of the lines, but with different primary keys, focus a double row with key primary diferent...

Any ideas of how it can be done without much complication?

Thanks in advance for your answer.

Agress,
Karim idrissi

user9970447 wrote:
Hello gurus,

I have a table with a column as a primary key, I need to create a new row in the table, but with the same data in one of the lines, but with different primary keys, focus a double row with key primary diferent...

Any ideas of how it can be done without much complication?

Thanks in advance for your answer.

Agress,
Karim idrissi

something like

insert into mytable values ('literal for new pk',
                                       select non-pk-1,
                                                non-pk-2,
                                                non-pk-n
                                       from mytable
                                       where pk-col = 'literal for existing pk')

Tags: Database

Similar Questions

  • I need to reinstall vista. I have the product key but no cd.dvd. where can I get the vista op sys to load?

    I need a vista clean reinstallationof. I jave an Acer laptop and I have the key product for the vista operating system installed which has completely disappeared. How can I get a copy of vista to reinstall?

    Hello

    See if you have a Recovery Partition of Acer.

    http://Acer.custhelp.com/app/answers/detail/A_ID/2631

    There is no Windows Vista downloads available from Microsoft.

    You can contact your computer manufacturer and ask them to send you a set of recovery disks.

    They should do this for a small fee.

    Some manufacturers have more available Vista recovery disks.

    If this happens, you may need to try this instead:

    You can also borrow and use a Microsoft Vista DVD, which contains the files for the different editions of Vista (Home Basic, Home Premium, Business and Ultimate) must be installed. The product key on your computer / Laptop box determines what Edition is installed.

    Other manufacturers recovery DVDs are should not be used for this purpose.

    And you need to know the version of 'bit' for Vista, as 32-bit and 64-bit editions come on different DVDs

    Here's how to do a clean install of Vista using a DVD of Vista from Microsoft:

    "How to do a clean install and configure with a full Version of Vista '

    http://www.Vistax64.com/tutorials/117366-clean-install-full-version-Vista.html

    And once the operating system is installed, go to your computer manufacturer's website and get the latest drivers for your particular model or laptop computer.

    And phone Activation may be necessary when you use the above installation method.

    "How to activate Vista normally and by Activation of the phone '

    http://www.Vistax64.com/tutorials/84488-activate-Vista-phone.html

    See you soon.

  • How to extract the values of the line full in the bean to support using the primary key

    Hello

    I have a table that has columns as plant_name, business planner email id and identification of email resident engineer. Here, Plant_name is the primary key.

    Now, I have this plant's name slipped and dropped like selectonechoice (drop) on page jsff. In this user can select any name of 1 plant drop down.

    Right now, I can go get plant in backing bean name, but I can't understand how business plan for extraction and identification of email of the engineer resident in this key primary-plant_name at the bean to support.

    Please let me know if anyone has an idea in this regard.

    JDeveloper version 11.1.1.6.0

    Thanks in advance.

    Sneha

    Sneha211 wrote:

    On the jsff page

    required = "#{bindings." Plant.hints.Mandatory}.

    shortDesc = "#{bindings." Plant.hints.ToolTip}.

    ID = "soc1" unselectedLabel = "- Select -"

    autoSubmit = 'true '.

    Binding = "#{backingBeanScope.backingbean.plantbean}" > "

    ID = "si1" / >

    In backing bean

    DCBindingContainer = lBindingContainer

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding lBinding = lBindingContainer.findIteratorBinding("SupplierVO1Iterator");

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    Hi Sneha, you've written code for it

    you have found the current line and the primary key then this line, then why you not not using this same rank to get the other attributes?

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    String businessPalnner = (String) newRow.getAttribute ("business_planner"); Returns the value of the same line

    Engineer in String = (String) newRow.getAttribute ("engineer");


    OR if your condition is like that-

    you have a primary key field value, but you do not have the corresponding line, then you can get that line and it's attribute by using the primary key value

    See - http://adfgouravtkiet.blogspot.in/2012/10/filtering-of-data-from-vo.html

    Hope it helps

    -Ashish

  • The index of the primary key in a different tablespace.

    Hello

    I have a user PROD. It has received a tablespace PROD_TBS default.
    There is a separate table for all indexes space in the diagram, PROD_IDX.

    I want to create a TEST table as follows,

    CREATE TABLE TEST
    (TEST_ID, NUMBER (1),)
    NAME VARCHAR2 (10));

    It must be a primary key on the column test_id, but such that the corresponding unique index created by default because of the primary key must be created in the PROD_IDX tablespace.

    How to do this?

    Alternative solution:

    CREATE TABLE TEST
    (TEST_ID NUMBER(1),
    NAME VARCHAR2 (10),
    constraint test_pk primary key (test_id)
    using index tablespace prod_idx
     );
    

    Cheers, APC

    blog: http://radiofreetooting.blogspot.com

  • have forgotten the administrative password and the need to create a new

    have forgotten the administrative password and the need to create a new, but without knowing an old failed to create a new

    your options are explained here

    Change or reset the password of a user account from OS X - Apple support

  • TB 31.5.0 Win 7 after the TAB key for the automatic update no longer creates new address line "write" (enter the done key) but I want the TAB key! Why this keep happening after

    TB 31.5.0 Win 7 after the TAB key for the automatic update no longer creates new address line "write" (enter the done key) but I want the TAB key! Why is - this seems to happen after each automatic update? Cant we get 'option' to use the TAB key to navigate through the lines of address "write"?

    TAB through the fields that exist. It is the function of the TAB.

    Otherwise you could never use TAB to go out in a field for example: subject. It would create an indefinate number of fields and are unable to function as a TAB key.

    TAB does not back to THE fields,
    New crests to THE fields or donkey typing/selection enter/return address, you can use the selection of mouse click.

  • Lightroom 6.5 questions, I need to create a new administrator to run the program.

    Lightroom 6.5 questions, I need to create a new administrator to run the program. But I want to use the same, instead of move or copy everything on the new account.

    Please refer to the below link for troubleshooting.

    Solutions to the Lightroom error problems of user permissions

    Kind regards

    Mohit

  • I created an admin password, but when I restart my computer, I can connect without password and I need to create a new admin password each time

    I created an admin password, but when I restart my computer, I can connect without password and I need to create a new admin password each time

    Open a high command prompt, and then type these commands:

    NET user "user %%nom" | more

    (to check when you change changed your password)

    NET user "user %%nom" 123456

    (to change your password to 123456)

    Now, restart Windows and check if the problem persists.

  • I'm looking for a javascriptor for photoshop. I need to create conditional actions according to the decimal ratio.  Thank you

    I'm looking for a javascriptor for photoshop. I need to create conditional actions according to the decimal ratio.  Thank you

    You can find us an if-else for this statement. You can put the reports what ever you want:

    #target photoshop
    var doc = activeDocument;
    var ratio = parseFloat(doc.width/doc.height);
    if(ratio<.25){//enter code here to run action
         }
    if else(ratio<.5){//next code
         }
    if else(ratio <1){more code}
    else{more code}
    
  • Returns the primary key of the new line (generated by the trigger) to an insert procedure

    Hello
    I have a table with a primary key (number), which increases with the trigger
    I use a procedure to insert data into this table
    How can I find the primary key of the row inserted to this procedure?

    When you make use of the insert:

    INSERT .... RETURNING key_column INTO variable;
    

    (where key_column is your key on the table column and variable is a variable to store the value of the same data type)

    to get the value in a variable.

  • APEX do not allow to change the lines of the columns that are the primary key?

    I have pictures:
    http://img508.imageshack.us/my.php?image=21269582oe8.jpg


    Book (id_book - 'Primary key', title, year); book_author (id_author id_book - 'Primary key', - 'Primary key'); author (id_author - "Primary key", name)



    I created a new page-> Form-> form of 'author' table because I want to add new authors, modification and deletion. During the creation of this page, I have chosen column 'id_author' as '1 primary key column' and everything is OK (I can't edit the 'id_author' column - this column is autoincrement and I can change the 'name' column).

    BUT I also created a new page-> Form-> table for table "book_author" because I like to write numbers like id_book and id_author, change and remove them (so add relations between tables: book, book_author and author). During the creation of this page, I have chosen column 'id_book' as '1 primary key column' and 'id_author' as 'column primary key 2'. And on the Web site, I can't edit these fields. And I can not add also new line because I see in each new line: (null).

    http://img444.imageshack.us/my.php?image=11324615yk9.jpg

    APEX do not allow to change the lines of the columns that are the primary key? It's stupid... What can I do?

    Edited by: user10731158 2008-12-20 11:40

    Column unique and not meaningful if you ever want to update. In the case of your example, you need to add an ID column in the intersection of book_author table. Honestly, I was so blown away (and pleasantly surprised) by the absence of rebuttal and the "thx" I advanced and set up an example of how I would define the book_author table:

    create table  book_author
       (id varchar2(32),
        book_id varchar2(32),
         author_id varchar2(32),
         modified_on     date,
         modified_by varchar2(255),
         constraint book_author_pk primary key (id),
         constraint book_auth_book_fk foreign key (book_id) references books(id),
         constraint book_auth_author_fk foreign key (author_id) references authors(id)
         )
    /
    
    create unique index book_author_uq on book_author (book_id,author_id)
    /
    
    create or replace trigger  biu_book_author before insert or update on book_author
    for each row
    begin
         if inserting then
              :new.id := sys_guid();
         end if;
         modified_on := sysdate;
         modified_by := nvl(v('APP_USER'),user);
    end;
    /
    

    Good luck
    Tyler

  • Get the primary key of entry just created by submitting the form

    Hi guys,.

    I have a form built in APEX based on a table. The PK is generated by the sequence and the values of the form are recorded by DML (insert).

    Do I have to do is once I have create a new entry with my, I need to update a whole bunch of other tables with the new PK that I can easily do this by creating a process of PL/SQL after DML.



    However, I need the primary key generated by the new entry (created by filling out the form + submit).

    One way around it is
    Select max(userid) from user
    to retrieve it, but I don't know if it's a good idea/practice.

    Any idea guys? See you soon.

    Taepodong wrote:
    Hi guys,.

    I have a form built in APEX based on a table. The PK is generated by the sequence and the values of the form are recorded by DML (insert).

    Do I have to do is once I have create a new entry with my, I need to update a whole bunch of other tables with the new PK that I can easily do this by creating a process of PL/SQL after DML.

    However, I need the primary key generated by the new entry (created by filling out the form + submit).

    One way around it is

    Select max(userid) from user
    

    to retrieve it, but I don't know if it's a good idea/practice.

    This will only give the maximum ID and not currently generated ID

    Any idea guys? See you soon.

    Use this feature APEX
    Change your page > change you the DTF process for the form > Enter you page back key point in the element (this returns the new pk value generated by this form)

  • need windows xp bootable cd I have the product key

    need windows xp bootable cd I have the product key

    How to replace hardware or lost, broken, or missing Microsoft software

  • Have the product key, but need to install media for Windows Vista Business

    I have the windows key, but need to download Windows Vista Business. Where can I find? I do to decompress the ISO?

    * original title - I have the windows key, but you need to download Windows Vista Business. Where can I find? I do to decompress the ISO? *

    Hello

    There is no free and legal Vista download

    Here are the different ways to reinstall vista:

    Contact the computer manufacturer and ask them to send you to vista recovery disks to reinstall the operating system back as it was when you bought it

    they do it for a nominal cost of $

    also ask them if you have a recovery partition on your hard drive to get back to the way you bought

    you would normally press F10 or F11 or Alt + F10, 0 at startup to start the recovery process according to the manufacturer

    Ask them of the exact key sequence

    or borrow a microsoft dvd vista

    Make sure that you borrow the correct 32-bit or 64-bit microsoft dvd to your computer

    they contain all versions of vista

    This is the product key that determines which version of vista is installed

    Save all data, because it will be lost, do the above

    How to replace Microsoft software or hardware, order service packs and replace product manuals

    http://support.Microsoft.com/kb/326246

  • need to based on the primary key of different table 2 foreign key constraint

    I'm using Oracle 11.2.0.3.

    I have 2 table invl with invl_pk as primary key and org with org_pk as the primary key.

    In the third table entity_list, I have entity_pk that can be indvl_pk or org_pk.   How can I create this constraint?

    Thanks for your time.

    Hello

    Assuming that your model is correct, then what you describe is a normal type of ER modeling construction known as a relationship of the CRA. It is characterized by an entity with two or more links that are mutually exclusive to each other (XOR). A typical example may be where a person entity and an entity of the Organization relate both to a bank account entity, but a bank account can only be used by a person or an organization in a mutually exclusive way. In order to serve this on a diagram, an arc is drawn between effective relationships on the side of the child, where the name of a relationship of the CRA.

    Google will be of multiple examples and explanations.

    In a perspective of physical databases, this can be implemented in general in two different ways.

    1. assuming that all parents in the relationship of the CRA have identical PK, that is to say, a number that is generated, the child may have a FK of the same type and an entity of type column that defines what entity the FK is. The advantage of this is that it is a bit more compact and is expandable without schema changes if you want to add more relationships. The downside of this is that the CF cannot be defined at the database level and will build on the code to be executed or both in the application and the database as a trigger.

    2. regardless of types PK for parent entities, the child has a separate optional FK appropriate for each relationship in the arc. Each FK is defined at the database level while maintaining the exclusivity of relationships, a constraint is defined on the table that prevents several FK being filled for a given instance. This can be a little messier that there must be a (column/s) FK for each relationship in the arc, but the relationship may be limited to the level of the object database with the help of FK constraints and a check constraint. This could also be considered to be more technically correct implementation.

    Hope this helps

    André

Maybe you are looking for

  • Satellite A660 - fan 90% on battery optimized mode

    Hi all my dear users of Toshiba that I really respect because they use such great brand Toshiba. I hope you have the time to read my problem and that its length can not bother you and you can do me favor and answer me.I am from Egypt and I recently b

  • Satellite L500: touchpad stoped working

    Hello I have a Toshiba Satellite L500 laptop and all of a sudden my touchpad stop working.I tried to check the mouse options in Control Panel, but I find it still in there. No idea how fix it.What should I bring to a service center? Thank you

  • I can't download a second copy of El Capitan for a friend. I've already updated my machine and was going to put a copy on a USB key for them.

    I've updated my machine to El Capitan but can't seem to download a second copy for a friend. I intended to put on a USB key since they do not have access to the internet.  It is like downloading but after 4 hours it has nothing.  Everything I need is

  • Boot Windows

    Hello... When I try to boot Windows my computer tries to read my external USB drives. I have to disconnect, and then after Windows 7 starts, plug the external sources again.  How can I change this to start without having to unplug my external drives.

  • What is a request only to create channels once?

    Dear all, An application can receive push message, only need to create channel once and use the token to grow in the future? Or is it necessary to create the channel whenever the application is started? Thank you Dong