Important

Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.

Writing Dynamic SQL

When you write dynamic SQL, you will often follow one or more of the approaches outlined below.

Task

Approach

Run a non-SELECT dynamic query such as an UPDATE

Use EXECUTE IMMEDIATE.

Run a dynamic SELECT query and output the results to the console or a client application.

Use EXECUTE IMMEDIATE with ECHO SELECT

Run a dynamic SELECT query that returns multiple rows. Iterate through each row and perform an action on the row.

Use COLLECT with a query type variable.

Run a dynamic SELECT query that returns only one row and one column.

Use SCALAR with a QUERY type variable.

Last modified:

Was this article helpful?