1
votes

I'm trying to build a mapping that will load data from one database to another, updating destination with all rows from source that have been created since the most recent row in destination.

The query in Source would be something like this:

SELECT
    *
FROM table
WHERE table.creation_date > [[destination max creation_date]]

From what I saw in the docs and discussions in the Informatica Cloud communities, the best way to do this would be with a Parameter. But from all that I've seen, the only ways to load parameters are:

  • Hardcode it into the mapping
  • Load parameters from a XML file

Is there a way to load parameters from ANYWHERE else? Anything except for a file would be great.

Thanks in advance and sorry for awkward writing.

2

2 Answers

2
votes

I have this logic set up in multiple IICS mappings.

Steps you need to follow :

In the mapping

  1. Create an Input-Output parameter, i.e. v_last_load_date
  2. In an expression create a variable field and use this as expression SetMaxVariable($$v_last_load_date, creation_date)

  3. In the Source - Query Options add a filter to set creation_date > $$v_last_load_date

You can see the latest value in the Task (assuming you created a task) under In-Out Parameters.

If you need to change the value for reload purposes etc. you need to edit the task change that value.

1
votes

One option is to use the LastRunTime variable. See https://kb.informatica.com/howto/6/Pages/18/488723.aspx for details.

Using a file for the parameter is more reliable. I would use file target and a post-processing script to update the value on each run, and a pre-processing script to ensure it is properly set before running. Probably not the answer you were looking for, but my experience is the extra effort is well worth it to minimize production maintenance later.