Cast Iron 6.1:Put File仅从具有多个结果的SQL查询中输出一行

时间:2013-01-18 04:13:56

标签: sql sql-server-2008 ftp websphere

我的业务流程由HTTP消息触发,然后执行以下SQL查询(出于安全原因,字段和表名已被更改):

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 != ' ';

然后将数据写入平面文件(文本文件)并将其放入我的FTP服务器上的目录中。但是,文本文件只有一行 - 这是SQL SELECT查询的一个结果。当我直接在服务器上运行查询时,我得到了大约六个结果。我希望该文件包含所有六个结果,但我希望在不久的将来能够通过SELECT语句获得更多结果,所以我不想设置查询将检索多少结果的限制,因为我希望它能获得所有结果。

有人可以帮助我或告诉我我做错了什么吗?如果您需要任何进一步的详细信息,请告诉我,我会编辑此问题以包含它们。

1 个答案:

答案 0 :(得分:0)

我对自己的问题有了答案!

写入平面文件活动中,“地图输入”标签的 From Orchestration 部分中的行重复出现,而 To Activity中的行部分没有。因此,为了解决这个问题,我必须编辑平面文件架构,并更改数据的属性,以便将事件标记为Unbounded。 (之前的范围为1,因此只有1行可以放入文本文件中。)我还必须删除写入平面文件活动中的所有先前输入映射,并将行映射到< em>从Orchestration 到 To Activity 中的数据。

如果我可以这样说,我已经把这个答案放在这里以防将来有人遇到同样的问题。我发现在互联网上找到有使用WebSphere Cast Iron经验的人很难......所以如果这对任何人都有帮助我会很高兴的!

@DaleM感谢您的评论和尝试提供帮助!