Skip to main content

Add Parameters to Query Mode

Use parameters in your SQL queries by wrapping them in double curly braces.

Add Parameters using Native Code​

To parameterize queries use {{Param}} syntax to an underlying query and it will be applied automatically. It looks like:

query mode

Date and Date-Range Parameters​

DATE data type is used for values with a date part but no time part.

TIMESTAMP

The TIMESTAMP data type is an extension of the DATE datatype. It stores values that include the date and time of day. For example, 12/17/1997 17:37:16. Timestamps are presented without time zone information.

You must define a DATE and TIMESTAMP parameter in your query in the following syntax:

Select * from cab_records.'ny_cab_data'where pickup_datetime = {{time}}

For S3 object queries to add a DATE and TIMESTAMP parameters you need to use the following syntax:

For example, if your goal is to retrieve the Order_date data, greater than 2016-08-11 you can send this request to Bolt as a parameterized query like the following:

Select
*
from
S3Object [*][*]s
where
TO_TIMESTAMP(s."Order Date", 'yyyy-mm-dd')>{{order_date}}

Another Example

Suppose you want to pass the Order_date as a parameter equal to 11/08/2016

The query would look like this:

Select
*
from
S3Object s
where
TO_TIMESTAMP(s."Order Date", 'yyyy-mm-dd')={{order_date}}

Note

For S3 object queries, add To_TIMESTAMP function to query Date and Timestamp data types

Any Question? 🤓​

We are always an email away to help you resolve your queries. If you need any help, write to us at - 📧 support@boltic.io