Skip to Content
avatar image
Former Member

Mapping problem

Hi All

Scenario is JDBC to File

Requirement is:

Pick up a records from two tables.

1st table is Header table and 2nd table is Details table.

Both tables are having Bill_NO

2nd table also contains Line_Item_No

Now,

Through SQL query I am picking up 3 records each time.

Problem I am facing in Mapping

for 1st record I have created Target Header segment and under header produced details segment having Line_Item_No

for 2nd record also I have created separate Header segment and under header produced details segment having Line_Item_No

now 3rd record Bill_No is similar to 2nd record but diff Line_Item_No

now for this I dont want to repeat header I just want to repeat Line_Item_No under previously header segment.

Is this requiremt possible. If yes then which logic i can apply, i am relly confused.

header bill no................................details bill no..line item no
3a1OTHR000684	022	HARISH  KUMAR     	3a1OTHR000684	2	022
3a1OTHR000686	022	AMIT KUMAR  GAUR	3a1OTHR000686	2	022
3a1OTHR000686	022	AMIT KUMAR  GAUR	3a1OTHR000686	3	022

022 is organization code

Regards

Dheeraj Kumar

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jun 28, 2011 at 01:06 PM

    Hi Dheeraj,

    Please try this...

    billno-->removecontext>sort->splitbyvalue (valuechange) -


    >collapsecontext--->header

    Thanks

    Priyanka

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Dheeraj,

      Mt_target

      header(node)

      detail(node)

      line item(element)

      this is your target structure right???? Then use my first logic for mapping the heade node, and second logic for mapping the detail node & second logic plus split by each value for line item element......hope this will surely work...please try it once

      Thanks

      Priyanka

  • avatar image
    Former Member
    Jun 28, 2011 at 01:17 PM

    Hi Dheeraj,

    Why dont you use a staging table that will have fields of both header and detail in them? PI will poll this table and pick records.

    Use the logic of Priyanka to split the creation of new file. If you dont want to sort you can remove that.

    Thanks,

    Hari

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 01, 2011 at 03:18 PM

    Thanks Priyanka and Chandra for your support

    Edited by: Dheeraj Kumar on Jul 2, 2011 1:49 AM

    Add comment
    10|10000 characters needed characters exceeded