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.
- You can write only row functions in the SQL expression editor.
- Do not use select" statement in the SQL expression editor. It will be generated automatically when you save the SQL expression.
-
Do not end your SQL expression with ; (semicolon). It will be generated automatically when you save the SQL expression.
-
Do not write an Aggregate function in the SQL expression editor. It will not execute and your query will fail.
-
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 -
You can use the above Operator functions in the Query Filters section.
-
If you write any Aggregate functions, then you can select a Group by attribute after defining the Query Filter.
-
You cannot perform any operator functions on the custom header.
-
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.
Updated 4 months ago