How to compare data between two worksheet in Excel for applescript

Hi All,
How to compare the data from two different worksheet in Excel and set the value into one worksheet according to the same name? Here is the example. Worksheet 1 & 2 current we have, the final worksheet is the result we want and the value can be input in worksheet 1. Much appreciate if you can help on it.
Worksheet 1:
Name          Number
Leo                 25
Jame               55
Leo                 30
Jame               60
Tim                 44
Tomas             77
Lyne                35
Tonny              66
Jame               22
Game              88
Worksheet  2:
Name          Number  2
Leo                60
Jame             150
Tim                66
Tomas            88
Lyne               55
Tonny            99
Game             111
Rusult in Worksheet 1
Name          Number        Total Number per name in Worksheet 1         Number 2 in Worksheet 2
Leo                 25                          55                                                        60
Jame               55                         137                                                       150
Leo                 30                           55                                                        60
Jame               60                         137                                                       150
Tim                 44                          44                                                         66
Tomas             77                          77                                                        88
Lyne                35                          35                                                        55
Tonny              66                          66                                                        99
Jame               22                         137                                                       150
Game              88                          88                                                        111

I'd probably use a database for this, if there's any quantity of data involved here.  Import from Excel into {SQLite, MySQL, PostgreSQL, FileMaker, maybe Core Data}, or pick your preferred key-value store, keep your data in the database, then export or (via ODBC/JDBC) then access live database data from within the spreadsheets.
Alternatively and if you're looking at small quantities of data (say, less than 10,000 entries, or less than a thousand depending on the language), then just use whatever passes for a key-value store in your preferred scripting language {Python, bash, Lua, or maybe php, AppleScript or Java} and use that.  Export Excel to CSV {gag} or XML, then load that into Python and process as needed, then write out CSV {gag} or XML.
AppleScript is a scripting language for GUI applications, and also useful for processing events.  If you're not doing that sort of stuff, then there can be other choices, and other choices can often have extensive frameworks and libraries for common tasks.
Sooner or later, most everybody runs into a wall when using a spreadsheet...  Various folks have encountered those limits and have migrated from spreadsheets to FileMaker databases, and now use a database as the central store for their operations — and that's the other issue that can arise with spreadsheets... Where's the canonical data?

Similar Messages

  • How to compare data between two tables?

    Hi,
    My team is trying to develop a SAP data migration tool (DMT) using ABAP.
    One of the functionalities in the DMT is to validate the data in the staging area against the loaded SAP data.
    The tables in the stagin area are customer tables (i.e. user-defined tables starting with Y, Z).
    How do I compare the data in the staging area against data that are loaded into SAP tables? Are there some built-in SAP functions to do this? Or, are there some better ways of doing this (e.g. instead of comparing against data in the SAP tables, we compare with some INTERNAL tables)?
    Any help would be greatly appreciated, thanks!

    Hi Kian,
    Use <b>SCMP</b> transaction to compare data between two tables and you can not use this for comparing internal tables.
    Thanks,
    Vinay

  • How to compare dates between two items

    Hello all,
    I am trying to compare dates in two items.
    The first item is a computation P45_PAGE_LOADED_TIME
    select sysdate from dual;
    This essentially keeps track of when the user opened the form. They are accessing data that may become obsolete while they are in the form.
    So we have a dynamic action that finds the last_update date from a table. This field is of type date. It is placed in a text field called P45_STATUS.
    We then have a notification which we want to fire when P45_PAGE_LOADED_TIME is before P45_STATUS. We tried the following condition
    declare
    least_date date;
    begin
    SELECT LEAST(TO_DATE(:P45_STATUS),TO_DATE(:P45_PAGE_LOADED_TIME)) into least_date
    from dual;
    if least_date = to_date(:P45_STATUS) then
    return false;
    else
    return true;
    end if;
    end;
    Any guidance would be most appreciated.
    Thanks

    Maybe your better off putting your anonymous block into a plsql function.
    A function that you can test. If it works in plsql then you must call it in APEX.
    I kinda get a headache when I see that least, to_date, to_date query (although I've seen worse :p)
    Make it like:
    create or replace function fun_least_date(in_status in varchar2,
                                                               in_page_loaded_time varchar2) return boolean
    is
      l_status date;
      l_page_loaded_time date;
      least_date date;
      l_return boolean;
    begin
      l_status := to_date(in_status, 'FORMAT MASK!!!');
      l_page_loaded_time := to_date(in_page_loaded_time, 'FORMAT MASK!!!!');
      least_date := least(l_status, l_page_loaded_time);
      if least_date = l_status then
        l_return := false;
      else
        l_return := true;
      end if;
      return l_return
    end fun_least_date;If your sure that your function is correct then use it as a condition for your dynamic action.
    Regards
    Nico
    ps: I haven't tested that function. Be aware that you most correctly enter the format mask you use in APEX. Also before APEX may know about these variables you should set a dynamic action on your items to always submit their value to the server when they change!!!

  • How to pass data between two internal sessions using ABAP memory?

    Hi,
    How to pass data between two internal sessions using ABAP memory?
    It would be fine if you could explain with an example.
    And also let me clear about the data passing between two main sessions and two external sessions with specific examples.
    Thanks.

    Hi ,
      check the example.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    In this statement, the system does not check whether the structure of the object in memory is compatible with the structure into which you are reading it. The data is transported bit by bit. If the structures are incompatible, the data in the target field may be incorrect.
    PROGRAM SAPMZTS1.
    DATA TEXT1(10) VALUE 'Exporting'.
    DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    DO 5 TIMES.
      ITAB-BOOKID = 100 + SY-INDEX.
      APPEND ITAB.
    ENDDO.
    EXPORT TEXT1
           TEXT2 FROM 'Literal'
      TO MEMORY ID 'text'.
    EXPORT ITAB
      TO MEMORY ID 'table'.
    SUBMIT SAPMZTS2 AND RETURN.
    SUBMIT SAPMZTS3.
    The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)
    Example for SAPMZTS2:
    PROGRAM SAPMZTS2.
    DATA: TEXT1(10),
          TEXT3 LIKE TEXT1 VALUE 'Initial'.
    IMPORT TEXT3 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT3.
    IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT1.
    Example for SAPMZTS3:
    PROGRAM SAPMZTS3.
    DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
    LOOP AT JTAB.
      WRITE / JTAB-BOOKID.
    ENDLOOP.
    The output is displayed on two successive screens. It looks like this:
    and
    The program SAPMZTS2 attempts to read a data object TEXT3 from the data cluster "text", which does not exist. TEXT3 therefore remains unchanged. The existing data object TEXT2 is placed in TEXT1. In both cases, SY-SUBRC is 0, since the cluster "text" contains data.
    The program SAPMZTS3 reads the internal table ITAB from the cluster "table" into the internal table JTAB. Both tables have the same structure, namely that of the ABAP Dictionary table SBOOK.
    Pls. reward if useful.....

  • How to separate data between two colons

    Hi,
    how to separate data between two colons?
    ex: 'ABC:1234:1-ss-2:0:0:0:0-DEF:5678:0:0:0:0'
    how to access these 1234, 5678 and 1-ss-2 ?
    there may be any string.
    please help

    Hi,
    The string 'ABC:1234:1-ss-2:0:0:0:0-DEF:5678:0:0:0:0' contains 11 colons, and 10 sub-strings that are between colons. How do you distinguish the ones you want,
    (1) 1234
    (7) 5678
    (2) 1-ss-2
    from the ones you don't want
    (3) 0
    (4) 0
    (5) 0
    (6) 0-DEF
    (8) 0
    (9) 0
    (10) 0
    Anyhow, in Oracle 10 (and up) you can easily get the n-th item from a :-delimited list by saying:
    REGEXP_SUBSTR ( txt
                  , '[^:]+
                  , 1
                  , n
                  )First use REGEXP_REPLACE to remove anything before the first colon and anything after the last one.

  • Compare data between two tables

    Hey Experts
    I am having two tables both are having same structure.
    Both r having 210 columns
    I want to compare data between these two tables.
    I used follwoing query
    select * from t1
    MINUS
    select * from t2but even if thr is diff in 1columns .. i need to search 210 columns which is the exact columns and data
    how can i find the exact columns out of these 210 columns ?

    SShubhangi wrote:
    but even if thr is diff in 1columns .. i need to search 210 columns which is the exact columns and data
    how can i find the exact columns out of these 210 columns ?This is not a trivial problem to solve. Consider a much simpler data set. In table 1 (four columns) we have
    1 A B C
    2 D E F
    3 A B Dand in In table 2 (four columns) we have
    2 X Y Z
    3 A B ENow
    select * from table1 minus select * from table2gives
    1 A B C
    2 D E F
    3 A B Dwhereas
    select * from table2 minus select * from table1gives
    2 X Y Z
    3 A B ENow clearly the first row in Table1 (ID=1) doesn't match any row in Table2 but it's only two columns out from the last row in Table2 (ID=3). However, the row in Table1 with ID=3 only doesn't match on one column.
    So, how do you represent the output?
    Clearly what you want can only be achieved if there are some columns which ought to be the same in both tables i.e. key columns. In which case you can use a full outer join link teh two tables, and case statements to display only the values which don't match:
    select t1.id as t1_id
             , t2.id as t2_id
             , case when t1.col1 != t2.col1 then r1.col1 end as t1_col1
            , case when t1.col1 != t2.col1 then r1.col1 end as t2_col1
            , case when t1.col2 != t2.col2 then r1.col2 end as t1_col2
            , case when t1.col2 != t2.col2 then r1.col2 end as t2_col2
            , case when t1.col3 != t2.col3 then r1.col3 end as t1_col2
            , case when t1.col3 != t2.col4 then r1.col4 end as t2_col2
    from table1 t1
          full outer join table2 t2
         on t1.id = t2.id;Handling nulls is left as an exercise for the reader :)
    I agree that typing all this would be extremely tedious for a table with 210 columns, but that's why Nature gave us the ability to generate SQL statements from teh data dictionary.
    Cheers, APC

  • Compare data between two tables of same schema

    Folks,
    I have one very intresting query which i would like to share with you all and looking forward for the solution asap.
    Scenario
    I have two table say TableA and TableB, both having same structre say as below
    TableA
    Col1 Var(10)
    Col2  INT
    TableB
    Col1 Var(10)
    Col2  INT
    I want to compare data between these two tables and store compared data into third table, let me expalin the whole scenario.
    TableA
    ColA          ColB
    INDIA          1
    PAKistan      2
    TableB
    ColA          ColB
    INDIA          1
    PAK             3
    I want result like
    Difference
    ColA          ColB
    True            0
    False           -1
    I want to store this difference in thrid table.
    i.e. when comparing text, i need TRUE when compare 100% else False, Caption is not considered.
         When comparing numeric value, simple sub is requried , TableA-TableB
    Note - I dont want to use any external tool to compare the table data, i required sql query to do the same.
    Thanks
    Amit Srivastava
    Amit
    Please mark as answer if helpful
    http://fascinatingsql.wordpress.com/

    Whereas the abbreviation of countries that exist in Table2 table are the first three letters of the name of the country*, here's a suggestion:
    -- code #1 v2
    INSERT into [Difference] (Col1, Col2, ACol1, BCol1)
    SELECT case when A.Col1 = B.Col1 then 'true' else 'false' end,
    (IsNull(A.Col2, 0) - IsNull(B.Col2, 0)), A.Col1, B.Col1
    from TableA as A full outer join
    TableB as B on (A.Col1 = B.Col1
    or Left(A.Col1, 3) = B.Col1);
    Is the COLLATE database case insensitive? If not, the code #1 above will have to be modified, using the upper () function or using COLLATE case insensitive in A.Col1 and B.Col1 columns.
    But if the abbreviation of the country follow the
    ISO 3166-1 alpha-3 standard, will require a fourth table containing the symbol and name of countries.
    -- code #2 v2
    ;with
    TableB_2 as (
    SELECT case when Len(Col1) = 3
    then (SELECT Country_name from [ISO 3166-1 a3] where Cod = Col1)
    else Col1 end as Col1, Col2
    from TableB
    INSERT into [Difference] (Col1, Col2, ACol1, BCol1)
    SELECT case when A.Col1 = B.Col1 then 'true' else 'false' end,
    (IsNull(A.Col2, 0) - IsNull(B.Col2, 0)), A.Col1, B.Col1
    from TableA as A full outer join
    TableB_2 as B on A.Col1 = B.Col1;
    Structure and data to test:
    use tempdb;
    CREATE TABLE TableA (Col1 varchar(10), Col2 int);
    CREATE TABLE TableB (Col1 varchar(10), Col2 int);
    CREATE TABLE [Difference] (Col1 varchar(10), Col2 int, ACol1 varchar(10), BCol1 varchar(10));
    INSERT into TableA values ('INDIA', 1), ('PAKistan', 2), ('China', 12);
    INSERT into TableB values ('INDIA', 1), ('PAK', 3), ('Bhutan', 3);
    go
    CREATE TABLE [ISO 3166-1 a3] (Cod char(3) primary key, [Country_name] varchar(30));
    INSERT into [ISO 3166-1 a3] values
    ('IND', 'India'), ('PAK', 'Pakistan'), ('CHN', 'China'), ('BGD', 'Bangladesh'),
    ('BTN', 'Bhutan'), ('MMR', 'Myanmar'), ('NPL', 'Nepal');
    go
    (*) If the short form of the country name using the first three letters of the country name,
    false positives can occur. For example,
    Mali and Malta or
    Angola and Anguilla.
    José Diz     Belo Horizonte, MG - Brasil

  • How to compare date between 2 file?

    hi there...
    is there any possibility to compare date between 2 file and the file that is latest to open?
    thank you

    i need help urgently..... i type tis code
    <%
    String file = ("C:/");
    File f = new File(file);
    String [] fileNames = f.list();
    File [] fileObjects= f.listFiles();
    %>
    <UL>
    <%
    for (int i = 0; i < fileObjects.length; i++) {
    if(fileObjects.lastModified()){
    %>
    <LI>
    <a href="<%= fileNames[i %">"><%= fileNames[i] %></A>
    <%
    %>
    my purpose is to list out all the file in the folder but not to the user just for the system to check all the files than when i click a link it will open the latest file
    Message was edited by:
    n_dilah</a>

  • Oracle-java How to fetch data between two Timestamps

    hai...
    I am using a program where i have to get all the data entered into oracle db between two dates
    (The first date being manually inputted and the second one is inputdate-24hrs) . The code is as follows....
    Connection c = null;
    PreparedStatement pStmt = null;
    ResultSet rs = null;
    try
    //eg  String dt=14/03/2007, hr=03, min=27, ampm=am
         DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
         DateFormat outForm = new SimpleDateFormat("yyyy/MM/dd");
         Calendar cl = Calendar.getInstance();
         Date inDate = new Date();
         inDate = dateFormat.parse(dt);
         cl.setTimeInMillis(inDate.getTime());
         cl.add(Calendar.DAY_OF_MONTH, -1);
         String str1 = outForm.format(new Date(cl.getTimeInMillis()));
         String str2 = outForm.format(dateFormat.parse(dt));
         System.out.println("Changed date = "+str1);
         System.out.println("Original date = "+str2);
         String toStr = str2+" "+hr+":"+min+" "+ampm.toUpperCase();
         String fromStr = str1+" "+hr+":"+min+" "+ampm.toUpperCase();
         System.out.println("From date = "+fromStr);
         System.out.println("To date = "+toStr);
    // For example, if u r confused, From date = 2007/03/14 03:27 AM
    //                            To date = 2007/03/13 03:27 AM
         String sql = "SELECT TRANS_ID, TO_CHAR(CONCAT('Rs.',TRANS_VALUE)) AS TRANS_VALUE, " +
                   "TO_CHAR(TRANS_DATE,'DD/MM/YYYY HH:MM AM') AS TRANS_DATE, ACCOUNT_ID,  " +
                   "TO_CHAR(CREATED_DATE,'DD/MM/YYYY HH:MM AM') AS CREATED_DATE, CREATED_BY, " +
                   "INSTR_D_BANK_CD FROM TRANS_TB WHERE " +
                   "ACCOUNT_ID=? AND TO_CHAR(TRANS_DATE,'YYYY/MM/DD HH:MM AM') " +
                   "BETWEEN ? AND ? ;
         c=ds.getConnection();
         pStmt = c.prepareStatement(sql);
         pStmt.setString(1, accountId);
         pStmt.setString(2, fromStr);
         pStmt.setString(3, toStr);               
         rs = pStmt.executeQuery();     
    }The problem is that i am not getting results as expected
    Can anyone point out if there is something wrong in the logic or in the program....

    But how to make that string to the Timestamp object.
    I tried this way but failed !!!
    // Eg :fromStr = 2007/03/14 03:27 AM
    //       toStr= 2007/03/13 03:27 AM
         SimpleDateFormat sdfOutput = new SimpleDateFormat("yyyy/MM/dd hh:mm a");
         Date fromDate = sdfOutput.parse(fromStr);
         Date toDate = sdfOutput.parse(toStr);
    SELECT TRANS_ID, TO_CHAR(CONCAT('Rs.',TRANS_VALUE)) AS TRANS_VALUE, " +
                   "TO_CHAR(TRANS_DATE,'DD/MM/YYYY HH:MM AM') AS TRANS_DATE, ACCOUNT_ID,  " +
                   "TO_CHAR(CREATED_DATE,'DD/MM/YYYY HH:MM AM') AS CREATED_DATE, CREATED_BY, " +
                   "INSTR_D_BANK_CD FROM TRANS_TB WHERE " +
                   "ACCOUNT_ID=? AND TRANS_DATE BETWEEN ? AND ? ;
    //Eg TRANS_DATE = "11-MAR-07 12.30.59.729000000 PM"(Timestamp)
    c=ds.getConnection();
         pStmt = c.prepareStatement(sql);
         pStmt.setString(1, accountId);
         pStmt.setString(2, fromDate);
         pStmt.setString(3, toDate);               
         rs = pStmt.executeQuery();     
         I think there is problem in both String-Date conversion and in the query.....

  • How to take data between two rising edge

    I would like to take waveform between two rising/falling edeg, I am using NI5102 VB6.0 with two input one is analog signal and the other is trigger input, start to read input signal when first trigger(rising/falling edge) and stop it by second trigger(rising/falling edge). 
    I have try to using counter CWcounter1.MeasurementType=... but the measurement tyep is not support my hardware.
    How to count two trigger to read signal??

    Hi,
    I looked more into your issue. Couple of questions. What are you using the counter for? Are generating sample clock for digitizer using counter?
    I am not sure why you need start trigger your application. But here is a solution I propose.
    Use reference trigger as triggering option and then set reference position as 0% (this will set pre-trigger samples to zero).
    Then perform multiple record acquisition. The advantage of using multi-record acquisition is that for every trigger, digitizer will acquire a record. Then you can fetch this data.
    So, whenever there is a trigger ... you acquire a record which can hold data for 8.3ms.
    If you have number of records greater than memory size of the digitizer, then there is an attribute NISCOPE_ATTR_ALLOW_MORE_RECORDS_THAN_MEMORY, setting this to true will allow you to have number of records greater than the memory size of the digitizer.
    You can specify number of number of records using NISCOPE_ATTR_HORZ_NUM_RECORDS
    Use NISCOPE_ATTR_FETCH_RECORD_NUMBER to acquire current record by linking it to index i of for loop.
    Use NISCOPE_ATTR_FETCH_NUM_RECORDS  to acquire only one record when trigger occurs.
    So,
    1) Set the program for multi-record acquisition
    2) Once trigger occurs, acquire current record using NISCOPE_ATTR_FETCH_RECORD_NUMBER and acquire only one record per trigger using NISCOPE_ATTR_FETCH_NUM_RECORDS.
    If not, you are not sampling at higher rates and you can also use a DAQ card with counter to acquire data using retriggerable acquisition.
    Let me know if this helps you.
    Kalyan
    Kalyanramu Vemishetty
    Automated Test Systems Engineer
    National Instruments

  • How to exchange data between two web application (servlet)

    Hello, all,
    I have two servlets: SerlvetA and ServletB, they are deployed as web appA and appB in the same web container(tomcat)
    How ServletA exchange data with ServletB?
    I have tried follow methods:
    1) appA and appB could not share HttpSession, so I could not transfer data through session
    2) I write a new sigleton java class called AppBroker, servletA get AppBroker's instance, and set some data into the it. ServletB could not get the same instance of the AppBroker, because the appA and appB use different class loader.
    tell me how to?

    thanks reply, but
    1. static class can not solve the problem, it is same
    as my sigleton class method, as different web app use
    different class loaderhmm... at least in tomcat this seems not be true since i can use static classes in one webapp that are available in another web app on the same host/servlet runner.
    Maybe if you build your own classloader than the "scope" of the static class is limited to that classloader (for my understanding this shouldn't be the case since i think it depends on the instance of the jvm and not of the classloader..?!).
    2. rmi and object serialization are too expensive!
    I am working on how to use jndi to solve this problem.
    And I think this maybe a Sevlet specification's
    shortcoming: maybe a Local Method as EJB local
    interface need been introduced into servlet spec.
    could you suggestion other methods?none at the moment. i guess the basic methods are listed.
    Maybe there's just one left, a really ugly one. Depending on what kind of data and how often you have to exchange you could think of building a file-based queue, i.e. a dir where you drop files in an read out from the other web app (maybe based on a file/directory listener). But this would only be an appropriate way to go for kind of email and messaging systems i guess...

  • Compare data between two tables all coullms

    Hi All,
    I have a task to compare data for the dev and prod data for the same table ,can some one please help me with the script for this ...
    Thanks in Advance..

     SELECT Foo.*, Bar.*
       FROM Foo
            FULL OUTER JOIN
            Bar
            ON Foo.c1 = Bar.c1
               AND Foo.c2 = Bar.c2
               AND Foo.cn = Bar.cn
     WHERE Foo.key IS NULL 
        OR Bar.key IS NULL; 
    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
    Blog : MS SQL Development and Optimization
    Blog : Large
    scale of database and cleansing

  • How to compare data in two data sources ?

    Hi,
    Avalaibilty : Two data Souces 1) Based on standard data available from External agencies ( FLAT FILE )
                                                      2) Generic Data Source having Source system as R3 Server.
    Requirement : To write a transfer routine such that each data transaction in the data field of R3 servers compares itself to the the respective data available in the external data source and updates the Infoprovider ( DSO ) accordingly .
    Exact problem : I want to check the no. of employees in my company that are using travel funds more than the iNdustry standard for the respective position and also if they are spending more than Industry standard altogether ( OR  Conditioon ) .
    What would be the structure of the Routines ? and how to comparre
    Mrinal

    Hi,
    Below logic can be used:
    Load the flat file data in DSO2. Then compare and insert the matching value a temp table TABLE1.
    SELECT <KF1>
               FROM <DSO1> INTO TABLE <TABLE1>
               WHERE <KF1> = <DSO2>/<KF2>;
    Then insert the contents of the temp table into the required CUBE/DSO.

  • Comparing Data between two tables with different structure

    Hi,
    I have 2 tables T1 and T2. Both tables have different structure. I have to check for rows missing in T1 which exist in T2 and vice-versa. I can do that using MINUS operator. But the part where the data exists in both T1 and T2, I have to compare some columns (9 columns the names of this column coming from a meta-data table) if they have same values. If not an exception has to be generated.
    Any help is appreciated.
    Thanks

    Hi,
    Whenever you need help on this forum, post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (4) Your best attempt so far
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing.
    What do you mean by "an exception has to be generated"?
    Do you want to raise an error?
    Do you want something to appear in the result set?
    MINUS finds rows that are in one result set, but not in another.
    INTERSECT finds rows that are in both result sets.
    Column names have to be hard-coded into the SQL statement.  If you want to write something now that will get column names from a metadata table sometime in the future, then you have to use dynamic SQL.  SQL*Plus sometimes has quick and dirty ways of doing dynamic SQL, so say whether you're using SQL*Plus or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to move data between two similar tables?

    Hi All,
    I have two tables with almost the same columns. Table A has 50 columns, Table B has 51 columns, which are defined exactly the same except one more column as LOAD_TIME.
    Is there any easy way for me to move the data from Table A to B? the Extra column LOAD_TIME will be set as current system time. All I want is to avoid list all 50 column names. The following SQL has error ORA-00923 error.
    INSERT INTO TB_B
    SELECT *, sysdate from TB_A;
    Thanks,

    939569 wrote:
    Hi All,
    I have two tables with almost the same columns. Table A has 50 columns, Table B has 51 columns, which are defined exactly the same except one more column as LOAD_TIME.
    Is there any easy way for me to move the data from Table A to B? the Extra column LOAD_TIME will be set as current system time. All I want is to avoid list all 50 column names. The following SQL has error ORA-00923 error.
    INSERT INTO TB_B
    SELECT *, sysdate from TB_A;
    Thanks,You could create a view based on TB_A.
    However i don't understand why you feel the need to avoid specifying the columns. That's a better way to code.
    Granted, i also don't understand why you'd have 2 copies of the same data, the only differentiation being when you copied the data from the source to the redundant table.
    Cheers,

Maybe you are looking for

  • How can I get apple to replace my macbook air?

    I purchased a macbook air in mid 2012. It's 13-inch 1.8 GHz Intel Core i5. Anyways, since I've had this particular computer I've had to take it in on 3 occasions because it kept shutting off, or crashing anything I ran. They have replaced the logic b

  • Moving Events and iPhoto library to a new Mac

    I just picked up a new Mini for my HTPC. I would like to move the Events and photos that I already have on my other Macs to the new one. I exported all of the photos to a flash drive and then imported them in on the new Mini, but of course it just im

  • How do I remove the Tools Pane Permanently in Adobe Reader DC?

    I have just installed Adobe Acrobat Reader DC version 2015 Release and it has a very annoying bug/feature that I don't like. I have to keep removing the Tools Pane using using SHIFT+F4 every time. Is there a way to make this pane dissapear permanentl

  • Problem with quicktime movie

    Hi all, I am trying to make some first steps with the video editing in photoshop cs6 but I cant make past stage one....getting a file to open properly. I shot some video on my panasonic gf1. Its a .mov file. When I look at it in bridge, or open it in

  • Posting againt asset purchase order

    Hi, We are careating purchae order against assest.When u are posting f-48 with same purchase order then get following error " Enter value will be exceeded" if i given less amount against purchase order amount then simulate document . could u give sug