How to insert the data if the data in the two tables doesn't match.

Hi,
I have requirement like,I have to insert the data by comparing the two tables based on the date field.If they both are equal then the data shouldn't be inserted if not the data has to be inserted.
Can some one help me on this ASAP.
Regards,
Sudha
sudha

Hi,
Thanks for the reply,i would like to know the way that we can design the packages
sudha
You have multiple ways of implementing this
1. Using Lookup Task
http://www.sqlis.com/sqlis/post/Get-all-from-Table-A-that-isnt-in-Table-B.aspx
2. using SCD wizard
http://www.bimonkey.com/2009/07/the-slowly-changing-dimension-transformation-part-1/
3. using hashing
http://visakhm.blogspot.in/2014/06/ssis-tips-implementing-scd.html
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • How to insert some strings in a query with the clausule 'in' in a procedure

    Hello fellows.
    Do you know how to insert some strings in a query with the clausule 'in' in a procedure (with a variable)?.
    I tell us my problem with an example:
    I want to use this select but introducing a variable instead the 'value1', 'value2':
    select * from table1 where field1 in ('value1', 'value2');
    if I declare the variable var1 as:
    TC_VAR1 CONSTANT VARCHAR2(50) := '''value1'',''value2'''
    and I use it as:
    select * from table1 where field1 in (TC_VAR1);
    It doesn't work because Oracle takes TC_VAR1 as an all string. I think Oracle takes it as this:
    select * from table1 where field1 in ('value1, value2');
    If I use the data type TABLE, I don't know how to use well:
    TYPE varchar2_table IS TABLE OF VARCHAR2(10);
    tb_var varchar2_table;
    select * from table1 where field1 in (tb_var);->It returns an error and there ins't an method that it returns all values.
    A curious case is that if I have a sql script (for example script1.sh) with this query:
    select * fromt able1 where field1 in (&1)
    and I invoke this script as
    script1.sh "'''value1'',''value2'''". It works
    Can anybody helps me?.
    Thanks.

    Thanks to all. Really.
    First, sorry for my English. It's horrible. Thank to all for understand it (my English).
    I've resolved my problem with these links:
    ORA-22905: cannot access rows from a non-nested table item
    and
    http://stackoverflow.com/questions/896356/oracle-error-ora-22905-cannot-access-rows-from-a-non-nested-table-item
    At last, I have used someting like this:
    DECLARE
    number_table_tmp NUM_ARRAY:=NUM_ARRAY(410673, 414303, 414454, 413977, 414042, 414115, 413972, 414104, 414062);
    BEGIN
    FOR c1 IN (SELECT par_id, 1 acc_vdo_id FROM SIG_VIS_CAM
    WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))
    UNION ALL
    SELECT par_id, 2 acc_vdo_id FROM SIG_ACCAO a
    WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))) LOOP
    NULL;
    END LOOP;
    END;
    but first I had to create the type NUM_ARRAY like this:
    CREATE TYPE subjectid_tab AS TABLE OF NUMBER INDEX BY binary_integer;
    THANK YOU, GUYS. YOU ARE THE BESTS. ;-)
    Edited by: user12249099 on 08-sep-2011 7:37
    Edited by: user12249099 on 08-sep-2011 7:37

  • How to insert, as an input variable within formula, the total time window on scope?

    How to insert, as an input variable within formula, the total time window on scope (i.e. 20ms/div x 10 div = 200ms)?
    BELOW IS AN EXAMPLE OF ISSUE:
    FORMULA FOR ACTION INTEGRAL:
    STATISTICS:
    Input variable: DPO4034(CH1);
    Check Box: number of samples.
    FORMULA
    Input variable 0: DPO4034(CH1); alias: x0
    Input variable 1: "Total Time Window on Scope???"; alias: x1
    Input variable 2: Number of Samples (CH1); alias: x2
    Under Operation Setup: Formula
    Y= (x0^2)*(x1/x2)
    Output: Processed Data 1 (CH1)
    THEN USING STATISTICS:
    Input signal: Processed Data 1 (CH1)
    Check Box: SUM
    Output: CH1 Action Integral [A^2s]
    Solved!
    Go to Solution.

    Hi again Catherine,
    I have now added another TekScope (TDS3032B) along with the DPO4034 and run the same work-around on the TDS3032B using CH1 as the "real" signal channel and CH2 as the "burst width" channel. However, the value returned for CH2 is nominally 99E+36 (min 99E+36, max 99E+36) with very few retrievals of correct burst width (~200ms). Seems the SignalExpress program is unable to consistently retrieve from TDS3032B the actual burst width (scope's time scale/window) and defaults to 99E+36 value. Any ideas on what is occurring and how to make it work? Attached are some screen captures to help guide discussion.
    Regards,
    Michael
    Attachments:
    TDS3032B - incorrect burst width.png ‏301 KB
    TDS3032B - correct burst width.png ‏287 KB
    DPO4034 - always correct burst width.png ‏302 KB

  • Cartesian of data from two tables with no matching columns

    Hello,
    I was wondering – what’s the best way to create a Cartesian of data from two tables with no matching columns in such a way, so that there will be only a single SQL query generated?
    I am thinking about something like:
    for $COUNTRY in ns0: COUNTRY ()
    for $PROD in ns1:PROD()
    return <Results>
         <COUNTRY> {fn:data($COUNTRY/COUNTRY_NAME)} </COUNTRY>
         <PROD> {fn:data($PROD/PROD_NAME)} </PROD>
    </Results>
    And the expected result is combination of all COUNTRY_NAMEs with all PROD_NAMEs.
    What I’ve noticed when checking query plan is that DSP will execute two queries to have the results – one for COUNTRY_NAME and another one for PROD_NAME. Which in general results in not the best performance ;-)
    What I’ve noticed also is that when I add something like:
    where COUNTRY_NAME != PROD_NAME
    everything is ok and there is only one query created (it's red in the Query plan, but still it's ok from my pov). Still it looks to me more like a workaround, not a real best approach. I may be wrong though...
    So the question is – what’s the suggested approach for such queries?
    Thanks,
    Leszek
    Edited by xnts at 11/19/2007 10:54 AM

    Which in general results in not the best performanceI disagree. Only for two tables with very few rows, would a single sql statement give better performance.
    Suppose there are 10,000 rows in each table - the cross-product will result in 100 million rows. Sounds like a bad idea. For this reason, DSP will not push a cross-product to a database. It will get the rows from each table in separate sql statements (retrieving only 20,000 rows) and then produce the cross-product itself.
    If you want to execute sql with cross-products, you can create a sql-statement based dataservice. I recommend against doing so.

  • I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas

    I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas?

    Answered in your Other post on this Topic...
    https://discussions.apple.com/message/24053626#24053626

  • How to prevent Oracle from using an index when joining two tables ...

    How to prevent Oracle from using an index when joining two tables to get an inline view which is used in an update statement?
    O.K. I think I have to explain what I mean:
    When joining two tables which have many entries sometimes it es better not to use an index on the column used as join criteria.
    I have two tables: table A and table B.
    Table A has 4.000.000 entries and table B has 700.000 entries.
    I have a join of both tables with a numeric column as join criteria.
    There is an index on this column in table A.
    So I instead of
      where (A.col = B.col)I want to use
      where (A.col+0 = B.col)in order to prevent Oracle from using the index.
    When I use the join in a select statement it works.
    But when I use the join as inline view in an update statement I get the error ORA-01779.
    When I remove the "+0" the update statement works. (The column col is unique in table B).
    Any ideas why this happens?
    Thank you very much in advance for any help.
    Regards Hartmut

    I think you should post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your query resp. update statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Usually if you're using the CBO (cost based optimizer) and have reasonable statistics gathered on the database objects used the optimizer should be able to determine if it is better to use the existing index or not.
    Things look different if you don't have statistics, you have outdated/wrong statistics or deliberately still use the RBO (rule based optimizer). In this case you would have to use other means to prevent the index usage, the most obvious would be the already mentioned NO_INDEX or FULL hint.
    But I strongly recommend to check in first place why the optimizer apparently seems to choose an inappropriate index access path.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to insert a new page when data don't fill in the principal page?

    Hi to everybody!!
    I don't know how to do this, I have, in the main window a table with a loop, the loop is this
    XFORM INTO ZXFORM (where Xform is type PC408) and in line to line I put the line for example 25 to 30.
    Under this table I have another table to another type of data....
    The problem is that in the case the data exceed the 25 to 30 lines...where I can see this data? How can I make a new page with the exceed data and how I can retrieve?
    Thanks and regards
    Rebeca

    Try this, it will help you to close the thread.
    for displaying new page
    Inside you form
    /E   POS_NEWPAGE   "Element
    /:   NEW-PAGE
    Inside your driver program...
    Calls a New Page
          CALL FUNCTION 'WRITE_FORM'
               EXPORTING
                    element = 'POS_NEWPAGE'
               EXCEPTIONS
                    OTHERS  = 1.
    Regards,
    SaiRam

  • How to insert 10 rows at a time in the oracle

    how ti insert r update 10 query at a time in the oracle

    You can do a small test to find it out.
    SQL> set serveroutput on
    SQL> drop table t
      2  /
    Table dropped.
    SQL> drop table s
      2  /
    Table dropped.
    SQL> create table s(no integer, name varchar2(4000))
      2  /
    Table created.
    SQL> create table t(no integer, name varchar2(4000))
      2  /
    Table created.
    SQL> insert into s
      2  select level, rpad('*',4000,'*')
      3    from dual
      4  connect by level <= 10000
      5  /
    10000 rows created.
    SQL> commit
      2  /
    Commit complete.
    SQL> declare
      2     ltime integer;
      3  begin
      4     ltime := dbms_utility.get_time;
      5
      6     for i in (select * from s)
      7     loop
      8             insert into t(no, name) values(i.no,i.name);
      9     end loop;
    10
    11     ltime := dbms_utility.get_time - ltime;
    12
    13     dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
    14     commit;
    15  end;
    16  /
    Exec Time:17.22 Seconds...
    PL/SQL procedure successfully completed.
    SQL> truncate table t
      2  /
    Table truncated.
    SQL> declare
      2     type my_type is table of s%rowtype;
      3     lType my_type;
      4     ltime integer;
      5  begin
      6     ltime := dbms_utility.get_time;
      7
      8     select * bulk collect into lType from s;
      9
    10     forall i in 1..lType.count
    11             insert into t values lType(i);
    12
    13     ltime := dbms_utility.get_time - ltime;
    14
    15     dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
    16
    17     commit;
    18  end;
    19  /
    Exec Time:6.27 Seconds...
    PL/SQL procedure successfully completed.
    SQL> truncate table t
      2  /
    Table truncated.
    SQL> declare
      2     ltime integer;
      3  begin
      4     ltime := dbms_utility.get_time;
      5
      6     insert into t select * from s;
      7
      8     ltime := dbms_utility.get_time - ltime;
      9
    10     dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
    11
    12     commit;
    13  end;
    14  /
    Exec Time:3.26 Seconds...
    PL/SQL procedure successfully completed.Thanks,
    Karthick.

  • How to insert a character and paragraph break at the beginning of a paragraph using Grep

    Dear Community!
    I am stucked...
    I have several books in indesign, which I want to export into epub. I have a standardized procedure, to be able to assign the task to students.
    My problem i I have a paragraph style 'heading2' and I would like to insert a paragraph break before which is styled 'new page'.
    Here is the theory I have thought about:
    -with find and change find the style 'heading2'
    -insert a special character + paragraph break before the first character of the paragraph
    -with a second find and change find the special character
    -replace with nothing and style with 'new page'
    My question is how to insert with grep (?) before the first character anything.
    Please help me!
    Thanks in advance
    ND

    Look in the flyout panel of your Paragraph panel.
    (Or in the Online Help -- a resource a lot of people seem to overlook... It's even *called* "Keep Options". ...
    >I have a problem along these lines that I have not found the answer to by searching, and neither have I been able to start a new discussion on this. (These forums are kind of hard to figure out)
    ... on the top right of THIS web page I can see a heading "Actions", with below it the text "Start a discussion" ...)

  • How to insert varchar type value to date type value

    Hai All
    There are two table T1,T2
    T1 has these fields code varchar,time varchar, date date
    T2 has these fields intime date, outtime date intrin date ,introut date
    I have tried to move time to intime Ie from T1 to T2
    update T2 set intime= to_date((r1.bartime||r1.bardate,'dd-mom-yyyy hh24mi')) ..... like this but i got an error
    list of values not allowed as argunment to this function or procedure
    Regards
    Srikkanth.M

    Hai Prayz
    T1
    code var
    time var
    date date
    Code time date
    01 0815 10-02-2010
    01 1115 10-02-2010
    01 1215 10-02-2010
    01 1715 10-02-2010
    02 0815 10-02-2010
    02 1715 10-02-2010
    T2
    code var,intime date,intrin date introut date outtime date att_date date
    code intime intrin introut outtime attend_date
    01 10-02-2010 0815 10-02-2010 1115 10-02-2010 1215 10-02-2010 1715 10-02-2010
    02 10-02-2010 0815 10-02-2010 1715 10-02-2010
    Regards
    Srikkanth.M

  • HT5624 I am trying to reset my password for my apple id.  When asked I enter my date of birth and I am told it doesn't match what itunes has on file.  HELP!  I am not getting any emails to reset the id either.

    I am trying to reset my password for apple id.  I entered my d.o.b. tells me info doesn't match.  I tried reseting through email but am not
    getting any emails to reset it.  HELP!

    Go to the Apple ID Security site from http://support.apple.com/kb/HT5699 or call the AppleCare support number from http://support.apple.com/kb/HE57 and ask to speak with the Account Security Team...either can help you reset your questions/answers.

  • After Transfer of data to a new comp., old admin name doesn't match new adm

    I'm having issues with Word for Mac since I installed Fusion. I am trying to uninstall Word for Mac but I get the message: "You do not have permission. Log into the same Mac OS user Acct that you used to Install office and try again".
    I recently bought a new MacPro to replace my G5 and had the Apple store transfer data from my old mac to my new one.
    Apparently I used a different variation of my name on my old G5 when I installed Word for Mac than I did on my new mac, and the old name transfer with the date. But I have no idea how to log into the old account, or how to make an account for the old name not knowing the old name.
    any suggestions, or work arounds for uninstalling Word for Mac?
    The problem with Word,is that the menu and tool bar comes up, but I can't open any documents.
    Thanks
    Bill

    had to wipe and reload

  • Why the change in 7 so what is on iTunes doesn't match what is on the iPod?

    For podcasts in 6, if you let iTunes handle the sync and set it to "keep all unplayed", podcasts were not removed from iTunes until the "last played date" was populated. This allowed partially played podcasts to remain on the iPod until completed.
    Now in 7, with the same settings, podcasts are removed from the iPod when the "unplayed flag" (blue dot in iTunes list) is off - which happens if it is played for any length (even if it was accidental - no way to reset the flag on iPod). It is not deleted from iTunes until the "last played date" has been filled in (when the last second of the file has been played). If you reset the unplayed flag on iTunes, it also resets the pointer in the file, so you lose your place of what you were listening to.
    So effectively, in 6, iTunes and iPod both showed the same things (files and pointers) when you sync-ed. In 7, they don't and won't as "keep all unplayed" is not treated the same for both.
    WHY? It was working. WHY CHANGE IT?!
    If you wanted to "fix" something:
    Get the iTunes to treat podcasts differently that other files. If my settings say "only sync podcasts marked in the list" then podcasts that are not marked in the list shouldn't be copied to my iPod. They don't show up in the podcast area but THE INDIVIDUAL FILES ARE COPIED INTO THE MUSIC SECTION! That takes up space on my iPod for things I set not to be there in the preferences! The only way to stop it is to set "sync only checked selections" and go thru the podcasts and individually "uncheck" everything in the podcasts I set for it NOT to include in the first place. Which also means that has to be done manually over and over when new podcasts I ONLY want on my PC in iTunes get new episodes.

    This Apple knowledge-base article may help address that issue.
    Strange iPod behaviour.

  • How to insert a delay in cbs file in between two commands?

    Hi,
    This is an example/sample of cbs file I am using for Essbase Cube Refresh.
    LOGIN 10.128.129.200
    SETSOURCE "DSN=AAA";CODEPAGE=English_UnitedStates.Latin1@Binary;UID=aaaaa;PWD=bbb;"
    SETTARGET "DSN=cccc;UID=nnnn;PWD=hbvhhv;"
    SETCATALOG "DSN=EIS_Catalogue;CODEPAGE=English_UnitedStates.Latin1@Binary;UID=hypsql;PWD=241790311301150311740540601;"
    LOADMEMBER"APP=adddd;DBN=dbbbbb;OTL=oooooot;FLT_ID_MEMBER=1;FLT_ID_DATA=1;DELETE_DB=Y;ALT_SRC_TBL=;"
    STATUS
    LOADDATA "APP=adddd;DBN=dbbbbb;OTL=oooooot;FLT_ID_MEMBER=1;FLT_ID_DATA=1;DELETE_DB=Y;ALT_SRC_TBL=;"
    STATUS
    After LOADMEMBER, I want the cbs file to wait for a few seconds and then go for LOADDATA.Can anyone help me on this?

    Hi,
    On executing the below cbs(only for Member load) through batch,
    LOGIN 10.128.127.231
    SETSOURCE "DSN=PPM-DEV;CODEPAGE=English_UnitedStates.Latin1@Binary;UID=PPMConnect;PWD=041570601070980;"
    SETTARGET "DSN=uk-hyp-eu-003t;UID=NNNNN;PWD=00137099;"
    SETCATALOG "DSN=EIS_Catalogue;CODEPAGE=English_UnitedStates.Latin1@Binary;UID=hypsql;PWD=2417150311740540601;"
    LOADMEMBER "APP=PPMPUR11;DBN=PUR11;OTL=PURCH_DEVOTL;FLT_ID_MEMBER=1;FLT_ID_DATA=1;DELETE_DB=Y;ALT_SRC_TBL=;"
    STATUS
    I am getting the below log.
    [LOCAL] -> LOGIN:
    [10.128.127.231] -> SETSOURCE:
    [10.128.127.231] -> SETTARGET:
    [10.128.127.231] -> SETCATALOG:
    [10.128.127.231] -> LOADMEMBER:
    [10.128.127.231] -> STATUS:
    Executed client request 'Load members synchronously' in 24 seconds
    [10.128.127.231] ->
    [10.128.127.231] -> EXIT:
    In this execution of cbs actually some records are rejected.So I am expecting 'IS Error:Member Load Completed with errors' in the Status row.But the present case is deviating.
    I guess the reason is that I should try to read the status of member load after the command prompt arrow appears(next line).I got to know this from EIS Sys Admin doc.
    How to handle the case in Cbs File and how to capture the actual errors like records rejection?

Maybe you are looking for

  • Phone in recovery mode?

    I just upgraded from the 1st gen to a 3gs 16g I came home to sync new to old, when i plugged in the old, i needed to update so i did it updated then said it was transfering, then when it got done instead of saying sync complete, it said phone in reco

  • Applying Patch 92021 to Oracle 9201 DB

    Hello All; I'm trying to apply the patch 92021 to my DB on windows platform. 1- from Services I stopped all Oracle Services. 2- I installed the patch successfully. 3- Now I want to do the post install tasks. (startup migrate , spool patch.log, @rdbms

  • Layout malfunction with a custom JList cellrenderer

    Hello everybody! I have encountered a strange problem: I've got a JPanel that uses GridBagLayout with an image (map) on the right side, and two JLists on top of one another on the left side. They both have a custom cellrenderer that displays rows of

  • Exchange Server 2010: Convert Mailbox to MailUser

    Dear All, I plan to cutover migration exchange on-premises to exchange online with single-sign-on. http://community.office365.com/en-us/w/exchange/835.cutover-exchange-migration-and-single-sign-on.aspx In Step 2: It need to Convert on-premises mailbo

  • How to let intuit auto update

    it will not let intuit onto TurboTax site