Topic
  • 1 reply
  • Latest Post - ‏2015-01-26T17:08:56Z by Taylor.Osmun (IBM)
lin-zhao
lin-zhao
28 Posts

Pinned topic (7.2.2) alias in WHERE clause doesn't work

‏2015-01-26T03:38:24Z |

On 7.2.2, this query results in 422 response while it works when the WHERE clause is taken out. I have need to search by the formatted field (format(deviceType)) in my query. Replacing the alias with the whole format function (format(deviceType)) also fails. Is there a way to make this happen on 7.2.2? Similar query works on 7.2.3 or 7.2.4.

 

select format(deviceType) as logSourceTypeName, payload from events WHERE logSourceTypeName LIKE 'Microsoft%' 

 

response:

{
  "httpResponse": {
    "code": 422,
    "message": "The request was well-formed but was unable to be followed due to semantic errors"
  },
  "code": 2000,
  "message": "unknown property in criteria expression",
  "description": "The queryExpression contains invalid AQL syntax.",
  "details": {
    "originalQuery": "select format(deviceType) as logSourceTypeName, payload from events WHERE logSourceTypeName LIKE 'Microsoft%' ",
    "location1": 74,
    "location2": -1,
    "context": "criteria expression",
    "error": "unknown property",
    "extraText": "Property logSourceTypeName not found for database events"
  }
}
  • Taylor.Osmun (IBM)
    Taylor.Osmun (IBM)
    55 Posts
    ACCEPTED ANSWER

    Re: (7.2.2) alias in WHERE clause doesn't work

    ‏2015-01-26T17:08:56Z  

    Hi lin-zhao,

    7.2.2 is a very early version of the ariel APIs. 'logSourceTypeName' is not an available column in that version.

    You can always view a list of columns through the following endpoint:

    /ariel/databases/{databaseName}

    -Taylor

  • Taylor.Osmun (IBM)
    Taylor.Osmun (IBM)
    55 Posts

    Re: (7.2.2) alias in WHERE clause doesn't work

    ‏2015-01-26T17:08:56Z  

    Hi lin-zhao,

    7.2.2 is a very early version of the ariel APIs. 'logSourceTypeName' is not an available column in that version.

    You can always view a list of columns through the following endpoint:

    /ariel/databases/{databaseName}

    -Taylor