My orchestration is triggered by a HTTP message and then the following SQL query is executed (field and table names have been changed for security reasons):
SELECT Distinct '900' AS 'Type',
(DeTeamPATH.PKEY) AS 'Personal_ID',
ISNULL(CONVERT(nVarChar(30), DeTeam.TENTLOGON, 121), ' ')
AS 'TLG',
ISNULL(CONVERT(nVarChar(30), DeTeam.CIV_NAMES01, 121), ' ')
AS 'First name',
ISNULL(CONVERT(nVarChar(30), DeTeam.CIV_NAMES02, 121), ' ')
AS 'Middle name',
ISNULL(CONVERT(nVarChar(30), DeTeam.SURNAME, 121), ' ')
AS 'Surname',
ISNULL(CONVERT(nVarChar(30), UsTeam.STREET01, 121), ' ')
AS 'Corporation',
ISNULL(CONVERT(nVarChar(30), DeTeam.GENDER, 121), ' ')
AS 'Gender',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_ADDRESS01 + ', '
+ DeTeam.LOCAL_ADDRESS03, 121), ' ')
AS 'Street Address',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_ADDRESS04, 121), ' ')
AS 'Suburb',
ISNULL(CONVERT(nVarChar(30), DeTeam.COUNTRY, 121), ' ')
AS 'Country',
ISNULL(CONVERT(nVarChar(30), DeTeam.LOCAL_POST, 121), ' ')
AS 'Postcode',
ISNULL(CONVERT(nVarChar(30), DeTeam.BIRTHDATE, 121), ' ')
AS 'Date of Birth',
ISNULL(CONVERT(nVarChar(30), DeTeam.EMAIL, 121), ' ')
AS 'Email address',
ISNULL(CONVERT(nVarChar(30), DeTeam.DOME_PHONE, 121), ' ')
AS 'Primary phone',
DeTeam.ICEPHONE AS 'Phone_2',
ISNULL(CONVERT(nVarChar(30), DeTeamPATH.Person_START, 121), ' ')
AS 'Session_start',
ISNULL(CONVERT(nVarChar(30), DeTeamPATH.Person_FINISH, 121), ' ')
AS 'Session_expiry'
FROM DeTeam
INNER JOIN DeTeamPATH
ON DeTeamPATH.PKEY = DeTeam.DeTeamKEY
INNER JOIN Fort
ON DeTeamPATH.ROUTEID = Fort.ROUTEID OR DeTeamPATH.STREAM=Fort.ROUTEID
INNER JOIN US_DE_SEM
ON US_DE_SEM.US_DE_SEMER = DeTeamPATH.SEM_START
OR US_DE_SEM.US_DE_SEMER = DeTeamPATH.SEM_FINISH
INNER JOIN UsTeam
ON UsTeam.TeamUS = DeTeamPATH.TeamUS
where DeTeam.TENTLOGON != ' ' and DeTeamPATH.PKEY != ' ' and
DeTeam.CIV_NAMES01 != ' ' and DeTeam.CIV_NAMES02 != ' ' and
DeTeam.SURNAME != ' ' and UsTeam.STREET01 != ' ' and
DeTeam.GENDER != ' ' and DeTeam.COUNTRY != ' ' and
DeTeam.TENTLOGON != ' ' and DeTeam.LOCAL_POST != ' ' and
DeTeam.BIRTHDATE != ' ' and DeTeam.EMAIL != ' ' and
DeTeam.DOME_PHONE != ' ' and DeTeamPATH.Person_START != ' ';
It then writes the data to a flat file (a text file) and puts it in a directory on my FTP server. However, the text file only has one line – that being one result from the SQL SELECT query. And when I run the query directly on the server, I get about six results. I want the file to contain all six results but I expect more results to come through that SELECT statement in the near future so I don’t want to set a limit on how many results the query will retrieve as I want it to get all results.
Can someone please help me or tell me what I’m doing wrong? Let me know if you need any further details and I’ll edit this question to include them.
I have the answer to my own question!
In the Write Flat File activity, the rows in the From Orchestration section of the Map Inputs tab were recurring whereas the ones in the To Activity section where not. So, to fix this, I had to edit my Flat File Schema, and change the properties for data so that the occurrence was marked as Unbounded. (It had a Range of 1 previously so only 1 row would ever get put in the text file.) I also had to remove all previous input mappings in my Write Flat File activity and map the row in From Orchestration To the data in To Activity.
If I may say so, I have put this answer up here in case anyone in future has the same issue. I’ve found that finding people on the Internet with experience in the use of WebSphere Cast Iron is difficult… so I’ll be happy if this helps anyone!
@DaleM Thank you for your comments and for trying to help!