Advertisement
uniblab

GetRecFilenames

Nov 8th, 2017
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.89 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <WorkOrder xmlns="http://Icod.Wod" xsi:schemaLocation="http://Icod.Wod \\jgsm-sql01\D$\Icod.Wod\schema0.xsd"
  3.        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.        jobName="Consortium Get Recommender Filenames"
  5.         emailTo="none@example.com"
  6. >
  7.     <steps>
  8.         <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="delete dbo.Consortium_PDFUpload_tbl" />
  9.         <fileOperation xsi:type="deleteFile"
  10.             path="\\jgsm-sql01\D$\Consortium Imports\Archive" name="list"
  11.         />
  12.  
  13.         <fileOperation xsi:type="listFile" searchOption="AllDirectories"
  14.             path="\\jgsm-sql01\D$\Consortium Imports\Archive" name="*.pdf" regexPattern="\d{6,8}_((App)|(\d{6,8}_REC))\.pdf$"
  15.         >
  16.             <destination path="\\jgsm-sql01\D$\Consortium Imports\Archive" name="list" />
  17.         </fileOperation>
  18.         <fileImport connectionStringName="SalesForce" namespace="dbo" tableName="Consortium_PDFUpload_tbl" updateBatchSize="20" >
  19.             <columnMapping>
  20.                 <map from="FileName" to="FileName" />
  21.             </columnMapping>
  22.             <source xsi:type="delimitedFile" path="\\jgsm-sql01\D$\Consortium Imports\Archive" name="list" hasHeader="false">
  23.                 <columns>
  24.                     <column name="FileName" />
  25.                 </columns>
  26.             </source>
  27.         </fileImport>
  28.  
  29.         <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="update dbo.Consortium_PDFUpload_tbl set Type = 'App' where Right( Filename, 8 ) = '_App.pdf'" />
  30.         <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="update dbo.Consortium_PDFUpload_tbl set Type = 'REC' where Right( Filename, 8 ) = '_REC.pdf'" />
  31.         <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="update dbo.Consortium_PDFUpload_tbl set HobsonsID =  Try_Cast( dbo.AllTrim( Replace( Substring( Filename, 1, CharIndex( '_', Filename, 1 ) ), '_', ' ' ) ) as int )" />
  32.     </steps>
  33. </WorkOrder>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement