For both the Database Statement and database subquery, you may use any q snippet that you can use on a q console.
When parameters are passed, consider it as Sybase CEP Engine appending (<param1>;<param2>;<param3>) to the end of the statement.
In addition to the q results (called "flips" in kdb+ terminology), Sybase CEP Engine can read single atomic values, simple lists, and simple dictionaries. For example, if you have a variable called var1 in your kdb+ instance, you may read the value of that variable into Sybase CEP Engine. In this example, the database subquery is [[var1]], the schema of your expected database output has a single column, and the datatype of var1 is compatible with the datatype of the column into which the data is read.
If var1 is a simple list, it is read the same way as a single atomic value, with each element in the list being read as a separate row. Simple dictionaries are read the same way as simple lists, but with two values per row: the key and the value. To read dictionaries, your expected schema in Sybase CEP should contain a string for the key, and a compatible column for the value. Lists of lists, and dictionaries containing lists as values, are not supported.