From 205fb4cb792561254a214ab9d6fcf5062adb134a Mon Sep 17 00:00:00 2001 From: BeardimonR Date: Thu, 7 Jul 2022 09:31:36 +0300 Subject: [PATCH] add SQL Terminator to the view DDL retrieval --- reverse_engineering/helpers/oracleHelper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reverse_engineering/helpers/oracleHelper.js b/reverse_engineering/helpers/oracleHelper.js index afdf5ea..633d591 100644 --- a/reverse_engineering/helpers/oracleHelper.js +++ b/reverse_engineering/helpers/oracleHelper.js @@ -701,9 +701,10 @@ const getJsonSchema = async (jsonColumns, records) => { const getViewDDL = async (viewName, logger) => { try { + await setSQLTerminator(); const queryResult = await execute(`SELECT DBMS_METADATA.GET_DDL('VIEW', VIEW_NAME, OWNER) FROM ALL_VIEWS WHERE VIEW_NAME='${viewName}'`); - - return `${(await _.first(_.first(queryResult)).getData())};`; + const viewDDL = await _.first(_.first(queryResult)).getData(); + return viewDDL; } catch (err) { logger.log('error', { message: 'Cannot get DDL for view: ' + viewName,