MERGE Statement Problem for Storing Old Data

Hi,
I am using MERGE statement to update as well as insert rows on ta table.
I have a data like in a table 'TABLEA' as 10 20 30 ABCD
I want to update the table using 10 20 30 DEFG but i want the old data i.e 10 20 30 ABCD
to store in a History table i.e TABLEA_H.
Is there any way to store the data
Any help will be needful for me

Hi,
Trigger usage may affect the performance as we are handling Production environment.
is there any way to implement the scenario without using Triggers?
Any help will be needful for me

Similar Messages

  • I transferred data from my Macbook Pro to my Mac mini but it forced me to make a new user for my old data.  How do I transfer my music, pics, and docs from the "old" user to the new user (so that I only have one user instead of 2?)

    I transferred data from my Macbook Pro to my Mac mini but it forced me to make a new user for my old data.  How do I transfer my music, pics, and docs from the "old" user to the new user (so that I only have one user instead of 2?)

    Unless you transfer the files from Setup Assistant, Migration Assistant creates a new user with the data.
    To transfer the files to your first user, you have to log on this new user, and copy all your files to /Users/Shard folder. This is a folder where you can put the files you want to share between two or more users, and all users can read and write in it.
    After copying the files, go to your first user, open /Users/Shared folder, and copy the files to your user folders. If you migrated applications, you must know that they are stored in a common folder (/Applications), so you don't have to transfer them. To open /Users/Shared folder, open Go menu (in the menu bar) > Go to Folder, and type the folder

  • PDF form storing old data

    Hello, I am new to the forum and was hoping someone here would be able to help me with an issue I have run into or help me find someone who could.
    I was recently working on a security assessment of a website and I found a PDF document for an employement application that appears to store old data within the code of the document. To explain further:
    - I found the PDF form document on the website. When downloaded and opened with Reader it appears blank. The document is avaiable to download and then you are directed to email it to HR, so there is no online submission on the website.
    - When opened in a text editor it displays mostly encoded text and numbers but there is portion of the document with lines that correspond to the fields in the document and contain information from previous instances of the document that has been filled out.
    Has anyone encountered this before? If yes are there any remediations for a PDF form storing unwanted data within the code of the document?
    Thanks in advance and sorry if I have posted this in the wrong location.

    Filling in online forms should never allow the form to be saved back to the website.  Usually such a form (or any online document) would go to the user's browser's temp folder, and be saved in there.  I don't know how it was possible that user data got back onto the web server form (unless it was originally uploaded like that).
    What I would do if I encountered such a situation
    upload the clean, empty form
    make sure the file is read-only
    test it by filling in the form online
    see if the original form has been altered in any way

  • Update statement problem for jdbc adapter

    Hi all
    In the jdbc sender adapter, I configured as follows:
    Query statement
    select * from pickdiff where tid is null
    Update statement
    delete from pickdiff where tid is null
    I got following error message:
    Database-level error reported by JDBC driver while executing statement 'delete from pickdiff where tid is null'. The JDBC driver returned the following error message: 'java.sql.SQLException: [SQLServer 2000 Driver for JDBC][SQLServer]Die Unterabfrage gab mehr als einen Wert zurück. Das ist ungültig, wenn die Unterabfrage auf =, !=, <, <= , >, >= folgt oder als Ausdruck verwendet wird.'. For details, contact your database server vendor.
    If I change the Update statement to
    update pickdiff set tid = 'sapxi' where tid is null
    Then everything is ok.
    Doese any one have some idea about this problem?
    Regards
    Hui

    Hi,
    The below statements are from SAP help...
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm
    The UPDATE statement must alter exactly those data records that have been selected by the SELECT statement. You can ensure this is the case by using an identical WHERE clause. (See Processing Parameters, SQL Statement for Query, and SQL Statement for Update below).
    &#9679;      Processing can only be performed correctly when the isolation level for transaction is set to repeatable_read or serializable.
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
    processed is the indicator in the database.
    please see if setting the isolation level would help....Also are you getting this error always or is it intermitent ?
    Thanks,
    Renjith

  • Common Practice For Storing Application Data Files

    During my application development targeting for XP and Linux time, I will store my application data files (Files where user may create, modify, rename, delete...) same path as my application directory. For instance, if my application is installed in :-
    C:\Program Files\MyApp\MyApp.jar
    All my application data files will be located in
    C:\Program Files\MyApp\Config\ directory.
    This works quite well until Vista introduce UAC. Vista will not allow write opration to C:\Program Files\MyApp\Config\ folder (Config folder is being created during installer execution). However, to support legacy application, Vista use a workaround (Virtualization) for application to write. For example, MyApp.jar want to perform write on
    Real path :-
    C:\Program Files\MyApp\Config
    Vista will redirect it to :-
    Virtual path
    C:\Users\<account>\AppData\Local\VirtualStore\Program Files\MyApp\Config
    Please refer to the links for more detail
    [http://www.codeproject.com/KB/security/acl_common_data.aspx?display=Print]
    [http://www.codeproject.com/KB/vista-security/MakingAppsUACAware.aspx]
    However, this introduce several additional problems [http://support.microsoft.com/kb/927387]
    May I know what is the common practice for storing an application data files? The below are my several thoughts
    (1) Writing to
    * Windows XP - %systemdrive%\Documents and Settings\All Users\Application Data
    * Windows Vista - %systemdrive%\ProgramData
    * Windows 2000 - %systemdrive%\Documents and Settings\All Users\Application Data
    * Windows Server 2003 - %systemdrive%\Documents and Settings\All Users\Application Data
    * Windows 98 - %systemdrive%\Windows\All Users\ Application Data
    which we may retrieve through "CommonApplicationData", using the API function SHGetFolderPath. However, how can we do that in Java? How to make compatible with Linux?
    (2) Writing to user home directory through "user.home" properties. Create a folder .MyApp and write the application data on it.
    Any input and suggestion are welcomed.
    Thanks!
    cheok

    >
    ...I will store my application data files (Files where user may create, modify, rename, delete...) same path as my application directory. >See [Store Application Settings and Components|http://sdnshare.sun.com/view.jsp?id=2305] for code that will put the required parts in a suitable sub-dir of user.home.

  • Using XSU for Storing XML data

    Please how can I use the XSU API for storing XML documents in Oracle8i? I know part of the code to store a document but how do I import the XSU API?
    Do I have to download it or use it via Oracle?
    example:
    String xmlDoc = "my_xml_document";
    Connection conn = >>DriverManager.getConnection(...);
    OracleXMLSave sav = new OracleXMLSave
    (conn,"purchaseOrderTab");
    sav.insertXML(xmlDoc);But how do I use OracleXMLSave? How do I import the XSU API?
    thanks for your help
    null

    What is XSU? I think you question should be posted at the XML or XDK forum.

  • Best Practice for Storing Spatial Data in Multiple Projections?

    From what I've been able to determine MS SQL can't do reprojections is that correct? Assuming it is, the state of Washington requires that our GIS data be managed in Washington Stat Plane South
    but for our web mapping sites need the data in Web Mercator.  Is it OK then to have two geometry columns in a spatial enabled table, say a county table, one in WSPS and the other in WM? 
    I’m coming at this from a 30 year background in GIS using ESRI software. 
    Usually we would store the shape / geometry in one projection and project it to other on the fly when needed. 
    That way there is only one definitive source.  I don’t see a way to do this in MS SQL.

    Hi Scott.
    Storing two columns of spatial data is fine in SQL Server. And you are correct that there is no built-in reprojection in SQL Server, most folks do that as part of data loading. There was talk of porting parts of ogr2ogr to SQLCLR, but I don't think anyone
    did that.
    Cheers, Bob

  • Retirval problem for the old-new values from cdhdr,cdpos

    hi all.
    i want to get the old and new values from cdhdr and cdpos table but not getting the output as the if condition of read statement" if i_cdhdr-objectid = itemp-kunnr." is not getting executed.what could be the mistake and how can i resolve.plz suggest
    loop at it_knb1.
    itemp-kunnr = it_knb1-kunnr.
    itemp-kunnr1 = it_knb1-kunnr.
    append itemp.
    endloop.
    if not itemp[] is initial.
    select * from cdhdr
    into table i_cdhdr
    for all entries in itemp
    where OBJECTCLAS = 'DEBI'
    and   OBJECTID   = itemp-kunnr
    and  tcode      = 'VD02'.
    select * from cdhdr
    appending table i_cdhdr
    for all entries in itemp
    where OBJECTCLAS = 'DEBI'
    and   OBJECTID   = itemp-kunnr
    and   tcode      = 'XD02'.
    endif.
    if not i_cdhdr[]  is initial.
    select * from cdpos into table i_cdpos
    for all entries in i_cdhdr
    where OBJECTCLAS = i_cdhdr-OBJECTCLAS
    and   OBJECTID   = i_cdhdr-OBJECTID
    and   TABNAME    = 'KNVV'
    and   (  FNAME = 'ZTERM' ).
    endif.
    loop at it_knb1 where kunnr = it_kna1-kunnr.
    read table itemp with key kunnr1  = it_knb1-kunnr.
    if sy-subrc = 0.
    loop at i_cdhdr.
    if i_cdhdr-objectid = itemp-kunnr.
    it_final-username = i_cdhdr-username.
    clear i_cdpos.
    read table i_cdpos with key OBJECTCLAS = i_cdhdr-OBJECTCLAS
                                 OBJECTID   = i_cdhdr-OBJECTID
                                 FNAME = 'ZTERM'.
    if sy-subrc = 0.
        it_final-zterm_old  = i_cdpos-value_old.
        it_final-zterm_new  = i_cdpos-value_new.
      endif.
    endif.
    endloop.
    endif.
    endloop.

    Hi Tanisha,
    BEtter to loop everything cdhdr and CDPOS
    U can do one thing.
    Use CHANGEDOCUMENT_READ_HEDAER to get the data from CDHDR.
    SUE FM CHANGEDOCUMENT_READ_POSTIONS.
    to get the data from the each change number.
    then u can retrieve the data as u want.
    This will avoid confusion.
    U can get the correct data.
    Thanks

  • Tools for dedupe & old data

    Hi,
    We have an old Windows Server 2003 file cluster and we are planning on migrating our data to a new solution, unsure where the data will live just yet... cloud or on-site, who knows!
    We have approx. 3TB of data.
    Before we make any decisions we need to know how much duplicated data we hold and also how much of it hasn't been accessed for X amount of time. Would also be nice to know what type of data we have, like a breakdown of '.doc', 'jpg', 'mpeg' etc...
    Can anyone recommend any tools that can help provide me with this information?
    Cheers!
    Matt
    This topic first appeared in the Spiceworks Community

    Hi,
    Trigger usage may affect the performance as we are handling Production environment.
    is there any way to implement the scenario without using Triggers?
    Any help will be needful for me

  • Help!!  problem for insert a date in postgre from creator

    i formatt the date, and this code:
    SimpleDateFormat sdm=new SimpleDateFormat("dd-mm-yyyy)";
    Date fecha= sdm.parse("12-05-2007");
    compraDataProvider.setValue("fecha",rw,fecha);
    display this error
    Can't infer the SQL type to use for an instance of java.util.Date. Use setObject() with an explicit Types value to specify the type to use.

    postgres (PostgreSQL) 8.0.13
    postgresql-8.0-319.jdbc3.jar
    i have the same problem with postgresql
    i cant insert a row in a table with two columns codigo and name
    public String salvar_action() {
    CachedRowSetDataProvider cdp = getHombreDataProvider();
    try {
    RowKey rk = cdp.appendRow() ;
    cdp.setCursorRow(rk) ;
    cdp.setValue("hombre.codigo",rk,codigo.getText()) ;
    error("paso aqui 1");
    cdp.setValue("hombre.nombre",rk,nombre.getText()) ;
    error("paso aqui 2");
    cdp.commitChanges() ;
    info("Row Inserted via Data Provider") ;
    cdp.refresh(); // release rowset memory.
    } catch (Exception ee) {
    error( ee.getMessage() ) ;
    return null;
    did the same thing with firebird and no problem.. doing that..
    anyone knows some solution?

  • Would system level backups be acceptable for storing old db backups?

    Lets say that you use RMAN to make and then store backup images on a centralized on-line storage media. Access to recent backup data can be acquired via the online storage but eventually data must be removed or archived to another media or storage.
    Would it be an acceptable practice to use system level backups (backups of the whole on-line storage server) and then use that as the source to retrieve archived database data?
    If not, can you list some reasons why this would not be acceptable?
    Thanks

    Thanks for the quick response. The scenario that I was describing entails having the full RMAN backup images including archive logs on on-line storage media. This centralized storage media may be storing many instances and for each instance there may be several backup images.
    I thought that since each database may have it own archiving requirements that lumping all of the changed files from the whole online storage server and making a copy of that might introduce issues when it came time to trying to restore data for a specific database.
    I guess the main issue (if it is even an issue) would be system-level vs database-level archiving to tape.
    If RMAN is used to store backup images online and then those need to be moved to tape is this usually done at the database level or system level?
    While I know Oracle internals pretty well I don't have much experience in best practices for backing up database to tape and needing to get to that data in the future.
    Thanks again.

  • Client-side transient model for storing temporary data

    We've been using the ODataModel in our UI5 application for retrieving data from Gateway and now we have a requirement to store temporary (session based) client-side data.  Ideally it would be stored in such a way that it can be shared across views and controllers and can be bound from UI components via property bindings.  The data in most cases will be OData entities.  As an example a user would view a list of PO's (from the ODataModel) in the first view, then select a subset of POs and move onto the next view to "work" on those POs.  We'd want to store this subset of POs in a client model so the second view can bind to the model and display them.
    My first thought is to create another model separate from our ODataModel in which we could add transient client-side data (OData entities and custom data) and make it available to all views and controllers in the app.  I realize we could probably also just store such data in global JS variables, however a client-side model seems like a cleaner approach to me.
    I'd appreciate any suggestions on how this can be achieved.

    Hi Derek,
    why don't you just use sap.ui.core.Core.setModel? You can store multiple models and access them in your entire SAPUI5 app.
    Except for SAPUI5-apps, these requirements are often realized with HTML5 Web Storage JavaScript API. As you can see in the following blog post, you can easily store even complex entities and access your items in the entire web-application: Client-side Session Management.
    I can't recommend the approach with global variables. A lot of developers had negative experiences with this design pattern. At least, use namespacing techniques to store your functions and variables in one central scope. I've written a simple example on jsFiddle to show you this. As you can see, you could also handle your transient model as an additional variable of your own namespace.
    Regards Michael

  • Case statement problem for a column in BMM layer

    Hi friends.
    In physical layer I've a "cardio" column whose data type is INT, and two values comes here either 0 or 1.
    I need to replace 1 by 'YES' and 0 by "NO'.
    For that I changed the datatype of "Cardio" column to CHAR. and in BMM layer I'm using this formula
    CASE WHEN "A Analysis"."C Report"."CARDIO" = '1' THEN 'Yes' ELSE 'No' END
    But this is giving me "Invalid Expression" error.
    Please help me correct this error.
    Help appreciated.

    Hi,
    Your are probably using the column Cardio as a 'source' and as a 'target'.
    So you have to duplicate the cardio column (right mouse click and Duplicate option) in the business model and then apply the formula CASE WHEN "A Analysis"."C Report"."CARDIO" = '1' THEN 'Yes' ELSE 'No' END
    That should work. It is not even necessary to change datatype of Cardio, OBI will handle this for you.
    Regards
    Edited by: wobiee1 on Nov 12, 2008 1:07 PM

  • Lsmw problem: for mm01 basic data text two language

    Dear,
    I want to realize, in mm01, under 'basic data text' tab, have English and French text.
    I use lsmw, direct input,object:0020, method:0000, program name:RMDATIND.
    The basic data text function should be done in structure BMMH7.
    Now, I add some codes for BMMH7 after entering 'Display Conversion Program'. But the codes will be covered when the rules changed.
    Could you please tell me how to do the same function in 'Maintain Field Mapping and Conversion Rules'?

    Look at the codes I added in conversion program:
    form convert_transaction.
      check so_tcntr.
      loop at ZMATERIAL.
        perform convert_0001.                                   " BGR00
        perform convert_0002.                                   " BMM00
        perform convert_0003.                                   " BMMH1
        perform convert_0004.                                   " BMMH2
        perform convert_0005.                                   " BMMH3
        perform convert_0006.                                   " BMMH4
        perform convert_0007.                                   " BMMH5
        perform convert_0008.                                   " BMMH6
        perform convert_0009.                                   " BMMH7
    * Add start by SAPGD003
        perform convert_0011.                                   " BMMH7
    * Add end by SAPGD003
        perform convert_0010.                                   " BMMH8
      ENDLOOP.
    * End of transaction
      transfer_transaction.
    endform.                    "convert_transaction
    form convert_0009.                                          " BMMH7
      check g_skip_transaction = no.
      g_skip_record = no.
      g_record = 'BMMH7'.
    * --- __BEGIN_OF_RECORD__
      BMMH7 = INIT_BMMH7.
    * --- BMMH7-STYPE
      BMMH7-STYPE = '8'.
    * --- BMMH7-TDID
      BMMH7-TDID = 'GRUN'.
    * --- BMMH7-TDSPRAS
    * Add start by SAPGD003
      BMMH7-TDSPRAS = 'F'.
    * Add end by SAPGD003
    * --- BMMH7-TDFORMAT
      BMMH7-TDFORMAT = '*'.
    * --- BMMH7-TDLINE
    * Add start by SAPGD003
      BMMH7-TDLINE = zmaterial-TEXTE_CMD_FR .
    * Add end by SAPGD003
    * --- BMMH7-TDSPRASISO
    * Add start by SAPGD003
      BMMH7-TDSPRASISO = 'FR'.
    * Add end by SAPGD003
    * --- __END_OF_RECORD__
      transfer_record.
      g_skip_record = no.
    endform.                    "convert_0009
    form convert_0011.                                          " BMMH7
      check g_skip_transaction = no.
      g_skip_record = no.
      g_record = 'BMMH7'.
    * --- __BEGIN_OF_RECORD__
      BMMH7 = INIT_BMMH7.
    * --- BMMH7-STYPE
      BMMH7-STYPE = '8'.
    * --- BMMH7-TDID
      BMMH7-TDID = 'GRUN'.
    * --- BMMH7-TDSPRAS
      BMMH7-TDSPRAS = 'E'.
    * --- BMMH7-TDFORMAT
      BMMH7-TDFORMAT = '*'.
    * --- BMMH7-TDLINE
      BMMH7-TDLINE = zmaterial-TEXTE_CMD_EN .
    * --- BMMH7-TDSPRASISO
      BMMH7-TDSPRASISO = 'EN'.
    * --- __END_OF_RECORD__
      transfer_record.
      g_skip_record = no.
    endform.                    "convert_0011

  • Select statement problem. how to get data in one row

    SELECT
    razm.datum_sklenitve,
    razm.datum_prenehanja,
    FROM
    zket_zaposlenci zap,
    zket_delovna_razmerja razm,
    zket_delovne_razporeditve razp,
    zket_sistemizacije_dm sistdm,
    zket_organizacijske_enote oe,
    zket_delovna_mesta delm
    WHERE
    zap.iid_zaposlenca = razm.iid_zaposlenca and
    razm.iid_delovno_razmerje = razp.iid_delovno_razmerje and
    sistdm.iid_sistemizacija_dm(+) = razp.iid_sistemizacija_dm and
    nvl(sistdm.iid_organizacijske_enote, razp.iid_organizacijske_enote) = oe.iid_organizacijske_enote and
    sistdm.iid_delovno_mesto = delm.iid_delovno_mesto and
    razm.datum_sklenitve <= to_date('31.12.'||:v_datum, 'dd.mm.yyyy') and
    nvl(razm.datum_prenehanja, to_date('31.12.'||:v_datum, 'dd.mm.yyyy')) >= to_date('01.01.'||:v_datum, 'dd.mm.yyyy') and
    razp.datum_nastopa_dela <= to_date('31.12.'||:v_datum, 'dd.mm.yyyy') and
    nvl(razp.datum_prenehanja_dela, to_date('31.12.'||:v_datum, 'dd.mm.yyyy')) >= to_date('01.01.'||:v_datum, 'dd.mm.yyyy') and
    zkep_splosno.zkep_hierarh_oe_n(nvl(sistdm.iid_organizacijske_enote, razp.iid_organizacijske_enote), :v_oe, to_date('31.12.'||:v_datum, 'dd.mm.yyyy')) = 1 and
    to_char(zkep_splosno.zkep_vrni_prvi_dr(razm.iid_delovno_razmerje, to_date('31.12.'||:v_datum, 'dd.mm.yyyy')), 'yyyy') = :v_datum
    and zap.iid_zaposlenca = 1093507
    order by razm.datum_sklenitve DESC
    return this rows:
    datum_sklenitve     datum_prenehanja
    1: 01.10.2010 00:00:00 | 31.12.2010 00:00:00
    2: 01.10.2010 00:00:00 | 31.12.2010 00:00:00
    3: 01.04.2010 00:00:00     | 31.08.2010 00:00:00
    4: 01.02.2010 00:00:00     | 31.02.2010 00:00:00
    how can i get in one select just this result.
    1: : 01.10.2010 00:00:00 | 31.08.2010 00:00:00 (first of A and then the next one of B which is not the same as top of B)
    I try everything but i do not know how. If anyone know how to do this.
    regards,
    MB

    Simma wrote:
    But the above is not documented.Not only that, but it's string aggregation which isn't meeting the OP's requirements.
    Though you could be easily forgiven as the OP hasn't clearly stated the logic behind the requirements.
    It could be something like wrapping the original SQL with something like the following...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select date '2010-10-01' as ds, date '2010-12-31' as dp from dual union all
      2             select date '2010-10-01', date '2010-12-31' from dual union all
      3             select date '2010-04-01', date '2010-08-31' from dual union all
      4             select date '2010-02-01', date '2010-02-28' from dual)
      5  --
      6  -- END OF TEST DATA
      7  --
      8  select max(case when rn = 1 then ds else null end) as ds
      9        ,max(case when rn = 2 then dp else null end) as dp
    10  from (
    11        select ds, dp, row_number() over (order by ds desc nulls last) rn
    12        from (
    13              select case when lag(ds) over (order by ds desc) = ds and lag(dp) over (order by ds desc) = dp then null else ds end as ds
    14                    ,case when lag(ds) over (order by ds desc) = ds and lag(dp) over (order by ds desc) = dp then null else dp end as dp
    15              from t
    16              order by t.ds
    17             )
    18*      )
    SQL> /
    DS                  DP
    01/10/2010 00:00:00 31/08/2010 00:00:00
    SQL>but who knows?

Maybe you are looking for

  • Load JAR from BLOB column?

    I have a JAR file that load and works find when I use the loadjava utility, but my software is now being deployed to a server that I don't have remote access to and can't connect remotely to the Oracle database. I need to push out updated JAR files p

  • Some basic questions about Reports' chart capabilities

    Hi, I'm currently surveying my options for a web based application that we are developing that requires reports with charts in HTML, PDF and Excel format. As the application is being built around 9i DB and AS it would be great to take advantage of th

  • How the HE** do I get a key back on the keyboard?

    On my brand new MacBook Pro a key just popped off. My last Mac laptop had like 7 keys missing. Now I am irked. How the heck do you get this thing back on?? Remember the good ole days when you just shoved it in there. What are all these little white p

  • My touch will not play sound thru speakers while on the universal dock but will play when it is off

    how do i get my itouch to play thru speakers while on the universal dock?

  • Email Approval Software for mac Mail

    Does anyone know of software to work on the mac platform that creates white/blacklists for email. Trying to reduce spam inside of my mail accounts. Here's are a few windows products: http://www.ascentive.com/products/greenlightguardian/  "It's a perm