2

I have multiple select statements and I have to execute a particular select statement based on parameter we passed to script in Exasol. This is pretty known to me in SQL server where we can achieve this functionality using inline function or stored procedure.

1 Answers1

2

Exasol has a similar facility - it is called scripting in Exasol and is described in detail (with examples) in Section 3.5 of the Exasol User Manual. The manual can be downloaded from the Exasol website here :

https://www.exasol.com/portal/display/DOC/User+Manual+6.0

Dave S
  • 71
  • 2
  • Thanks for reference. I have tried using CREATE SCRIPT script_2 RETURNS TABLE AS exit(query([[SELECT * FROM DUAL]])) script for simple execution of table; it gives error of unfinished command. Next i want to pass a value to this script which will decide which query to be executed. Could you please provide a simple working example. – Ganesh Gadakar Jan 02 '19 at 07:18
  • Its done. CREATE or replace SCRIPT script_2(a) RETURNS TABLE AS if a==1 then exit(query([[SELECT 1 FROM DUAL]])) else exit(query([[SELECT 2,3 FROM DUAL]])) end / – Ganesh Gadakar Jan 02 '19 at 07:39