【问题标题】:IBM APIConnect : single quote string is not workingIBM APIConnect:单引号字符串不起作用
【发布时间】:2018-02-01 22:24:58
【问题描述】:

IBM API Connect 中,尝试将单引号字符串值设置为:'ACTIVE',但是当我尝试将 QueryString 值完全设置为 null 时。 如果我删除单引号字符串('ACTIVE')工作正常。 请让我知道如何修复以下代码:

     action:
     - set: body.Envelope.Body.QueryString
                from:
                  - FName
                  - LName
                  - email
                value: "'select id from emp where emp.firstname ='+$(FName)+' and emp.lastname ='+$(LName)+' and primaryemail ='+$(email)+' and active =’ACTIVE’ '"

【问题讨论】:

    标签: single-quotes apiconnect


    【解决方案1】:

    使用 Setvariable 解决了上述问题。

    在Assembly中->输入前,拖拽setVariable

    在 setVariable 中:

    1. 动作:设置
    2. 设置:查询字符串
    3. 值:select id from constituent where consname.firstname='$(request.parameters.FirstName)' and consname.lastname ='$(request.parameters.LastName)' and primaryemail ='$(request.parameters.email)' and active = 'ACTIVE'

    在值之后,queryString 映射到输入。

    现在查询按预期进行如下:

    select id from constituent where consname.firstname='Sunny' and consname.lastname ='Tom' and primaryemail ='synny.tom@gmail.com' and active = 'ACTIVE'
    

    这对我有用。

    【讨论】:

      【解决方案2】:

      我宁愿发表评论,但我在网站上没有足够的声誉。所以,乍一看,我想问一下:您是否尝试过替换以下内容

      ’’
      

      U+2019 : 右单引号{单逗号引号}

      围绕ACTIVE字,为经典符号

      ''
      

      U+0027 : APOSTROPHE {APL 引用}

      像所有其他变量值一样?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-07-01
        • 1970-01-01
        • 2014-09-27
        相关资源
        最近更新 更多