Automatic copying row from one table into another one

Hi,
I am looking for some help on how to do the following:
I use Number to track my finances. I have two tables - one for my checking account and the other one for my cash account. When I withdraw cash from my checking account I record a transfer or debit transaction in my checking account table (in the type column of this table I enter "transfer" and in the category column of this table I enter "cash account"); Obviously I have to record a matching transaction in my cash account where the category column shall read "checking account". Both records represent one and the same transaction. In order not to enter this transaction twice I would like to "automate" this process so that once I enter the transaction in either of the two table (checking or cash) the matching entry automatically appears in the other table. Is there any way to do this.
Thank you,
Evgeny

You can use Connection#getMetaData() to retrieve information about the tables and the columns of the table.
After all, it is better to gain information about the table first and then issue a query in the form of "INSERT INTO table1 SELECT * FROM table2", including the eventual column selections and/or data conversions at SQL level.

Similar Messages

  • How to bring the more than one rows from the table into the script

    Hi
    I have to bring more than one rows from the table into the Main windows of the script. so plz help me out.
    Thanks in Advance
    Ananya

    Hi Ananya,
       Bring more than one row into main window of script.
       For this you need to do some changes for data which you pass to main window.At a time you need to pass more than one row,so for this you need to define one structure.See below code.
    Types:begin of ty_rows,
         include structure (your row_structure),
         include structure (your row_sturcture),
    Types:end of ty_rows.
    for example....
    If i need to pass 2 vendor details at a time to main window then the structure should be like this.
    Types:begin of ty_rows,
           vendor1 like lfa1-lifnr,
           vendor1_name like lfa1-name1,
           vendor2 like lfa1-lifnr,
           vendor2_name like lfa1-name1,
          end of ty_rows.
    Data:i_main type standard table of ty_rows,
         wa_main type ty_rows.
    Based on condition you can pass more than one rows of your actual internal table data to i_main internal table.
    Then you can pass i_main internal table to your main window.
        I think this will help you.
    Cheers,
    Bujji

  • Numbers: Copy/Paste from multiple tables into 1 single Table?

    I would appreciate some guidance in creating a copy/paste script from multiple numbers tables into a different single table within the same numbers document.
    The columns in the source table are in different positions to the destination table.
    So for example, i would want to copy…
    Sheet 1, Table 1 Cell A3  copy to Sheet 2 Table Z Cell B2
    Sheet 1, Table 1 Cell B3  copy to Sheet 2 Table Z Cell C2
    Sheet 1, Table 1 Cell C3  copy to Sheet 2 Table Z Cell E2
    Sheet 1, Table 1 Cell D3  copy to Sheet 2 Table Z Cell F2
    Sheet 1, Table 1 Cell E3  copy to Sheet 2 Table Z Cell G2
    Sheet 1, Table 1 Cell G3  copy to Sheet 2 Table Z Cell I2
    Sheet 1, Table 1 Cell J3  copy to Sheet 2 Table Z Cell H2
    and repeat the copy/paste on subsequent rows of each table until there is an empty row in Sheet 1 Table 1 (or if this is difficult, say set the repeat to a max of 30 rows).
    The script would then need to move on to Sheet 1 Table 2, and do the same copying to Sheet 2 Table Z (from where the previous copy/paste finished in Table Z).
    Repeat process would finalise with Sheet 1 Table 6.
    The Paste part would need to be pasting values, as the cells in the source tables do contain some formulas.
    At the moment this is all done manually and does take some to to undertake.
    If anyone can help, i would be very grateful.
    Thanks,
    Colin

    Interceptor,
    are you trying to aggregate data from severl tables into a single table?  If so you whould be able to do this without a script.  The function indirect() will allow you to construct the proper formula, which you may fill over (in the same row) to the appropriate cells, then fill down.
    Here is a small example:
    There are three data tables ("Table 1", "Table 2", and "Table 3").  And a summary "Table Z"
    In table Z make the first row a header (as shown):
    Use column A to enter the Sheet name and colomn B to enter the table name.
    In row 1 (the header), enter the cells you want to get
    in cell C2 type (or copy and paste from here) the formula:
    =INDIRECT($A2&"::"&$B2&"::"&C$1)
    now select cell C2, copy now select cell C2 thru H2, paste
    now select the cells C2 thu H2, hover the corsor over the bottom edge of the selection, and drag the yellow cirlc down as needed to fill the formula down.
    Update the sheet and table names as needed for each row

  • How to save the  selected rows from Advance table into database

    Hi
    I have requirement like..
    In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
    The reqt is how to save the selected multiple rows into the database.

    hi Reetesh,
    In Custom page
    Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
    So in Such scenario how to save this 10 rows against Recruiter
    , i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
    I hope u understand my question

  • Can Pages copy text from one page to another automatically?

    Can Pages automatically copy text from one page to another?
    For example recurring text in a document e.g. addressee details or a date (not today's date).
    I want to type the topic title of one letter and have it automatically filled into the correct field in the next page which will be a letter to a different recipient.
    The letter text will be different for each recipient so mail merge probably won't work.
    Thanks
    Andy

    Thanks that worked great!!!(for the first line)
    Now why wont it populate more than the one other text field?
    F.Lic.Table1.Row1.agt_ssn_lic.rawValue = xfa.event.newText;
    F.PAGE3.agt_ssn_1.rawValue = xfa.event.newText;
    F.PAGE4.agt_ssn_2.rawValue = xfa.event.newText;

  • Connect role allows user to update/delete row of a table of another schema

    I am using oracle 9i r2, I created a user and only give him CONNECT role. Then I opened the sqlplus and found that he could query table of another schema which doesn't belong to the new user, but the thing which scares me most is that when I tried to update/delete a row from a table of another schema, it succeeded. Also, I created a new role with system priviledges CREATE_SESSION and SELECT_ANY_TABLE then granted to new user and revoked the CONNECT role but the same thing happened like before. What I am doing wrong? By the way, I am trying to create a read only user. Any help is greatly appreciated.

    Thanks guys for the tips. I have forgotten to mention that this situation happened only in a new created schema which has only a table and the table was exported from another oracle db( I pre-created the user with connect role and assign the tablespace etc), the import worked fine. Then I used a read only user(in different schema) to update/delete row to the imported table.The read only user can't update/delete other schemas besides from the new one. Is that I missed something when importing the table or pre-create user, tablespace, etc? Thanks in advance.

  • Copying table rows from one table to another table form

    Hi
    I have a problem about Copying table rows from one table to another table form.On jsf pages if you enter command button go anather jsf page and it copy one row to another table row. But when i execute this process for table FORM it doesn't copy I wrote a code under "createRowFromResultSet - overridden for custom java data source support." Code block is:
    ViewRowImpl value = super.createRowFromResultSet(qc, resultSet);
    try{
    AdfFacesContext fct = AdfFacesContext.getCurrentInstance();
    Number abc = (Number)fct.getProcessScope().get("___");
    value.setAttribute("___",abc);
    }catch(Exception ex){System.out.println(ex);  }
    return value;

    Table may be copied with the
    expdp and impdp utilities.
    http://www.oracle.com/technology/products/database/utilities/index.html

  • Deleting rows from one table while filter condition lies into another table

    Hi All,
    I'm facing a problem deleting a row from a table where the condition lies in other table. To ealaborate the scenario further let's say I have two table T1 (transaction table) and T2 (Master Table). I want to delete a record from table T1 by checking some conditions lies in table T2.
    I tried with the below query but this query deleting records from both the table.
    DELETE FROM ( SELECT * FROM T1 top INNER JOIN T2 tp
    ON top.TID = tp.TID
    WHERE top.DEAL_SITE_ID = inputparameter1
    AND (TP.SEGMENT <>inputparameter2 OR tp.segment is not null));
    Here the record is getting deleted from both the tables but I don't want to delete data from my master table i.e table T2.
    Any help would be highly appreciated. Thanks in advance.
    Regards,
    Subhadeep

    SQL> select *
      2   from the_table;
    X          Y
    AA         a
    BB         a
    CC         a
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a
    SQL>  delete from
      2  (
      3  select *
      4  from the_table  t1 inner join the_table_2 t2
      5  on  t1.x = t2.x
      6  and t1.y = t2.y);
    3 rows deleted.
    SQL> select *
      2   from the_table;
    X          Y
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a

  • How to copy data from one table to another (in other database)

    Hi. I would like to copy all rows from one table to another (and not use BC4J). Tables can be in various databases. I have already 2 connections and I am able to browse source table using
    ResultSet rset = stmt.executeQuery("select ...");
    But I would not like to create special insert statement for every row . There will be problems with date formats etc and it will be slow. Can I use retrieved ResultSet somehow ? Maybe with method insertRow, but how, if ResultSet is based on select statement and want to insert into target table? Please point me in the right direction. Thanks.

    No tools please, it must be common solution. We suceeded in converting our BC4J aplication to PostgreSQL, the MSSQL will be next. So we want to write simple aplication, which could transfer data from our tables between these 3 servers.

  • Copy data from one Table to another Table

    How can I copy data from one Oracle Table to another Oracle Table on a different server? Question 2: How can I clear all of the data in one Table with a single SQL script?
    Thanks...

    Question 1:
    I assume you have the privileges. If you don't, ask the DBA to give them to you. Then
    1. Login to database_source (It could be either the source or the target. Let's assume it's the source.)
    2. Create a database link to database_target: CREATE DATABASE LINK link_to_database_target CONNECT TO myuserid IDENTIFIED BY mypassword USING 'database_target'; Note the single quotes.
    3. Copy the table data: INSERT INTO targetowner.mytable@link_to_database_target SELECT * FROM sourceowner.mytable; COMMIT;
    Question 2:
    You have two options, but you may not have privileges for both.
    Option 1:
    DELETE FROM tableowner.tablename; COMMIT;
    Advantage: Since this is a DML (Data Manipulation Language) statement, you have to commit the transaction. Also, the data will be gone but the table size is NOT changed, so it's ready for accepting replacement data. DML statements can simply be executed not only from SQL scripts, but from PL/SQL scripts as well.
    Disadvantage: Slow, because all record deletion is logged, so you can recover from it by issuing a ROLLBACK; instead of the COMMIT; above. The table size is NOT changed, so if you are short of disk space or tablespace space, you have not resolved the issue.
    Option 2:
    TRUNCATE TABLE tableowner.tablename;
    Advantage: Since this is a DDL (Data Definition Language) command, you do NOT have to commit the transaction. (DDL commands automatically commit both before and after their execution.) The table size will be changed back to the initial extent size which is the minimum size a table can have and can only be set when the table is created. If it needs to be changed, the table has to be dropped and recreated with a different initial extent size. The statement execution of this command is not logged, therefore it's much faster then the DELETE.
    Disadvantage: No rollback. Being a DDL, this command cannot be executed straight from PL/SQL. If you need to issue this within PL/SQL, you will have to use dynamic SQL.

  • I need to copy data from a table in one database (db1) to another table in

    Hi
    I need to copy data from a table in one database (db1) to another table in another database (db2).
    I am not sure if the table exists in db2,,,if it doesnot it needs to be created as well data also needs to be inserted...
    How am I supposed to this using sql statements..?
    I shall be happy if it is explained SQL also...
    Thanking in advance

    How many rows does the table contains? There are manyway you can achieve this.
    1. export and import.
    2. create a dblink between two databases and use create table as select, if structure doesnot exists in other database, if structure exists, use, insert into table select command.
    example:
    create a dblink in db2 database for db1 database.
    create table table1 as select * from table1@db1 -- when there is no structure present
    -- you need to add constraints manually, if any exists.
    insert into table1 select * from table1@db1 -- when there is structure present.
    If the table contains large volume of data, I would suggest you to use export and import.
    Jaffar

  • How do I copy recordsets from one database table to another?

    I am using the Database Connectivity Toolset, and would like to copy either one recordset or multiple recordsets from one Access table to a table in a different database. I would like to do it directly with the data in variant form, but I can't get it to work. I can get it to work(on a small test table) if I first convert my source variant data to a cluster, then insert that into the other database table. My real database has many items with a variety of date types. Can I copy directly variant to variant?

    Is it necessary to read all the data back into LabVIEW first? The reason I'm asking is that it is much more efficient to just use SQL statements to get the data you need and write that directly to the second database. I did a quick Google search on it and came up with lots of responses on what the correct syntax is for setting that up. Using an SQL command to copy the data back and forth is analogous to copying data from one file to another using the Copy file function rather than reading the entire contents of the file, converting the file string to the data arrays, converting back to a string, and then writing it back to another file.
    Chapter 5 of the Database Connectivity Toolset User Manual describes how to execute SQL queries.
    If you do need to actually
    see the data in LabVIEW first, then the only way to get it back into the other database is to convert those variants to LV datatypes and then cluster those values again and write them back out to the second database.

  • Passing Multiple table row from one view to another view

    Hi,
    How to Passing Multiple table row from one view to another view in Web Dynpro Abap. (Table UI Element)
    thanx....

    Hi Ganesh,
    Kindly do search before posting.. this discussed many times..
    First create your context in component controller, and do context mapping in two views so that you can get values from
    one veiw to any views.
    and for multiple selection, for table we have property selection mode.. set as multi and remember context node selection
    selection cardinality shoud be 0-n.
    so, select n no of rows and based on some action call sec view and display data.( i think you know navigation between veiw ).
    Pelase check this...for multi selection
    Re: How to copy data from one node to another or fromone table to another table
    for navigation.. check
    navigation between the views
    Cheers,
    Kris.

  • T code to Copy Data from one table to another table

    Hi,
    I want copy all data of one table to its copy table. Anyone knows transaction code to copy data from one table to another table.
    Regards,
    Jigar Thakkar.

    Hi
    Create a small program.
    Extract data from T1 - database table and put it in one internal table - itab1.
    loop the itab1 data .............
        insert itab1 into tab2.   (tab2 - second database table)
    endloop.
    try this....
    hope it works....

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

Maybe you are looking for

  • Camera raw update for d7100

    How do I get the camera raw update for Nikon d7100 in mac version of cs5? I can get the dng download on my desktop but don't know how to move it into Photoshop.

  • Automatic Deletion of Files in FRA

    Ok, I am about fired up right now. I have read over and over how Oracle will reclaim space in the FRA if it is running low yet I can't reproduce this behavior to save my life. - I have archive logging enabled. - I am using the FRA. - I have a recover

  • RFC\BAPI to login into remote system with user id's in that system

    Dear Friends, I have a requirement to run a job .In that job, i need to login into other remote system with the user id's in that system. May I know, is there any remote function module or BAPI available. Let me know how to solve this issue. Regards,

  • How do I create a data file of my library

    I would like to create a data file that will list artist/album for my iTunes library. I would like to put this on my iPod so that I know exactly which albums I have so I do not buy duplicates when I am out rummaging at used record stores. How do I go

  • How to stop Aperture starting up when iPhone is plugged in?

    Hi all, silly question... but Aperture keeps opening whenever my iPhone is plugged in. Does anyone know how to stop this? Not a big deal... but its getting annoying! Thanks in advance! Lil