How to dynamically and selectively update DSO based on values in a csv file

Hi,
I'm loading a csv file into a DSO. When loading the flat file in FULL mode I need to do a pseudo delete of records that were previously loaded but are not in the new flat file.
Is it possible to dynamically determine the unique set of records (say Pk1, Pk2, Pk3) in the csv file and then set all the corresponding DSO records' quantities to 0 - maybe in a start routine??  After that, I can load the csv file with the correct quantities (effectively update and inserts).  The net result should be that the change log only be updated through to the next DSO.
Example: Load 10 records yesterday. Today reload 9 records. 10th records must have quantity set to 0. Other 9 records will have quantity values set to those in today's csv file -  some will be the same & some will be different. The net change log of all 10 records must be loaded into the next DSO.
Any suggestions on how to do this logic?
Thanks!

Hi Gregg,
You can create one transformation from the DataStore to itself.  In the "Technical" rules group, set 0RECORDMODE = 'X' (before image) or 'R' (reverse).  Therefore, when you execute its corresponding DTP, all existing records shouldl be set to zero.
Then, as a second step, you can execute the DTP which is related to the transformation between the DataStore and the DataSource, thus loading the new records.
I hope this helps you.
Regards,
Maximiliano

Similar Messages

  • How to update a specific cell value in a CSV file.

    Hi
    I would like to know whether it is possible in openscript to update a cell value of the CSV file.
    For example if the test script requires to update the cell of 6th row and 8th column, then how to achieve through openscript API?
    Please kindly let me know.

    Hi,
    Hope this helps!
    Table table;
    String[] rowvalus;
    int targetRow=5,targetColumn=7;
    * Note: Rows and columns are 0-based index.
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("Before change :"+rowvalus[targetColumn]);
    rowvalus[targetColumn]="NewValue";
    utilities.saveCSV(table, "C:\OracleATS\OFT\DataBank\Test.csv", true);
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("After change :"+rowvalus[targetColumn]);
    Note:- Please first take the backup of your CSV file before using this code snippet
    Thanks
    -POPS

  • How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased! I would like to delete hist

    How can I delete apps from the app store? There seems to be every app I have ever downloaded and deleted since I got my phone in 2007. When I go to app store and select update apps there's a menu at the top that says purchased and when I select it it shows every app I've ever had! I would like to delete the history please.
    Many thanks

    You cannot.
    The entire point of this is that you can redownload any and all of your past purchases.

  • A client has sent me an indesign file I cannot open. She says she has updated to Indesign CC 2014. I am a CC member and fully updated my own software but cannot open the file she has sent me, not even if she saves as an IDML, how do I resolve the problem?

    A client has sent me an indesign file I cannot open. She says she has updated to Indesign CC 2014. I am a CC member and fully updated my own software but cannot open the file she has sent me, not even if she saves as an IDML, how do I resolve the problem?

    There are a few things to try.
    First, if this file came to you vial email attachment, it could have been corrupted. Ask her to zip the file and send it again. That sometimes helps.
    I suppose there's a chance that the file is already zipped, so see if that's the case and unzip it if so.
    If the file name doesn't end with .indd, add it and see if that helps.
    If you are double-clicking, try File>Open from within InDesign.
    Last (and I know this sounds like a joke, but I've seen it many times), sometimes people attach a Mac Alias or Windows Shortcut instead of the actual file. What is the file size? If it's really small, that might be the reason.
    Also, no offense intended if some of this sounds like stuff you have already tried. I don't know what you know, so I'm just spit-balling.

  • To make the change from MobilMe I will have to update from System 10.4.11 to 10.7.2.  How many system and firmware updates will I have to do?

    To make the change from MobilMe I will have to update fro System 10.4.11 to 10.7.2.  How many firmware and system updates will I have to make

    First, see if your system can run Lion:
    http://www.apple.com/macosx/specs.html
    If you have any PPC apps, none of them will work under Lion.
    If you meet the requirements for Lion, you can go to Snow Leopard(US $29), then update to 10.6.8, then update to Lion(US $29).
    Apple says 2GB's of memory minimum. I wouldn't update to Lion unless you can run at least 4GB's.

  • LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7?

    LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7 Network?
    We have a working 1gig network in Win7 PRO 64-bit.  and using LRv3.2
    * How do I configure our Files or Cataloges "so"  ALL Edits are veiwable/edit to all?   (we don't work on the Same Shoot/Folder at the same time)
    I NEED to see,  ALL the LR  Edits  (is great with DNG files
    *** BUT,  what I cannot see if I remember correctly (with just the DNG sharing)  is the  CROP or Virtual Copys ... possibly the Brush edits.
    HOW, do I configure to be able to read and edit ...  ALL of the updated/saved  Edits???   (after it is done by my asst.)
    Is creating a New Catalog for EACH  shoot the way to go?   (not sure I like this idea)
    Right now everything is in one(1) catalog  ... and it's getting big ... BUT, this allows us to search , and group ... going way back.
    Would be nice to be able to still do this easily, and with what we have already done.
    With our one BIG Catalog ... not sure if two(2) can access this catalog over the Network at the same time?
    Even though we never Edit the Same Folder or Files at the same time.
    Or will that be a problem over a simple Win7 PRO network?
    Thank you,
    HG

    Aloha Bob,
    Saw your link.  thank you.
    At least I don't feel "alone"  LOL
    At this point ... I am looking for a  "cluncky"   Work Around?
    * I was thinking,  Maybe making a copy of  My Cataloge ...
    Deleting ALL the  Folders in LR  ... except for the one's  that  will be worked by the Asst.
    Then moving that file to the  Asst.  Computer.
    * NEXT,  pointing the  Folder that they are working on ... across the Network to the Servers Files.
    * After they work on it:
    *** IS THERE A WAY ...
    * To  take that Cataloge ... and UPDATE  my Main  Cataloge.
    THIS, is the STEP  ... I don't know how to do.
    Can someone Help me with this?
    Step by Step,  because I am clueless ....
    Talking UPDATE of everything worked on ... including   Virtual copys, and  CROPS.
    Thank you,
    HG

  • When I goto app store and select updates and then purchased it spins the hour glass and then go's back to home screen, anyone know the fix?

    When I goto app store and select updates and then purchased it spins the hour glass and then go's back to home screen, anyone know the fix?

    ATtempt to power off your device and power it back on, if that doesn't work reset all settings should resolve it for you

  • Difference between -  Write Optimized and Direct Update DSO

    Hi Gurus,
    I know the similarities of the Write Optimized and Direct Update DSO.
    But I want to know what is the difference between the both.
    Can any expert let me know the difference between the both please.
    Thanks

    Hi,
    Write Optimised DSO:
    Write optimsed DSO has been designed to be the initial staging of the source system  data from where the data could be transfered to the standard DSO or the Infocube.
    The Data is immediately written to the further data targets.We can save the activation time.Reporting also possible on this.
    SAP recommends to use Write-Optimized DataStore as a EDW inbound layer, and update the data into further targets such as standard DataStore objects or InfoCubes.
    Direct Update DSO:
    Dat a store object for direct update conatains daya in a single version.therefore data is stored same form in which it was written to DSO for direct update by the application.We can use this type of DSO for APD.
    In IP we can use this dso and directly we can enter the data using RSINPUT.
    Thanks
    Madhavi

  • How to create and execute a function whose return value is  a table

    hi folks ,
    i would like know how to create and execute a function whose return value is a table ,
    am new to pl/sql ,
    my statement for the function is
    SELECT ct.credential_code, c.expiration_date
    FROM certifications c, credential_types ct
    WHERE ct.crdnt_id = c.crdnt_id
    AND c.person_id = person_id;
    i would like to have the result of the above query as return value for the function.
    Thanks in advance ,
    Ashok.c

    hi Ps ,
    Can you please do small sample ,
    that would help me in clear understanding
    thanks in advance
    ashok.c

  • I've downloaded the latest version of itunes. I connect my ipod and it updates. When I go to change music files

    've downloaded the latest version of itunes. I connect my ipod and it updates. When I go to change music files to remove some & add some, my itunes window freezes Please help.

    Hello rcreevey,
    The following article provides information that may be helpful in getting your Apple TV to appear in iTunes.
    Apple TV: Unable to restore using iTunes
    http://support.apple.com/kb/TS5231
    Cheers,
    Allen

  • Need to take a value from the csv file and query in a OAF page.

    Hello,
    I have a requirement to take the list of employee numbers in a csv file and display its corresponding job on the page.
    I have created a item 'MessageFileupload' where the user will upload the csv file containing the employee number and a Button 'Display Jobs' which will display the corresponding jobs on the page.
    Any idea how to take the values from the csv file and query it?
    Regards,
    den123.

    Hi ,
    Check
    http://oraclearea51.com/contribute/post-a-blog-article/csv-file-upload-for-oa-framework.html
    http://www.roseindia.net/jsp/upload-insert-csv.shtml
    Below code works from above blogs.
    package xx.oracle.apps.pa.Lab.webui;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    // import java.io.*;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OAViewObjectImpl;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.jbo.domain.BlobDomain;
    import oracle.cabo.ui.data.DataObject;
    import oracle.jbo.Row;
    * Controller for ...
    public class deptCsvUploadCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
        // Code Addition Started for CSV upload
        OAApplicationModule am = (OAApplicationModule) pageContext.getApplicationModule(webBean);
        OAViewObjectImpl vo = (OAViewObjectImpl) am.findViewObject("deptCsvVO1");
          //if ("GoBtn".equals(pageContext.getParameter(EVENT_PARAM)))
           if (pageContext.getParameter("GoBtn") != null)
          System.out.println("Button Pressed");
              DataObject fileUploadData =(DataObject)pageContext.getNamedDataObject("FileUploadItem");
              String fileName = null;
              String contentType = null;
              Long fileSize = null;
              Integer fileType = new Integer(6);
              BlobDomain uploadedByteStream = null;
              BufferedReader in = null;
                      try
                      fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
                      contentType =(String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
                      uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, fileName);
                      in = new BufferedReader(new InputStreamReader(uploadedByteStream.getBinaryStream()));
                      fileSize = new Long(uploadedByteStream.getLength());
                      System.out.println("fileSize"+fileSize);
                      catch(NullPointerException ex)
                      throw new OAException("Please Select a File to Upload", OAException.ERROR);
                      try{ 
                      //Open the CSV file for reading 
                      String lineReader=""; 
                      long t =0;
                      String[] linetext; 
                      while (((lineReader = in.readLine()) !=null) )
                      //Split the deliminated data and
                      if (lineReader.trim().length()>0)
                      System.out.println("lineReader"+lineReader.length());
                      linetext = lineReader.split(","); 
                      t++;
                      //Print the current line being
                      if (!vo.isPreparedForExecution())
                              vo.setMaxFetchSize(0);
                              vo.executeQuery();
                        System.out.println("Trimmed "+  linetext[1].replace("\"", ""));
                      Row row = vo.createRow();
                      row.setAttribute("Deptno", linetext[0].trim());
                      row.setAttribute("Dname",linetext[1].trim().replace("\"", ""));
                      row.setAttribute("Loc",linetext[2].trim().replace("\"", ""));
                      //row.setAttribute("Column4", linetext[3].trim());
                      vo.last();
                      vo.next();
                      vo.insertRow(row);
                      catch (IOException e)
                            throw new OAException(e.getMessage(),OAException.ERROR);
              //else if (pageContext.getParameter("Upload") != null)
              am.getTransaction().commit();
              throw new OAException("Uploaded SuccessFully",OAException.CONFIRMATION);     
    }Thanks,
    Jit

  • Is there a way to find and replace prices in an Indesign document from a CSV file?

    Is there a way to find and replace prices in an Indesign document from a CSV file. Currenty I have a catalog with codes and prices in tables. I need to find a way to look up the code (and new price) in the CSV file and overwrite the price in the current table with the new price. Does anyone know of a script to run this quickly?

    Hi,
    Try this
    1) with all the images showing, got to Find -> By caption or Note
    2) enter the caption you are looking for Image Description and click on OK
    It should display all the ones with that caption
    3) select a few images as a test
    4) go to Edit -> Add caption to selected items
    5) if you want to blank out the captions just check the box to replace the caption and click on ok
    6) You will need to confirm the blank captions
    You could use a similar procedure to change the caption to something else.
    Good luck
    Brian

  • How to export a form that has Asian language in it to CSV file? Currently the CSV file shows [...] for Asian language characters

    How to export a form that has Asian language in it to CSV file? Currently the CSV file shows [...] for Asian language characters

    Hi George,
    Thanks! It does work in XML format. But since I would need to present the data in a spreadsheet, is there any other way I could go around it?
    Cheers,
    Su Ann

  • Cursor and Update rows based on value/date

    SQL Server 2012
    Microsoft SQL Server Management Studio
    11.0.3128.0
    Microsoft Analysis Services Client Tools
    11.0.3128.0
    Microsoft Data Access Components (MDAC)
    6.1.7601.17514
    Microsoft MSXML 3.0 4.0 5.0 6.0 
    Microsoft Internet Explorer
    9.11.9600.16518
    Microsoft .NET Framework
    4.0.30319.18408
    Operating System
    6.1.7601
    The objective of this is to test the Cursor and use it on a production environment after this is fixed. What I would like to do is update rows in a column i duplicated originally called 'HiredDate' from AdventureWorks2012 HumanResources.Employee table. I
    made a duplicate column called 'DateToChange' and would like to change it based on a date I have picked, which returns normally 2 results (i.e. date is '04/07/2003'). The code runs but will not change both dates. It did run however with an error but changed
    only 1 of the 2 rows because it said ['nothing available in next fetch'].
    The code to add the columns and perform the query to get the results I am running this against:
    -- ADD column 'DateToChange'
    ALTER TABLE [HumanResources].[Employee] ADD DateToChange Date NOT NULL;
    -- Copy 'HireDate' data to 'DateToChange'
    UPDATE HumanResources.Employee SET DateToChange = HireDate;
    -- Change 'DateToChange' to NOT NULL
    ALTER TABLE [HumanResources].[Employee] ALTER COLUMN DateToChange Date NOT NULL;
    SELECT BusinessEntityID,HireDate, CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
    FROM HumanResources.Employee
    WHERE [DateToChange] = '04/07/2003';
    Code:
    USE AdventureWorks2012;
    GO
    -- Holds output of the CURSOR
    DECLARE @EmployeeID INT
    DECLARE @HiredDate DATETIME
    DECLARE @HiredModified DATETIME
    DECLARE @ChangeDateTo DATETIME
    --Declare cursor
    -- SCROLL CURSOR ALLOWS "for extra options" to pul multiple records: i.e. PRIOR, ABSOLUTE ##, RELATIVE ##
    DECLARE TestCursor CURSOR SCROLL FOR
    -- SELECT statement of what records going to be used by CURSOR
    -- Assign the query to the cursor.
    SELECT /*HumanResources.Employee.BusinessEntityID, HumanResources.Employee.HireDate,*/ CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
    FROM HumanResources.Employee
    WHERE DateToChange = '01/01/1901'
    /*ORDER BY HireDate DESC*/ FOR UPDATE OF [DateToChange];
    -- Initiate CURSOR and load records
    OPEN TestCursor
    -- Get first row from query
    FETCH NEXT FROM TestCursor
    INTO @HiredModified
    -- Logic to tell the Cursor while "@@FETCH_STATUS" 0 the cursor has successfully fetched the next record.
    WHILE (@@FETCH_STATUS = 0 AND @@CURSOR_ROWS = -1)
    BEGIN
    FETCH NEXT FROM TestCursor
    IF (@HiredModified = '04/07/2003')/*05/18/2006*/
    -- Sets @HiredModifiedDate data to use for the change
    SELECT @ChangeDateTo = '01/01/1901'
    UPDATE HumanResources.Employee
    SET [DateToChange] = @ChangeDateTo --'01/01/1901'
    FROM HumanResources.Employee
    WHERE CURRENT OF TestCursor;
    END
    -- CLOSE CURSOR
    CLOSE TestCursor;
    -- Remove any references held by cursor
    DEALLOCATE TestCursor;
    GO
    This query is run successfully but it does not produce the desired results to change the dates
    04/07/2003 to 01/01/1901.
    I would like the query to essentially be able to run the initial select statement, and then update and iterate through the returned results while replacing the necessary column in each row.
    I am also open to changes or a different design all together. 
    For this query I need:
    1. To narrow the initial set of information
    2. Check if the information returned, in particular a date, is before [i.e. this current month minus 12 months or
    12 months before current month]
    3. Next replace the dates with the needed date
    [Haven't written this out yet but it will need to be done]
    4. After all this is done I will then need to update a column on each row:
    if the 'date' is within 12 months to 12 months from the date checked
    NOTE: I am new to TSQL and have only been doing this for a few days, but I will understand or read up on what is explained if given enough information. Thank you in advance for anyone who may be able to help.

    The first thing you need to do is forget about cursors.  Those are rarely needed.  Instead you need to learn the basics of the tsql language and how to work with data in sets.  For starters, your looping logic is incorrect.  You open
    the cursur and immediately fetch the first row.  You enter the loop and the first thing in the loop does what?  Fetches another row.  That means you have "lost" the values from the first row fetched.  You also do not test the success of
    that fetch but immediately try to use the fetched value.  In addition, your cursor includes the condition "DateToChange = '01/01/1901' " - by extension you only select rows where HireDate is Jan 1 1901.  So the value fetched into @HiredModified will
    never be anything different - it will always be Jan 1 1901.  The IF logic inside your loop will always evaluate to FALSE.  
    But forget all that.  In words, tell us what you are trying to do.  It seems that you intend to add a new column to a table - one that is not null (ultimately) and is set to a particular value based on some criteria.  Since you intend the
    column to be not null, it is simpler to just add the column as not null with a default.  Because you are adding the column, the assumption is that you need to set the appropriate value for EVERY row in the table so the actual default value can be anything.
     Given the bogosity of the 1/1/1901 value, why not use this as your default and then set the column based on the Hiredate afterwards.  Simply follow the alter table statement with an update statement.  I don't really understand what your logic
    or goal is, but perhaps that will come with a better description.  In short: 
    alter table xxx add DateToChange date default '19010101'
    update xxx set DateToChange = HireDate where [some unclear condition]
    Lastly, you should consider wrapping everything you do in a transaction so that you recover from any errors.  In a production system, you should consider making a backup immediately before you do anything - strongly consider and have a good reason not
    to do so if that is your choice (and have a recovery plan just in case). 

  • How-to Dynamic Hierarchy Selection.

    Hi guys,
    does anyone know how to implement "Dynamic Hierarchy Selection"? I have a main hierarchy but would like to filter it further while loading the hierarchy.
    E.g. I have a financial statement verison with both Balance Sheet and P/L items, i would like to separate the main into two new hierarchies, one BS and P/L hierarchies instead, apparently the infopackage allows you to write small codes to dynamically select which hierarhcy you want.
    Cheers.

    Hi,
    We donot have this type selection at the time of upload. The thing we can do is upload both versions into BIW and in the report we can use Hierarchy variable to have dynamic selection of hierarchy.
    with rgds,
    Anil Kumar Sharma .P

Maybe you are looking for