For many reasons, a read file action may be needed to iterate on a list of values and use the result as Bind values in the target action. 



A use case can be the integration of a file content in a database table (example below) :



SQLOperation READ FILE 

  • Action expression :
    SELECT DiscountRanges.RANGE    DIS_RANGE,
          DiscountRanges.MIN DIS_MIN,
          DiscountRanges.MAX DIS_MAX
    FROM %x{$DiscountRanges/tech:name()}x%
    %x{$DiscountRanges/mdj:xpath(.,'AFTER_FROM')}x%


  • SQL_CONNECTION parameter value :
    %connection{$DiscountRanges}%


  • SQL_ACTION_TYPE parameter value :
    SELECT



SQLOperation INSERT DATA

  • Action expression :
    insert into %x{$DIM_DISCOUNT/tech:physicalPath()}x%
    (
      DIS_RANGE,
      DIS_MIN,
      DIS_MAX
    )
    values
    (
      :{DIS_RANGE}:,
      :{DIS_MIN}:,
      :{DIS_MAX}:
    )


  • SQL_ACTION_TYPE parameter value :
    INSERT



The expressions are using xPath (XML Path Language) to variabilize the objects information.

Contact Semarchy for more information/training on other advanced functionalities in xDI.



The above Bind example is done for an SQLOperation as target action but it can also be applied to any target actions supporting Bind values like : scripting, delivery, OS Command, mail...