sql_execute module¶
SQL_EXECUTION
Generic SQL Execution script for running statements via a specified connection.
Parameters:
p_connection_name (
str) – The name of the Exasol connection to be used.p_sql_stmt (
str) – The SQL statement(s) to be executed.p_raise_exception (
bool) – IfTrue, SQL exceptions will be raised; ifFalse, they will be caught and reported in the output.p_threads (
int) – Number of worker threads for parallel execution.
returns: emits – The result of the SQL execution (structure depends on the input statement).
raises RequestException: In case of connection or execution errors.
Examples¶
Parallel execution of multiple timestamps
1select sql_execute('MY_CONNECTION', sql_stmt, false, 4)
2emits (ts varchar(30))
3from (
4 select 'select systimestamp as x' as sql_stmt union all
5 select 'select systimestamp as x' as sql_stmt union all
6 select 'select systimestamp as x' as sql_stmt union all
7 select 'invalid sql' as sql_stmt
8);