Reputation: 185
I am new with Exasol and haven't found out how one can declare a variable as in SQL. In SQL I would write:
DECLARE @variable_name datatype [ = initial_value ]
And in Exasol? Many thanks in advance for the help.
Upvotes: 2
Views: 2161
Reputation: 186
Here you go:
define stuff='hello';
SELECT * FROM table WHERE column=':stuff';
Upvotes: 1
Reputation: 15
In Exasol a stored procedure is described as a 'SCRIPT'. Script variables are typed dynamically.
You can use script variables in the following way:
local msg='Hello'
https://docs.exasol.com/content/database_concepts/scripting/general_script_language.htm
In ExaPlus (user interface) you could use "define".
Example
define msg='Hello';
https://optimumretrieval.wordpress.com/2016/12/15/using-variables-in-exaplus/
Upvotes: 1
Reputation: 146
There is such feature in ExaPlus client. It's described in User Manual.
But you have to keep a few things in mind:
But you may still build your query normally with placeholders pointing to variables using any programming language.
Upvotes: 0