I have an HTML file to be stored in the database. I am using Liquibase for this but in HTML I have lot of
instances.
The problem is that SQL does not allow &
to run without set define off
option.
I got to know the below solutions from the net:
cdata
, but here I am inserting HTML in Liquibase SQL format and not the XML format, so I think it is not of use.
in the file, I cannot use ASCII characters for each to avoid &
.Error from Liquibase execution:
SEVERE 6/7/17 11:30 AM:liquibase: Error executing SQL set define off
java.sql.SQLException: ORA-00922: missing or invalid option
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
What can I do to fix this?
The set define off
that Liquibase is complaining about is not SQL, it is a SQL*Plus client command:
SET DEF[INE] {& | c | ON | OFF}
Sets the character used to prefix substitution variables to c.
ON or OFF controls whether SQL*Plus will scan commands for substitution variables and replace them with their values. ON changes the value of c back to the default '&', not the most recently used character. The setting of DEFINE to OFF overrides the setting of the SCAN variable.
It is used by SQL Developer and SQLcl as well. All of those clients use it to control the behaviour of substitution variables.
Liquibase clearly doesn't recognise that client command, so it should be removed from your script.