We have this situation where we want to read records from a table and put them all in one file and send it via ftp
- Now by default it seems Snapshot fetches one record at one time and so if I am calling an operation from my service then every row will make individual request so we will end up sending multiple files
I solved this for fileoutbound adapter by setting overwrite = true so it kept appending data to its last
Not sure how to do it with FTP as it doesn't even has put line method.
And I am not even sure how to do set the stream
Method OnProcessInput(pInput As EnsLib.SQL.Snapshot, pOutput As %RegisteredObject) As %Status
{
$$$TRACE("Entering "_pInput.Get("ProviderIdentifier")_" "_pInput.Get("ProviderFirstName"))
set Provider = pInput.Get("ProviderIdentifier")
set req2 = ##class(Ens.StreamContainer).%New()
set req2.OriginalFilename = "Provider.txt"
set req2.Stream = Provider
set sc = ..SendRequestAsync("Production.Cedars.Cedars.To.FTP.PutCSVDataNABizOp",req2)
quit sc
}