[solved] inserting the same rows again into that table

i have a table with some rows now i want to insert the same rows again into that table
please tell me how to do it?
not using export please only sql query please
Message was edited by:
littlemaster

i m expecting that u commented on me (may be i m wrong). Only once, which we had already dealt with further up. My comment was continuing along another 'off topic' re: code graffitti. Sorry I you felt I was continuing to get at you.
(If you look at the 'In Response to' part of ant post you can see which post any p[ost is intended to reply to)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Question about how not to insert the same row twice

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    table employee_form should contain the exact data like employee_list .
    if there are missing data i'm inserting it to table employee_form_miss(missing).
    now i have a probelm cause the compair between the two table,take place
    more then just one time.now if there are still missing data i don't want that to table employee_form_miss will insert the same data that already exist in this table.
    i've been thinking about constraints table employee_form_miss(employee_id
    employee_name
    employee_num
    employee_date).
    but i think it will be a wird way to handle this because i will do an insert
    and then what rollback? or delete?
    please help me how to manage this
    thanks in advance.

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    i'm using an embedded sql in cobol program
    DECLARE AA CURSOR FOR
    select a.employee_name ,a.employee_num,a.employee_date
    from employee_list a
    WHERE a.employee_date = :employee-date
    and NOT EXISTS
    (select null from employee_form
    WHERE employee_name =a.employee_name and
    employee_num = a.employee_num and
    employee_date = a.employee_date )
    i'm doing open and fetch to the cursor.
    and loop over the sqlerrd(3) result in order to insert them to the employee_form_miss table
    insert into employee_form_miss (employee_name,employee_num,employee_date)
    values (:employee-name,:employee-num,:employee-date)
    the employee_id in table employee_form_miss there is a trigger which
    Increment the sequence by 1 for each row that we insert.
    so my question was that if i'm doing a constraint, so still i have to do
    an insert and then if there is a constraint to do rollback or delete
    from duplicate row. is there a better way to manage this ?
    thank you

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
    Thanks in Advance.

    Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
    SQL> var v_id number
    update tableA  
    set colB='ABC' 
    where colC='XYZ' 
    returning id into :v_id;
    insert into table A_History (ID, colA, colB, ColC)  
    select id, ColA, ColB, ColC  
    from tableA  
    where id = :v_id;   

  • Insert the MDX Query Data into SSMS Table

    Hi, I'm using below query frequently on SSAS .
    select * from $system.discover_commands
    I want that when this query executed & If any output returns , then that output should be inserted into SSMS
    Table(OLTP DB) .

    Hello,
    You can use a linked server to SSAS to run queries from SQL Server against SSAS cubes and to insert the result into a relational table.
    See e.g.:
    Passing Queries from SQL Server to a Linked Analysis Server
    Querying SSAS with SQL
    Creating a Linked Server for Analysis Services
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Hi friends, I have a doubt in inserting a field to database table and inserting the same values in two different tables

    I have a mpp screen for a cd library management system (we are practicing on it).
    We have a main screen where a user should enter the enteries and while clicking a add button it should be inserted in a table, Here the problem rises the table name are ztransaction and zstatus.The fields in mpp are cdid,customerid,transaction id,date of issue and duedate.Now after entering all the values on clicking add button it should be inserted to database table ztransaction and the field cdid alone should be inserted both in ztransaction and zstatus.
    Thank you

    Hi Raghuram R G,
    Check for Primary key and foreign key in the Database table??? Because of this it was not inserting...check and confirm??
    Regds,
    Vijay SR

  • How to list the employees working under one manager in the same row.

    Hi,
    my emp table has the following data.
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    I want to group all the employees under one manager and list their names in the same row. IS that possible. When i tried the query below,
    select mgr, count(*) employees from emp where mgr is not null group by mgr, ename;
    I got the result as
    MGR EMPLOYEES
    7566 2
    7698 6
    7782 1
    7788 1
    7839 3
    7902 1
    Additionally, would I be able to display the names of the employees under one manager in a row? or atleast in some other way? Pls share your ideas.

    A summary of different string aggregation techniques can be found here
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • Uploading the contents of file into  custom table

    Hi ,
    I have a req where in i want to put the contents of the file into the Z table . I have taken a file upload UI element and in that i have taken 4 attributes as file name f, file type ,file size and file contents and binded this file contents to the data property of the UI element. Now with out explicitly defining the fields i want to put all this content of file into the Z table created  for any file created or if i could put the whole text file into that table so that any one could see that file even though its not saved in the desktop for that user.
    Can any one help me out?

    Yes i am converting it inot the lstring using the same FM which you have given. I have to store the total file but the only doubt is like if its a input field how could i save a file form. Can you please check the code i want to save the total file into the table.
    DATA lo_nd_upload TYPE REF TO if_wd_context_node.
        DATA lo_el_upload TYPE REF TO if_wd_context_element.
        data  i_data TYPE STANDARD TABLE OF string.
        DATA ls_upload TYPE wd_this->Element_upload.
        data lv_field type string.
        data lt_file type TABLE OF ZFILE_UPLOAD.
        data ls_file LIKE LINE OF lt_file.
        data l_xstring type xstring.
       data  fields TYPE string_table.
    data l_String type string.
      navigate from <CONTEXT> to <UPLOAD> via lead selection
        lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).
      @TODO handle non existant child
      IF lo_nd_upload IS INITIAL.
      ENDIF.
      get element via lead selection
        lo_el_upload = lo_nd_upload->get_element( ).
      @TODO handle not set lead selection
        IF lo_el_upload IS INITIAL.
        ENDIF.
      get all declared attributes
        lo_el_upload->get_static_attributes(
          IMPORTING
            static_attributes = ls_upload ).
       DATA lv_file_contents TYPE wd_this->Element_upload-file_contents.
    navigate from <CONTEXT> to <UPLOAD> via lead selection
    @TODO handle non existant child
    IF lo_nd_upload IS INITIAL.
    ENDIF.
    get element via lead selection
       lo_el_upload = lo_nd_upload->get_element( ).
    alternative access  via index
    lo_el_upload = lo_nd_upload->get_element( index = 1 ).
    @TODO handle not set lead selection
       IF lo_el_upload IS INITIAL.
       ENDIF.
    get single attribute
       lo_el_upload->get_attribute(
         EXPORTING
           name =  'FILE_CONTENTS'
         IMPORTING
           value = l_xstring ).
    for text file conversion we have to FM
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
      EXPORTING
      FROM_CODEPAGE       = '8500'
        IN_XSTRING          = l_xstring
      OUT_LEN             =
    IMPORTING
       OUT_STRING          = l_string.
    SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
      LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        read TABLE fields into lv_field index 1.
    endloop.
    ls_upload will contain all the file details
    ls_file-file_size = xstrlen( ls_upload-file_contents ) * lv_float  .
    ls_file-file_name = ls_upload-file_name.
    ls_file-file_type = ls_upload-file_type.
    ls_file-file_contents = ls_upload-file_contents.
    insert ZFILE_UPLOAD FROM ls_file.
    thanks

  • Insert date from YUI calendar into mysql table

    Is there a way to insert the date selected from the YUI calendar into a mysql table?

    I have been in trouble since last 2 days... I have tried all possible and explored any related topics.. Still I cannot address the problem.
    Problem 1:
    I have a simple jsp form which passed a bengali word.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <form action="Test2.jsp" method="post" >
    <input type="text" value="&#2453;&#2494;&#2453;&#2494;" name="word">
    <input type="submit" value="Next">
    </form>
    </body>
    </html>
    When this page is post, a java program( TestWord) is called by the Test2.jsp. TestWord insert the passed bengali word into a MySQL table. Then it retrieves again the inserted bengali word and display in Test2.jsp.
    Test2.jsp:----
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <jsp:useBean id="get2" class="dictionary.TestWord" scope="session"/>
    <jsp:setProperty name="get2" property="*"/>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <form action="" method="post">
    <%
    String s=get2.getWord();
    out.write("Before converion onversion = "+s);
    s = new String(s.getBytes("ISO-8859-1"),"UTF-8");
    out.write(" After conversion = "+s);
    %>
    </form>
    </body>
    </html>
    It gives the output something like:
    Before conversion = &#65533;?&#2494;&#65533;?&#2494; After conversion = ??????
    Problem 2:
    The record in mysql table is inserted in bengali font (eg. &#2453;&#2494;&#2453;&#2494;). When I retrieve the record and display in a jsp page, I can see the bengali word (&#2453;&#2494;&#2453;&#2494;) properly. But if I insert the bengali word again in MySql table, then I see some string like "&#65533;?&#2494;&#65533;?&#2494;" storing in the table.
    Please help me out..
    Thanks in advance.

  • Insert a field and update the same row.

    Hi,
    I am inserting a value in a row.
    And later within a cursor loop I am trying to update the same row. But it is not working....
    CREATE OR REPLACE procedure Del_Note_stage
    Is
    v_delNote Delivery_Note.Delivery_Note_id%type;
    Cursor C1 is Select Heading_Name,File_Data from Sqlload_Stage;
    Begin
    dbms_output.put_line('i am here a ');
    Select Delivery_Note_Id_Seq.nextval into v_delNote from dual;
    Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED) Values(v_delNote,sysdate,'Config','N');
    commit;
    dbms_output.put_line('i am here b'||v_delNote);
    For sqlload_rec in C1
       Loop
        dbms_output.put_line(sqlload_rec.Heading_Name);
        dbms_output.put_line('Del Note Id is :'||v_delNote);
        update DELIVERY_NOTE_STAGING  set deployed_by='TOM' where delivery_note_id=v_delNote;
    End loop;
    End;

    But it is not working....Why not?
    Please read: http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    Why are you updating after inserting?
    Just add deployed_by to the insert statement, or use a default value for that column.
    Also you don't need to select your Delivery_Note_Id_Seq.nextval from dual, just use it in your insert statement.
    Something like:
    Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED,deployed_by )
    Values( Delivery_Note_Id_Seq.nextval,sysdate,'Config','N', 'TOM' /*or USER*/);

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • I have 2 apple ID one for Egypt and other for USA , now I try to update the software but I get a message said that this software download with other ID, then I logout and sign with second ID but i got the same message again ... Now I can not sign in more

    I have 2 apple ID one for Egypt and other for USA , now I try to update the software but I get a message said that this software download with other ID, then I logout and sign with second ID but i got the same message again ... Now I can not sign in more
    Any solution ?
    I'm using iOS 6.1.2 IPad 3
    Regards

    I have also noticed the same "problem".  I do not fully understand the impact of using the same ID on multiple computers and devices if I want to keep them all in sync.

  • Last summer I bought a music album from iTunes. I've already transferred all my orders from my units, but somehow iTunes wants me to pay for the same album again. When I try to add it to my wish list it simply tells me that I've already bought that item.

    Last summer I bought a music album from iTunes. I've already transferred all my purchases from my units, but somehow iTunes wants me to pay for the same album again. When I try to add it to my wish list it simply tells me that I've already bought that item.
    And I've already tried to search for downloadable purchases.
    So fact is established, I've purchased this album before but iTunes does not recognize it.
    What to do?

    Hey sorry for the late response but I've been out of town.  I can copy and paste the email responses if necessary or desired, and if it's fixed already this is a moot point anyway, but basically they kept asking me for the order numbers for the two songs I already bought from the specific album I was trying to complete, which I eventually gave them - along with telling them multiple times that the Complete My Album feature wasn't working for ANY album.  They gave me two free song codes to compensate me for the two songs I bought, and then told me to go and buy the album at full price, but the ENTIRE TIME they COMPLETELY ignored that I was telling them that this wasn't an issue with one album but was a larger, seemingly systematic issue that other people were experiencing.  Even after I got the song codes I emailed them back and said AGAIN that this wasn't an isolated feature, and they just sent me the link to the apple Feedback page (http://www.apple.com/feedback/itunesapp.html) and told me to submit my complaint there.  So, technically, my issue was never really "resolved," in that they never fixed the Complete My Album feature that I am aware of - or even acknowledged that anything needed fixing, but I haven't tested it since Sunday.
    If it's working for you, then hopefully they fixed it!  I've noticed they've updated to 10.4.1, but the notes don't indicate they're fixing anything about the Complete My Album feature, so I don't know.

  • I want to make the adress bar smaller so that my bookmark bar can show more than three icons when placed on the same row.

    I want to have about five to ten bookmark icons in the same row as the search and address bar. So i use Customize... and I put the bookmark bar on the same line. I leave the "Name"-textbox in every bookmark blank so that only the icons appear.
    However, only two icons appear and the rest are displayed in a drop down menu from an arrow you click.
    I don't need the address bar to take 70% of the screen. I don't want the bookmark bar to use an extra row. I just want to have five to ten bookmark icons next to my address and search bar. Is this possible?

    What do you mean with "Save passwords" checkbox?
    Is that box provided by an extension?
    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Websites remembering you and automatically log you on is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    Make sure that you do not run Firefox in Private Browsing mode.
    * https://support.mozilla.com/kb/Private+Browsing
    Do not use Clear Recent History to clear the "Cookies" and the "Site Preferences"
    * https://support.mozilla.com/kb/Clear+Recent+History
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.

  • My Iphone goes into "connect to Itunes" mode, I connect to Itunes and restore, then with 24 hours I get the same message again, any ideas ?

    My phone goes into "connect to Itunes" mode and locks up, I connect to Itunes and do a restore and then within 24 hours I get the same message again and the phone locks up. any ideas ?

    You're welcome.
    A hardware problem doesn't mean complete failure.
    With a computer, a hard drive can have a partial or complete failure.
    If it wasn't a hardware problem, it would be resolved after restoring the iPhone as a new iPhone or not from the backup. If not, every iPhone running 5.1.1 would have the same problem.

  • I successfully got artwork for my music.  I did it again think that itunes wouldn't get the same artwork again, but it did, right?

    I successfully got artwork for my music.  I did it again thinking that itunes wouldn't get the same artwork again, but it did, right?

    Al McKinnon Jr. wrote:
    I successfully got artwork for my music.  I did it again thinking that itunes wouldn't get the same artwork again, but it did, right?
    Dunno...
    You are the one getting the artwork.
    Did it get the same artwork again?

Maybe you are looking for