Binary Fields and Sql Query's in Flows

 6 Replies
 1 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
JimY
Veteran Member
Posts: 510
Veteran Member

    I am using the following Sql query in a flow.  The Agent field is binary and instead of getting a binary value I am getting something like this: Ap'7 .  If I run this in Sql Manager I get the correct value.  Is there something I need to do in process automation to get the correct value.  Our Landmark version is 10.1.1.23.  Thank you,

    SELECT [AGENT]       
          ,[BORBUSINESSCLASSNAME]     
          ,[KEYTEXT]     
      FROM [ltmtest].[AGENT]
      where KEYTEXT = '1000, 11113985' 

    mikeP
    Veteran Member
    Posts: 151
    Veteran Member
      Try casting your binary value to char or numeric, e.g.

      CAST(SUM(DISTR_FTE) AS NUMERIC (16,3)) GL_FTE,
      CAST(SUM(PrtWageAmount) AS DECIMAL(9,0)) TotWages
      CAST(S.EMPLOYEE AS CHAR) EMPLOYEE,
      JimY
      Veteran Member
      Posts: 510
      Veteran Member
        Hi Mikep,
        That didn't work. It's strange that it works in Sql Manager, but not when I use the same query in a Process Flow. Thank you for the response.
        mikeP
        Veteran Member
        Posts: 151
        Veteran Member
          Are you getting incorrect results from the Cast, or a SQL syntax error?
          Woozy
          Veteran Member
          Posts: 709
          Veteran Member
            Hi JimY,

            You don't mention what database you're using, or what you are wanting to do with the agent value, so I'm not sure if this will help you. However, we use DB2, and using HEX(AGENT) converts the value into a string. However, if you are just joining to another binary value then you can leave it in the original format, even though it isn't pretty in the log. I'd think in MSSQL then MikeP is correct, the CAST or maybe CONVERT(varchar(64),AGENT,0) should work.

            Good Luck!
            Kelly Meade
            J. R. Simplot Company
            Boise, ID
            JimY
            Veteran Member
            Posts: 510
            Veteran Member
              It is Microsoft Sql Server. I tried to put the values here, but they don't display correctly. Sql Manager displays the value correctly, but Process Automation does not. The cast did not work in Process Automation, but did work in Sql Server Manager. I have opened a ticket with Infor to see what they have to say.
              JimY
              Veteran Member
              Posts: 510
              Veteran Member
                I was able to resolve this by using a Landmark Query Node. It took some time to get the quoting correct, but it work great.