Define custom headers using SQL expressions

Webex Campaign supports Redshift SQL expressions/MariaDB SQL expressions (depending on your account being hosted on AWS or Azure respectively). However, there are a few restrictions on what you can write in the SQL expression editor.


  1. You can write only row functions in the SQL expression editor.
  2. Do not use select" statement in the SQL expression editor. It will be generated automatically when you save the SQL expression.

  1. Do not end your SQL expression with ; (semicolon). It will be generated automatically when you save the SQL expression.

  2. Do not write an Aggregate function in the SQL expression editor. It will not execute and your query will fail.

  3. Do not write Operator functions in the SQL expression editor. Some of the operator functions like,

    ◘ >
    ◘ <
    ◘ =
    ◘ is null
    ◘ is not null
    ◘ contains
    ◘ in
    ◘ between
    ◘ not in

  4. You can use the above Operator functions in the Query Filters section.

  5. If you write any Aggregate functions, then you can select a Group by attribute after defining the Query Filter.

  6. You cannot perform any operator functions on the custom header.

  7. REGEXP and JSON functions are not supported in SQL expression editor.

Some SQL Expressions with examples:

Following are a few sample SQL expressions that you can write in SQL expression editor.

CONCAT
To concatenate 2 column strings and return the resulting string.

 **Syntax**
 CONCAT (string1 string2)

 **Example**
 CONCAT (FIRSTNAME, ' ',LASTNAME)

 **Result**
 FIRSTNAME LASTNAME

TO_DATE
To convert a date represented in a character string to a database default (yyyy-mm-dd) Date data type.

 **Syntax**
 TO_DATE(string, format)

 **Example**
 to_date( '02 Oct 2001', 'DD Mon YYYY')

 **Result**
 2001-10-02

AWS-hosted tenants: Refer to Redshift documentation to explore other SQL functions.

Azure hosted tenants: Refer to MadiaDB to explore other SQL functions.