Integration

Get Involved. Join the Conversation.

Topic

    Cesar Tepetla Corte
    Break the contents of an OIC variable in lines to insert it...
    Topic posted April 5, 2019 by Cesar Tepetla CorteBronze Medal: 1,250+ Points, last edited April 8, 2019, tagged Adapters, Cloud, Connection, Database, Events, Integration, Mapping, Orchestration, Process 
    80 Views, 1 Comment
    Title:
    Break the contents of an OIC variable in lines to insert it into a database
    Summary:
    Break the contents of an OIC variable in lines to insert it into a database
    Content:

    Hi everyone,

     

    I have created a variable in OIC where it stored the contents of a file, for example:
    varoic = "METADATA | Location | SetId | SetCode | ActiveStatus | LocationCode | LocationName | AddressLine1 | Country | PostalCode | EffectiveStartDate
    MERGE | Location | 0 || Active | LocationTest_22032019 | RESTAURANTE_Location22032019 | Jaime Balmes AvenueI Secc, 11550 Miguel Hidalgo, CDMX | MX | 11550 | 1951/01/01

    MERGE | Location | 0 || Active | TLocationTest_23032019 | RESTAURANTE_Location22032019 | Jaime Balmes AvenueI Secc, 11550 Miguel Hidalgo, CDMX | MX | 11550 | 1951/01/01
    "

    when I insert into the database what I'm looking for is to take only the files that start with MERGE, so in theory I should create only two records in the table.

    Which I want comment or help is appreciated.

    Regards

    Comment

     

    • Hemanth Lakkaraju

      Try using stage action, to write the data to a file, read it back as a single column, repeat for each line, and if the column value starts with MERGE, then write those entries to other file, read the new file, get contents as string and then insert into database.