Skip to content

Commit

Permalink
add SQL Terminator to the view DDL retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
BearDimonR committed Jul 7, 2022
1 parent d088ec0 commit 205fb4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions reverse_engineering/helpers/oracleHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 205fb4c

Please sign in to comment.