Hey guys,
i am trying do write some kind of a dynamic procedure. I created a table which contains properties for some different cases, eg. table names, name of values and other stuff. The plan is to use a input paremeter in my procedure which identifies the properties which should be used. Here is a altered code snipped so you can understand what i am trying to do.
PROCEDURE "anyname" (IN OPTION nvarchar(30),OUT tt_someresults) LANGUAGE SQLSCRIPT SQL SECURITY INVOKER --DEFAULT SCHEMA <default_schema_name> READS SQL DATA AS -- Define Output Table BEGIN /***************************** Write your procedure logic *****************************/ -- GET responding Table from Properties valuetable1 = SELECT "TABLE1" FROM "SCHEMA"."PROPERTYTABLE" WHERE "OPTIONNAME" = OPTION; tt_someresults = SELECT "XYZ", "ZYX" FROM "SCHEMA".OPTION WHERE CONDITION; END;
The first step is to extend the procedure with dynamic table/schema and then for example diferent "SELECTs" and different conditions.
Has anyone an idea if it is possible to do so? It would be create because it would be a modular solution for some queries which would normally use more procedures.
Best Regards,
Lukas