Skip to content

Commit

Permalink
fix SQL Terminator procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
BearDimonR committed Jul 5, 2022
1 parent 729f0f3 commit d088ec0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reverse_engineering/helpers/oracleHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ const splitEntityNames = names => {
};

const setSQLTerminator = () => {
return execute(`EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR', TRUE)`);
return execute(`BEGIN
DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR', TRUE);
END;`);
}

const getDDL = async (tableName, schema, logger) => {
Expand Down Expand Up @@ -548,12 +550,12 @@ const getDDL = async (tableName, schema, logger) => {
: '';
const columnComments = _.map(queryObj.columnComments,
c => `COMMENT ON COLUMN ${escapeName(schema)}.${escapeName(tableName)}.${escapeName(c.name)} IS ${escapeComment(c.comment)};`);
const ddl = `${queryObj.tableDDL};
${_.join(queryObj.indexDDLs, ';\n')};
const ddl = `${queryObj.tableDDL}
${_.join(queryObj.indexDDLs, '\n')}
${tableComment}\n
${_.join(columnComments, '\n')}`;
return {
ddl: ddl.replaceAll(/[;]{2,}/g, ';'),
ddl: ddl,
jsonColumns: queryObj.jsonColumns,
countOfRecords: queryObj.countOfRecords,
};
Expand Down

0 comments on commit d088ec0

Please sign in to comment.