<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="37" author="META" dbms="oracle" runOnChange="true" >
<comment>Load Metadata </comment>
<sqlFile dbms="oracle" endDelimiter="\n/\s*\n|\n/\s*$" path="procedures/prc_delete_metadata.sql" splitStatements="false" />
<rollback>
<sql>DROP PROCEDURE META.PRC_DELETE_METADATA</sql>
</rollback>
</changeSet>
</databaseChangeLog>
Procedure
=========
create or replace PROCEDURE PRC_DELETE_METADATA
AS
------------------------------------------------------------------------
-- Meta Data Deletor
------------------------------------------------------------------------
-- Name : PRC_DELETE_METADATA
-- Purpose : To Truncate the meta data table
-- Modified on : 12/18/2019
------------------------------------------------------------------------
-- Error variables
v_code VARCHAR2(30);
v_desc VARCHAR2(4000);
-- Contant variable
c_user CONSTANT VARCHAR(20) := 'META';
BEGIN
-- Deleting Stage table
-- DELETE FROM stg_metadata;
-- Deletion of load log
-- DELETE FROM METADATA_LOAD_LOG
-- WHERE created_by = c_user;
-- Deleting all the meta data tables
DELETE FROM data_element
WHERE create_user_id = c_user;
DELETE FROM data_type
END;
/
Here is the error i am getting
17:28:28,565 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
17:28:28,571 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
17:28:28,581 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
17:28:28,617 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
17:28:28,623 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
17:28:28,628 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
17:28:28,630 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [/opt/apps/idf/log/metadatadb.log]
17:28:28,634 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
17:28:28,635 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
17:28:28,636 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
17:28:28,637 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
17:28:28,640 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5b1d2887 - Registering current configuration as safe fallback point
Starting Liquibase at Sat, 21 Dec 2019 17:28:28 EST (version 3.6.3 built at 2019-01-29 11:34:48)
Unexpected error running Liquibase: ORA-00900: invalid SQL statement
[Failed SQL: end]
liquibase.exception.MigrationFailedException: Migration failed for change set database.account.changelog-2.0.xml::38::META:
Reason: liquibase.exception.DatabaseException: ORA-00900: invalid SQL statement
[Failed SQL: end]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.integration.commandline.Main.doMigration(Main.java:1220)
at liquibase.integration.commandline.Main.run(Main.java:199)
at liquibase.integration.commandline.Main.main(Main.java:137)
Caused by: liquibase.exception.DatabaseException: ORA-00900: invalid SQL statement
[Failed SQL: end]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600)
... 7 common frames omitted