diff --git a/RESTAPI/Functions/GENERATE_DBML.sql b/RESTAPI/Functions/GENERATE_DBML.sql
index 6e9966f..0c9ccde 100644
--- a/RESTAPI/Functions/GENERATE_DBML.sql
+++ b/RESTAPI/Functions/GENERATE_DBML.sql
@@ -1 +1,172 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@ÙÅâãÁ×ÉKÇÅÕÅÙÁãÅmÄÂÔÓ@M@
%ÉÕÁ××åÅÙ@åÁÙÃÈÁÙMñð]@k@
%ÉÕÁ××ÕÁÔÅ@åÁÙÃÈÁÙMñòø]@]@
%ÙÅãäÙÕâ@ÃÓÖÂMòñô÷ôøóöô÷]@@@
%ÓÁÕÇäÁÇÅ@âØÓ@
%â×ÅÃÉÆÉÃ@ÙÅâãÁ×ÉKÇÅÕÅÙÁãÅmÄÂÔÓ@
%ÕÖã@ÄÅãÅÙÔÉÕÉâãÉÃ@
%ÙÅÁÄâ@âØÓ@ÄÁãÁ@
%ÃÁÓÓÅÄ@ÖÕ@ÕäÓÓ@ÉÕ×äã@
%âÅã@Ö×ãÉÖÕ@@ÁÓæÂÓÒ@~@\ÁÓÓÙÅÁÄ@k@
%ÁÓæÃ×èÄãÁ@~@\Ö×ãÉÔÉéÅ@k@
%ÃÖÔÔÉã@~@\ÕÖÕÅ@k@
%ÄÂÇåÉÅæ@~@\âÖäÙÃÅ@k@
%ÄÅÃÙÅâäÓã@~@Móñk@óñk@ðð]@k@
%ÄÓè×Ù×@~@\ÕÖ@k@
%ÄèÕÄÆãÃÖÓ@~@\ÕÖ@k@
%ÄèÕäâÙ×ÙÆ@~@\ÖæÕÅÙ@k@
%âÙãâÅØ@~@\ÈÅç@@@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@åmÙÅâäÓã@ÃÓÖÂ@M@ò@Ç@]@^@
%âÅÓÅÃã@çÔÓâÅÙÉÁÓÉéÅ@M@ÃÖÕãÅÕã@
%çÔÓÅÓÅÔÅÕã@M@ÕÁÔÅ@„‚”“@k@çÔÓÁããÙÉÂäãÅâ@M@}a}@OO@ÉÕÁ××åÅÙ@Áâ@
%™…¢£ä™‰×�£ˆã…”—“�£…@k@}ñKð}@Áâ@¥…™¢‰–•@]@k@çÔÓÁÇÇ@M@
%çÔÓÅÓÅÔÅÕã@M@ÕÁÔÅ@—™–‡™�”@k@çÔÓÁããÙÉÂäãÅâ@M@ÃÖÁÓÅâÃÅ@M@
%Ø@K@ÅÙÙÖÙÔâÇ@k@}É•£…™•�“@¢…™¥…™@…™™–™}@]@Áâ@…™™–™”…¢¢�‡…@k@
%}\ÕÖÕÅ}@Áâ@ˆ££—ˆ…�„…™¢@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@Èãã×âãÁãäâÆÁÉÓäÙÅ@k@}õðð}@]@Áâ@ˆ££—¢£�£¤¢–•†�‰“¤™…@k@
%ÃÖÁÓÅâÃÅ@M@Ø@K@Èãã×âãÁãäââäÃÃÅââ@k@}òðð}@]@Áâ@
%ˆ££—¢£�£¤¢–•¢¤ƒƒ…¢¢@k@Ø@K@×ÙÖÇÕÁÔÅ@OO@}É•—¤£}@Áâ@
%‰•—¤£æ™�——…™É„…•£‰†‰…™@k@Ø@K@×ÙÖÇÕÁÔÅ@Áâ@•�”…@k@Ø@K@×ÙÖÇÕÁÔÅ@OO@
%}Ù…¢¤“£}@Áâ@–¤£—¤£æ™�——…™É„…•£‰†‰…™@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@ØäÅÙèãè×Å@k@}”…„‰�`™…¢–¤™ƒ…}@]@Áâ@˜¤…™¨£¨—…@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@ÙÅâãÃÖÕâäÔÅâ@k@}\a\}@]@Áâ@™…¢£Ã–•¢¤”…¢@k@Ø@K@ÆäÕÃÔÅãÈÖÄ@Áâ@
%™…¢£È££—Ù…˜¤…¢£Ô…£ˆ–„@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@ÙÅâã×ÙÖÄäÃÅâ@k@}�——“‰ƒ�£‰–•a‘¢–•}@]@Áâ@™…¢£×™–„¤ƒ…¢@k@
%Ø@K@ÙÅâãäÙÉ@Áâ@™…¢£ä™‰×�£ˆã…”—“�£…@k@}\ÅÙÙÖÙâ}@Áâ@
%™…£¤™•¢˜“¢£�£…@k@}£™¤…}@Áâ@£™…�£¦�™•‰•‡�¢…™™–™@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@ãÙÉÔÔÖÄÅ@k@}\ãÙÁÉÓÉÕÇ}@]@Áâ@£™‰””–„…@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@æÙÁ×ÉÕ×äã@k@}†�“¢…}@]@Áâ@¦™�—É•—¤£×�™�”¢@k@ÃÖÁÓÅâÃÅ@M@
%Ø@K@æÙÁ×Öäã×äã@k@}£™¤…}@]@Áâ@¦™�—Ö¤£—¤£×�™�”@]@k@çÔÓÅÓÅÔÅÕã@M@
%ÕÁÔÅ@¢˜“@k@çÔÓÁããÙÉÂäãÅâ@M@
%``@ä¢…@âØÓâãÔã@„‰™…ƒ£“¨k@™…—“�ƒ‰•‡@ÀÀ—�™�”ÐÐ@¦‰£ˆ@o@
%Ø@K@âØÓâãÔãmÃÖÕåÅÙãÅÄ@Áâ@¢£�£…”…•£@]@k@Ø@K@ÄÁãÁãÁÇâ@]@]@ÖÙÄÅÙ@Âè@
%Ø@K@Á××ÆäÕÃ@]@]@Áâ@ÃÓÖÂ@M@ò@Ç@]@]@
%ÉÕãÖ@åmÙÅâäÓã@
%ÆÙÖÔ@
%M@
%âÅÓÅÃã@Ã@K@Á××åÅÙ@k@Ã@K@Á××ÕÁÔÅ@k@Ã@K@Á××ÆäÕÃ@k@Ã@K@ÆäÕÃÔÅãÈÖÄ@k@
%Ã@K@ÙÅâãäÙÉ@k@Ã@K@ØäÅÙèãè×Å@k@Ã@K@Èãã×âãÁãäââäÃÃÅââ@k@
%Ã@K@Èãã×âãÁãäâÆÁÉÓäÙÅ@k@Ã@K@ÙÅâãÃÖÕâäÔÅâ@k@Ã@K@ÙÅâã×ÙÖÄäÃÅâ@k@
%Ã@K@ãÙÉÔÔÖÄÅ@k@Ã@K@æÙÁ×ÉÕ×äã@k@Ã@K@æÙÁ×Öäã×äã@k@
%``@Å§£™�ƒ£@†‰™¢£@õðð@…™™–™@”…¢¢�‡…@†™–”@ÆäÕÃÅÙÙÖÙâ@ÑâÖÕ@�™™�¨@
%M@âÅÓÅÃã@Å@K@ÅÙÙÔâÇ@
%ÆÙÖÔ@ÑâÖÕmãÁÂÓÅ@M@
%Ã@K@ÆäÕÃÅÙÙÖÙâ@k@
%}[º\»}@
%ÃÖÓäÔÕâ@M@
%ÅÙÙÔâÇ@åÁÙÃÈÁÙ@M@òõö@]@×ÁãÈ@}[Kõðð}@
%]@
%]@Áâ@Å@
%æÈÅÙÅ@Å@K@ÅÙÙÔâÇ@Éâ@ÕÖã@ÕäÓÓ@
%ÆÅãÃÈ@ÆÉÙâã@ñ@ÙÖæ@ÖÕÓè@]@Áâ@ÅÙÙÖÙÔâÇ@k@
%``@ä¢…@Á××ÆäÕÃ@„‰™…ƒ£“¨@�¢@—™–‡™�”@•�”…@
%Ã@K@Á××ÆäÕÃ@Áâ@×ÙÖÇÕÁÔÅ@k@
%``@Ã–•¥…™£@âØÓâãÔãz@™…—“�ƒ…@ÀÀ—�™�”ÐÐ@¦‰£ˆ@o@”�™’…™¢@
%ÙÅÇÅç×mÙÅ×ÓÁÃÅ@M@Ã@K@âØÓâãÔã@k@}àÀàÀº°Ð»NàÐàÐ}@k@}o}@]@
%Áâ@âØÓâãÔãmÃÖÕåÅÙãÅÄ@k@
%``@Â¤‰“„@çÔÓ@„�£�@…“…”…•£¢@¤¢‰•‡@çÔÓÃÖÕÃÁã@†–™@—�£ˆk@†–™”@M•–@„…†�¤“£]k@†–™”@M¦‰``£ˆ@„…†�¤“£]@
%çÔÓÃÖÕÃÁã@M@
%``@×�£ˆ@—�™�”¢@
%M@
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION RESTAPI.GENERATE_DBML ( 
+	INAPPVER VARCHAR(10) , 
+	INAPPNAME VARCHAR(128) ) 
+	RETURNS CLOB(2147483647)   
+	LANGUAGE SQL 
+	SPECIFIC RESTAPI.GENERATE_DBML 
+	NOT DETERMINISTIC 
+	READS SQL DATA 
+	CALLED ON NULL INPUT 
+	SET OPTION  ALWBLK = *ALLREAD , 
+	ALWCPYDTA = *OPTIMIZE , 
+	COMMIT = *NONE , 
+	DBGVIEW = *SOURCE , 
+	DECRESULT = (31, 31, 00) , 
+	DLYPRP = *NO , 
+	DYNDFTCOL = *NO , 
+	DYNUSRPRF = *OWNER , 
+	SRTSEQ = *HEX   
+	BEGIN 
+DECLARE V_RESULT CLOB ( 2 G ) ; 
+SELECT XMLSERIALIZE ( CONTENT 
+XMLELEMENT ( NAME "dbml" , XMLATTRIBUTES ( '/' || INAPPVER AS 
+"restUriPathTemplate" , '1.0' AS "version" ) , XMLAGG ( 
+XMLELEMENT ( NAME "program" , XMLATTRIBUTES ( COALESCE ( 
+Q . ERRORMSG , 'Internal server error' ) AS "errormessage" , 
+'*NONE' AS "httpheaders" , COALESCE ( 
+Q . HTTPSTATUSFAILURE , '500' ) AS "httpstatusonfailure" , 
+COALESCE ( Q . HTTPSTATUSSUCCESS , '200' ) AS 
+"httpstatusonsuccess" , Q . PROGNAME || 'Input' AS 
+"inputWrapperIdentifier" , Q . PROGNAME AS "name" , Q . PROGNAME || 
+'Result' AS "outputWrapperIdentifier" , COALESCE ( 
+Q . QUERYTYPE , 'media-resource' ) AS "querytype" , COALESCE ( 
+Q . RESTCONSUMES , '*/*' ) AS "restConsumes" , Q . FUNCMETHOD AS 
+"restHttpRequestMethod" , COALESCE ( 
+Q . RESTPRODUCES , 'application/json' ) AS "restProduces" , 
+Q . RESTURI AS "restUriPathTemplate" , '*ERRORS' AS 
+"returnsqlstate" , 'true' AS "treatwarningaserror" , COALESCE ( 
+Q . TRIMMODE , '*TRAILING' ) AS "trimmode" , COALESCE ( 
+Q . WRAPINPUT , 'false' ) AS "wrapInputParams" , COALESCE ( 
+Q . WRAPOUTPUT , 'true' ) AS "wrapOutputParam" ) , XMLELEMENT ( 
+NAME "sql" , XMLATTRIBUTES ( 
+-- Use SQLSTMT directly, replacing {{param}} with ? 
+Q . SQLSTMT_CONVERTED AS "statement" ) , Q . DATATAGS ) ) ORDER BY 
+Q . APPFUNC ) ) AS CLOB ( 2 G ) ) 
+INTO V_RESULT 
+FROM 
+( 
+SELECT C . APPVER , C . APPNAME , C . APPFUNC , C . FUNCMETHOD , 
+C . RESTURI , C . QUERYTYPE , C . HTTPSTATUSSUCCESS , 
+C . HTTPSTATUSFAILURE , C . RESTCONSUMES , C . RESTPRODUCES , 
+C . TRIMMODE , C . WRAPINPUT , C . WRAPOUTPUT , 
+-- Extract first 500 error message from FUNCERRORS JSON array 
+( SELECT E . ERRMSG 
+FROM JSON_TABLE ( 
+C . FUNCERRORS , 
+'$[*]' 
+COLUMNS ( 
+ERRMSG VARCHAR ( 256 ) PATH '$."500"' 
+) 
+) AS E 
+WHERE E . ERRMSG IS NOT NULL 
+FETCH FIRST 1 ROW ONLY ) AS ERRORMSG , 
+-- Use APPFUNC directly as program name 
+C . APPFUNC AS PROGNAME , 
+-- Convert SQLSTMT: replace {{param}} with ? markers 
+REGEXP_REPLACE ( C . SQLSTMT , '\{\{[^}]+\}\}' , '?' ) 
+AS SQLSTMT_CONVERTED , 
+-- Build XML data elements using XMLCONCAT for path, form (no default), form (wi--th default) 
+XMLCONCAT ( 
+-- Path params 
+( 
+SELECT XMLAGG ( 
+XMLELEMENT ( NAME "data" , XMLATTRIBUTES ( '37' AS "ccsid" , 
+PP . PARAMNAME AS "name" , 
+CASE 
+WHEN PP . PARAMREQ = 'true' THEN 'false' 
+ELSE 'true' 
+END AS "nullable" , CAST ( PP . PARAMLEN AS VARCHAR ( 20 ) ) AS 
+"precision" , PP . PARAMNAME AS "restInPathParam" , PP . PARAMTYPE 
+AS "type" , 'input' AS "usage" ) ) ORDER BY PP . PARAMPOS ) 
+FROM JSON_TABLE ( 
+C . FUNCPARAMS , 
+'$[*]' 
+COLUMNS ( 
+PARAMPOS INT PATH '$.pos' , 
+PARAMNAME VARCHAR ( 128 ) PATH '$.name' , 
+PARAMTYPE VARCHAR ( 20 ) PATH '$.type' , 
+PARAMLEN INT PATH '$.length' , 
+PARAMREQ VARCHAR ( 10 ) PATH '$.required' , 
+PARAMLOC VARCHAR ( 20 ) PATH '$.location' 
+) 
+) AS PP 
+WHERE PP . PARAMLOC = 'path' ) , 
+-- Body/form params that are REQUIRED (no restInParamDefaultValue) 
+( 
+SELECT XMLAGG ( 
+XMLELEMENT ( NAME "data" , XMLATTRIBUTES ( '37' AS "ccsid" , 
+PF . PARAMNAME AS "name" , 'false' AS "nullable" , CAST ( 
+PF . PARAMLEN AS VARCHAR ( 20 ) ) AS "precision" , PF . PARAMNAME 
+AS "restInFormParam" , PF . PARAMTYPE AS "type" , 'input' AS 
+"usage" ) ) ORDER BY PF . PARAMPOS ) 
+FROM JSON_TABLE ( 
+C . FUNCPARAMS , 
+'$[*]' 
+COLUMNS ( 
+PARAMPOS INT PATH '$.pos' , 
+PARAMNAME VARCHAR ( 128 ) PATH '$.name' , 
+PARAMTYPE VARCHAR ( 20 ) PATH '$.type' , 
+PARAMLEN INT PATH '$.length' , 
+PARAMREQ VARCHAR ( 10 ) PATH '$.required' , 
+PARAMLOC VARCHAR ( 20 ) PATH '$.location' 
+) 
+) AS PF 
+WHERE PF . PARAMLOC <> 'path' 
+AND PF . PARAMREQ = 'true' ) , 
+-- Body/form params that are OPTIONAL (add restInParamDefaultValue) 
+( 
+SELECT XMLAGG ( 
+XMLELEMENT ( NAME "data" , XMLATTRIBUTES ( '37' AS "ccsid" , 
+PD . PARAMNAME AS "name" , 'true' AS "nullable" , CAST ( 
+PD . PARAMLEN AS VARCHAR ( 20 ) ) AS "precision" , PD . PARAMNAME 
+AS "restInFormParam" , 'null' AS "restInParamDefaultValue" , 
+PD . PARAMTYPE AS "type" , 'input' AS "usage" ) ) ORDER BY 
+PD . PARAMPOS ) 
+FROM JSON_TABLE ( 
+C . FUNCPARAMS , 
+'$[*]' 
+COLUMNS ( 
+PARAMPOS INT PATH '$.pos' , 
+PARAMNAME VARCHAR ( 128 ) PATH '$.name' , 
+PARAMTYPE VARCHAR ( 20 ) PATH '$.type' , 
+PARAMLEN INT PATH '$.length' , 
+PARAMREQ VARCHAR ( 10 ) PATH '$.required' , 
+PARAMLOC VARCHAR ( 20 ) PATH '$.location' , 
+PARAMDEFAULT VARCHAR ( 256 ) PATH 
+'$.default' 
+) 
+) AS PD 
+WHERE PD . PARAMLOC <> 'path' 
+AND PD . PARAMREQ = 'false' ) ) AS DATATAGS 
+FROM RESTAPI . API_CONFIG C 
+LEFT JOIN JSON_TABLE ( 
+C . FUNCPARAMS , 
+'$[*]' 
+COLUMNS ( 
+PARAMPOS INT PATH '$.pos' , 
+PARAMNAME VARCHAR ( 128 ) PATH '$.name' , 
+PARAMLOC VARCHAR ( 20 ) PATH '$.location' 
+) 
+) AS P 
+ON 1 = 1 
+WHERE ( C . APPVER , C . APPNAME ) = ( INAPPVER , INAPPNAME ) 
+GROUP BY C . APPVER , C . APPNAME , C . APPFUNC , C . FUNCMETHOD , 
+C . RESTURI , C . QUERYTYPE , C . HTTPSTATUSSUCCESS , 
+C . HTTPSTATUSFAILURE , C . RESTCONSUMES , 
+C . RESTPRODUCES , C . TRIMMODE , C . WRAPINPUT , 
+C . WRAPOUTPUT , C . FUNCPARAMS , C . FUNCERRORS , 
+C . SQLSTMT 
+) AS Q ; 
+RETURN CISTOOLS . STRIP_SPACES ( V_RESULT ) ; 
+END  ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION RESTAPI.GENERATE_DBML 
+TO AMAPICS WITH GRANT OPTION ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION RESTAPI.GENERATE_DBML 
+TO PUBLIC ; 
+
