Database subscriber WHERE conditions

Hi there!
I have a question regarding the Database subscriber (Incoming config).
Lets assume, that I have an MSSQL server, with a table named “PersonalData”, and a column inside named “EmailAddress”.

Now, what I need is to get all rows that have EmailAddress defined (so <> “” and <> NULL), but I don’t know how the Where conditions work:

What should go into the textarea next to the key name in the below mentioned situation? (Or rather, how to “convert” an sql where string like “[…] where EmailAddress <> “” and EmailAddress <> NULL” to that textarea?)

Please note, that the “Use raw query” is not an option in my case, since I need this functionality, that every row is processed in a separate task (or a separate route task).

Thank you for your answer in advance!

Hi @gerg.borsodi,

You can use following operator for where conditions :

  1. eq
  2. neq
  3. gt
  4. gte
  5. lt
  6. lte
  7. inq
  8. nin
  9. like
  10. nlike
  11. regexp

You can read full schema in here

{
  "type": "object",
  "additionalProperties": {
    "oneOf": [
      {
        "type": "object",
        "title":"Search criteria",
        "properties": {
          "eq": {
            "$ref": "#/definitions/value"
          },
          "neq": {
            "$ref": "#/definitions/value"
          },
          "gt": {
            "$ref": "#/definitions/value"
          },
          "gte": {
            "$ref": "#/definitions/value"
          },
          "lt": {
            "$ref": "#/definitions/value"
          },
          "lte": {
            "$ref": "#/definitions/value"
          },
          "inq": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/value"
            }
          },
          "nin": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/value"
            }
          },
          "like": {
            "$ref": "#/definitions/value"
          },
          "nlike": {
            "$ref": "#/definitions/value"
          },
          "regexp": {
            "$ref": "#/definitions/value"
          }
        }
      },
      {
        "title": "Value",
        "$ref": "#/definitions/value"
      }
    ]
  },
  "ui": {
    "ui:subTitle": "A set of conditions all results must match"
  },
  "definitions": {
    "value": {
      "type": [
        "string",
        "number",
        "boolean",
        "array",
        "null"
      ]
    }
  }
}

For example :

However, we recommend to use RAW Query instead, because it much easier to use for complex query. You can then divide the rows into separated tasks by using transformer “Get branches from a pattern”

These article might help you

Thank you for your reply!