Skip navigation
Contact Us
6314 Views 13 Replies Latest reply: Nov 12, 2012 5:46 AM by Suresh K RSS
santy cv Novice 94 posts since
Jul 11, 2011
Currently Being Moderated

Aug 4, 2011 5:05 AM

Duplicates in dynamic lookup

We need to do a dynamic lookup against a reference table against columns A,B. ie if the values for A,B do not exist in the reference table, insert a new row along with a new surrogate key id. How ever the reference table has duplicate values for columns A,B. As a result the session log throws the error "

A duplicate row was attempted to be inserted into a dynamic lookup cache [lkp_12]. The dynamic lookup cache only supports unique condition keys.

dynamic lookup"

 

Ideally the reference table should not be having duplicate values and getting it cleaned is beyond the scope of our project.

 

Hence can not use dynamic lookups. A work around would be

 

mapping 1. read from source --> static lookup against reference table --> determine new inserts --> insert onto reference table

mapping 2 . read from source --> static lookup against reference table --> get id --> use it to populate onto target.

 

this requires 2 pass reading from source.

 

are there any other alternatives in this case. Dynamic lookups with duplicates. thanks.

  • Swetha Vadlapati Apprentice 198 posts since
    Feb 18, 2011
    Currently Being Moderated
    Aug 4, 2011 5:46 AM (in response to santy cv)
    Duplicates in dynamic lookup

    Have u tries using lookup query to get only distinct records.....

    Does ur source also contains duplicates?

    I don't think u have to use 2 mappings here. If it is only inserts mapping2 is enough..no need to use dynamic lookup also...

      • Swetha Vadlapati Apprentice 198 posts since
        Feb 18, 2011
        Currently Being Moderated
        Aug 4, 2011 6:02 AM (in response to santy cv)
        Duplicates in dynamic lookup

        It should be like

         

        Source-----> SQ-----> lookup----->filter---> exp------>target table

         

        in lookup (static) condition id LKP_A=SRC_A and LKP_B=SRC_B. get X from lookup into filter.

         

        filter condition is ISNULL(X)

         

        and in expression generate new value for X and insert into the target table.

         

        Is there anu other option ur trying?

         

        If u want mapping send me some sample source data and which records to be inserted....

          • Veeru B Master 1,242 posts since
            Sep 27, 2010
            Currently Being Moderated
            Aug 4, 2011 10:57 AM (in response to santy cv)
            Duplicates in dynamic lookup

            Hi Santy,

             

            Please let us know what is exact requirement. Provide some sample data so that its easy to understand.

             

            Regards,

            Veeru

            • Swetha Vadlapati Apprentice 198 posts since
              Feb 18, 2011
              Currently Being Moderated
              Aug 4, 2011 10:28 PM (in response to Veeru B)
              Duplicates in dynamic lookup

              HI santy

              If ur source also contains duplicates, then u hv to use dynamic lkp,else static lkp will solve ur prblm.

              Hv u tried my mapping. Confirm whether ur siurce hv duplicates, I ill provide u

              The solution

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points