diff --git a/RESTAPI/Functions/EXECUTE_SQL.sql b/RESTAPI/Functions/EXECUTE_SQL.sql
index 59cbe30..4ef0cf1 100644
--- a/RESTAPI/Functions/EXECUTE_SQL.sql
+++ b/RESTAPI/Functions/EXECUTE_SQL.sql
@@ -1 +1,113 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@ÙÅâãÁ×ÉKÅçÅÃäãÅmâØÓ@M@
%ÉÕÁ××åÅÙ@åÁÙÃÈÁÙMñð]@ÄÅÆÁäÓã@@}¥ñ}@@k@
%ÉÕÁ××ÕÁÔÅ@åÁÙÃÈÁÙMñòø]@ÄÅÆÁäÓã@@}}@@k@
%ÉÕÁ××ÆäÕÃ@åÁÙÃÈÁÙMñòø]@ÄÅÆÁäÓã@@}}@@k@
%ÉÕâäÂâãÉãäãÅ@åÁÙÃÈÁÙMñðòôð]@ÄÅÆÁäÓã@@ÕäÓÓ@@]@
%ÙÅãäÙÕâ@ÃÓÖÂMòñô÷ôøóöô÷]@@@
%ÓÁÕÇäÁÇÅ@âØÓ@
%â×ÅÃÉÆÉÃ@ÙÅâãÁ×ÉKÅçÅÃäãÅmâØÓ@
%ÕÖã@ÄÅãÅÙÔÉÕÉâãÉÃ@
%ÔÖÄÉÆÉÅâ@âØÓ@ÄÁãÁ@
%ÃÁÓÓÅÄ@ÖÕ@ÕäÓÓ@ÉÕ×äã@
%ÕÖã@ÆÅÕÃÅÄ@
%âÅã@Ö×ãÉÖÕ@@ÁÓæÂÓÒ@~@\ÁÓÓÙÅÁÄ@k@
%ÁÓæÃ×èÄãÁ@~@\Ö×ãÉÔÉéÅ@k@
%ÃÖÔÔÉã@~@\ÕÖÕÅ@k@
%ÄÂÇåÉÅæ@~@\âÖäÙÃÅ@k@
%ÄÅÃÙÅâäÓã@~@Móñk@óñk@ðð]@k@
%ÄèÕÄÆãÃÖÓ@~@\ÕÖ@k@
%ÄèÕäâÙ×ÙÆ@~@\ÖæÕÅÙ@k@
%âÙãâÅØ@~@\ÈÅç@@@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@âØÓmâãÁãÅÔÅÕã@åÁÙÃÈÁÙ@M@óòððð@]@ÄÅÆÁäÓã@ÕäÓÓ@^@
%ÄÅÃÓÁÙÅ@âØÓm×ÁÙÁÔâ@åÁÙÃÈÁÙ@M@ñðòôð@]@ÄÅÆÁäÓã@ÕäÓÓ@^@
%ÄÅÃÓÁÙÅ@âØÓmÙÅ×ÓÁÃÅÔÅÕã@åÁÙÃÈÁÙ@M@òðôø@]@ÄÅÆÁäÓã@ÕäÓÓ@^@
%ÄÅÃÓÁÙÅ@âØÓmÃÓÖÂ@ÃÓÖÂ@M@ò@Ç@]@ÄÅÆÁäÓã@ÕäÓÓ@^@
%ÄÅÃÓÁÙÅ@ÃÖÕãÉÕäÅ@ÈÁÕÄÓÅÙ@ÆÖÙ@âØÓÅçÃÅ×ãÉÖÕ@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@åmâØÓâãÁãÅ@ÃÈÁÙ@M@õ@]@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@ÉÕã@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@ÃÈÁÙ@M@÷@]@^@
%ÄÅÃÓÁÙÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@ÃÓÖÂ@M@òðôø@]@^@
%ÇÅã@ÄÉÁÇÕÖâãÉÃâ@ÃÖÕÄÉãÉÖÕ@ñ@
%åmÄÂòmÙÅãäÙÕmÃÖÄÅ@~@ÄÂòmÙÅãäÙÕÅÄmâØÓÃÖÄÅ@k@
%åmâØÓâãÁãÅ@~@ÙÅãäÙÕÅÄmâØÓâãÁãÅ@k@
%åmÅÙÙÖÙmÔÅââÁÇÅ@~@ÔÅââÁÇÅmãÅçã@k@
%åmÄÂòmÔÅââÁÇÅmÉÄ@~@ÄÂòmÔÅââÁÇÅmÉÄ@^@
%ÙÅãäÙÕ@
%M@
%åÁÓäÅâ@ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}†�“¢…}@k@}âØÓÉ•†–}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%}âØÓâ£�£…}@åÁÓäÅ@åmâØÓâãÁãÅ@k@
%}âØÓÃ–„…}@åÁÓäÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@k@
%}”…¢¢�‡…ÉÄ}@åÁÓäÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@k@
%}”…¢¢�‡…}@åÁÓäÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@k@
%}ƒ¤™™…•£ã‰”…¢£�”—}@åÁÓäÅ@ÃäÙÙÅÕãmãÉÔÅâãÁÔ×@
%]@k@}âØÓâ£�£…”…•£}@åÁÓäÅ@âØÓmâãÁãÅÔÅÕã@ÆÖÙÔÁã@ÑâÖÕ@
%]@]@^@
%ÅÕÄ@^@
%``@Ç…£@âØÓ@£…”—“�£…@
%âÅã@âØÓmâãÁãÅÔÅÕã@~@M@
%âÅÓÅÃã@âØÓâãÔã@
%ÆÙÖÔ@ÙÅâãÁ×É@K@âØÓâãÔãâ@
%æÈÅÙÅ@M@Á××åÅÙ@k@Á××ÕÁÔÅ@k@Á××ÆäÕÃ@]@~@M@ÉÕÁ××åÅÙ@k@
%ÉÕÁ××ÕÁÔÅ@k@ÉÕÁ××ÆäÕÃ@]@]@^@
%``@Õ–™”�“‰©…@¢¤‚¢£‰£¤£…@ÑâÖÕ@‰•£–@�™™�¨@†–™”@
%âÅã@âØÓm×ÁÙÁÔâ@~@ÉÕâäÂâãÉãäãÅ@^@
%ÉÆ@âØÓm×ÁÙÁÔâ@Éâ@ÕÖã@ÕäÓÓ@
%ÁÕÄ@ãÙÉÔ@M@âØÓm×ÁÙÁÔâ@]@Ln@}}@ãÈÅÕ@
%ÉÆ@ÃÉâãÖÖÓâ@K@ÑâÖÕmãè×Å@M@âØÓm×ÁÙÁÔâ@]@Ln@}�™™�¨}@ãÈÅÕ@
%âÅã@âØÓm×ÁÙÁÔâ@~@ÑâÖÕmÁÙÙÁè@M@ÉÕâäÂâãÉãäãÅ@ÆÖÙÔÁã@ÑâÖÕ@]@^@
%ÅÕÄ@ÉÆ@^@
%ÅÕÄ@ÉÆ@^@
%``@â¤‚¢£‰£¤£…@—�™�”…£…™¢@‰†@¦…@ˆ�¥…@‚–£ˆ@£…”—“�£…@�•„@¢¤‚¢@
%ÉÆ@âØÓmâãÁãÅÔÅÕã@Éâ@ÕÖã@ÕäÓÓ@
%ÁÕÄ@âØÓm×ÁÙÁÔâ@Éâ@ÕÖã@ÕäÓÓ@ãÈÅÕ@
%ÆÖÙ@âÅÓÅÃã@Á×××ÁÙÁÔ@
%ÆÙÖÔ@ãÁÂÓÅ@M@
%ÙÅâãÁ×É@K@ÇÅãm×ÁÙÁÔm×ÓÁÃÅÈÖÓÄÅÙâ@M@
%ÉÕÁ××åÅÙ@k@ÉÕÁ××ÕÁÔÅ@k@ÉÕÁ××ÆäÕÃ@]@
%]@
%ÄÖ@
%âÅã@âØÓmÙÅ×ÓÁÃÅÔÅÕã@~@ÃÖÁÓÅâÃÅ@M@
%ÑâÖÕmåÁÓäÅ@M@âØÓm×ÁÙÁÔâ@k@}[º\»K}@OO@ãÙÉÔ@M@Á×××ÁÙÁÔ@]@]@k@
%ÑâÖÕmØäÅÙè@M@âØÓm×ÁÙÁÔâ@k@}[º\»K}@OO@ãÙÉÔ@M@Á×××ÁÙÁÔ@]@]@]@^@
%``@Æ‰‡¤™…@–¤£@£¨—…@–†@£ˆ‰¢@—�™�”@
%âÅã@âØÓmâãÁãÅÔÅÕã@~@ÙÅ×ÓÁÃÅ@M@
%âØÓmâãÁãÅÔÅÕã@k@}ÀÀ}@OO@ãÙÉÔ@M@Á×××ÁÙÁÔ@]@OO@}ÐÐ}@k@
%ÉÆÕäÓÓ@M@
%âØÓmÙÅ×ÓÁÃÅÔÅÕã@k@}ÀÀ}@OO@ãÙÉÔ@M@Á×××ÁÙÁÔ@]@OO@}ÐÐ}@]@
%]@^@
%ÅÕÄ@ÆÖÙ@^@
%ÅÕÄ@ÉÆ@^@
%``@Å§…ƒ¤£…@„¨•�”‰ƒ�““¨@
%âÅã@ÃÉâãÖÖÓâ@K@âØÓmâãÁãÅÔÅÕã@~@âØÓmâãÁãÅÔÅÕã@^@
%âÅã@âØÓmâãÁãÅÔ
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION RESTAPI.EXECUTE_SQL ( 
+	INAPPVER VARCHAR(10) DEFAULT  'v1'  , 
+	INAPPNAME VARCHAR(128) DEFAULT  ''  , 
+	INAPPFUNC VARCHAR(128) DEFAULT  ''  , 
+	INSUBSTITUTE VARCHAR(10240) DEFAULT  NULL  ) 
+	RETURNS CLOB(2147483647)   
+	LANGUAGE SQL 
+	SPECIFIC RESTAPI.EXECUTE_SQL 
+	NOT DETERMINISTIC 
+	MODIFIES SQL DATA 
+	CALLED ON NULL INPUT 
+	NOT FENCED 
+	SET OPTION  ALWBLK = *ALLREAD , 
+	ALWCPYDTA = *OPTIMIZE , 
+	COMMIT = *NONE , 
+	DBGVIEW = *SOURCE , 
+	DECRESULT = (31, 31, 00) , 
+	DYNDFTCOL = *NO , 
+	DYNUSRPRF = *OWNER , 
+	SRTSEQ = *HEX   
+	BEGIN 
+DECLARE SQL_STATEMENT VARCHAR ( 32000 ) DEFAULT NULL ; 
+DECLARE SQL_PARAMS VARCHAR ( 10240 ) DEFAULT NULL ; 
+DECLARE SQL_REPLACEMENT VARCHAR ( 2048 ) DEFAULT NULL ; 
+DECLARE SQL_CLOB CLOB ( 2 G ) DEFAULT NULL ; 
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION 
+BEGIN 
+DECLARE V_SQLSTATE CHAR ( 5 ) ; 
+DECLARE V_DB2_RETURN_CODE INT ; 
+DECLARE V_DB2_MESSAGE_ID CHAR ( 7 ) ; 
+DECLARE V_ERROR_MESSAGE CLOB ( 2048 ) ; 
+GET DIAGNOSTICS CONDITION 1 
+V_DB2_RETURN_CODE = DB2_RETURNED_SQLCODE , 
+V_SQLSTATE = RETURNED_SQLSTATE , 
+V_ERROR_MESSAGE = MESSAGE_TEXT , 
+V_DB2_MESSAGE_ID = DB2_MESSAGE_ID ; 
+RETURN 
+( 
+VALUES JSON_OBJECT ( 
+'success' VALUE 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'SQLState' VALUE V_SQLSTATE , 
+'SQLCode' VALUE V_DB2_RETURN_CODE , 
+'messageID' VALUE V_DB2_MESSAGE_ID , 
+'message' VALUE V_ERROR_MESSAGE , 
+'currentTimestamp' VALUE CURRENT_TIMESTAMP 
+) , 'SQLStatement' VALUE SQL_STATEMENT FORMAT JSON 
+) ) ; 
+END ; 
+-- Get SQL template 
+SET SQL_STATEMENT = ( 
+SELECT SQLSTMT 
+FROM RESTAPI . SQLSTMTS 
+WHERE ( APPVER , APPNAME , APPFUNC ) = ( INAPPVER , 
+INAPPNAME , INAPPFUNC ) ) ; 
+-- Normalize substitute JSON into array form 
+SET SQL_PARAMS = INSUBSTITUTE ; 
+IF SQL_PARAMS IS NOT NULL 
+AND TRIM ( SQL_PARAMS ) <> '' THEN 
+IF CISTOOLS . JSON_TYPE ( SQL_PARAMS ) <> 'array' THEN 
+SET SQL_PARAMS = JSON_ARRAY ( INSUBSTITUTE FORMAT JSON ) ; 
+END IF ; 
+END IF ; 
+-- Substitute parameters if we have both template and subs 
+IF SQL_STATEMENT IS NOT NULL 
+AND SQL_PARAMS IS NOT NULL THEN 
+FOR SELECT APPPARAM 
+FROM TABLE ( 
+RESTAPI . GET_PARAM_PLACEHOLDERS ( 
+INAPPVER , INAPPNAME , INAPPFUNC ) 
+) 
+DO 
+SET SQL_REPLACEMENT = COALESCE ( 
+JSON_VALUE ( SQL_PARAMS , '$[*].' || TRIM ( APPPARAM ) ) , 
+JSON_QUERY ( SQL_PARAMS , '$[*].' || TRIM ( APPPARAM ) ) ) ; 
+-- Figure out type of this param 
+SET SQL_STATEMENT = REPLACE ( 
+SQL_STATEMENT , '{{' || TRIM ( APPPARAM ) || '}}' , 
+IFNULL ( 
+SQL_REPLACEMENT , '{{' || TRIM ( APPPARAM ) || '}}' ) 
+) ; 
+END FOR ; 
+END IF ; 
+-- Execute dynamically 
+SET CISTOOLS . SQL_STATEMENT = SQL_STATEMENT ; 
+SET SQL_STATEMENT = 'Values ((' || SQL_STATEMENT || ')) Into ?' ; 
+PREPARE SQL_ FROM SQL_STATEMENT ; 
+EXECUTE SQL_ USING SQL_CLOB ; 
+-- After Execute Sql_ Using SQL_CLOB; 
+-- Detect if SQL_CLOB is already JSON object with success/data/result 
+IF LEFT ( LTRIM ( SQL_CLOB ) , 1 ) = '{' 
+AND ( LOCATE ( '"success"' , SQL_CLOB ) > 0 ) 
+AND ( LOCATE ( '"data"' , SQL_CLOB ) > 0 
+OR LOCATE ( '"result"' , SQL_CLOB ) > 0 
+OR LOCATE ( '"SQLInfo"' , SQL_CLOB ) > 0 ) THEN 
+-- Return raw JSON as is 
+RETURN SQL_CLOB ; 
+END IF ; 
+-- Wrap in standard envelope 
+RETURN JSON_OBJECT ( 
+'success' : 'true' , 'data' : SQL_CLOB FORMAT JSON 
+) ; 
+END  ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION RESTAPI.EXECUTE_SQL 
+TO PUBLIC ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION RESTAPI.EXECUTE_SQL 
+TO QSECOFR WITH GRANT OPTION ; 
+
