Following is a trigger:
CREATE OR REPLACE TRIGGER "CMDC"."USER_ROADS_UC"
BEFORE INSERT OR UPDATE OF
ASSOCIATED_PARENT_ROAD
ON USER_ROADS
REFERENCES NEW AS NEW
FOR EACH ROW BEGIN
:new.ASSOCIATED_PARENT_ROAD:=upper(:new.ASSOCIATED_PARENT_ROAD);
EXCEPTION
WHEN OTHERS THEN RETURN;
END;
/
ALTER TRIGGER "CMDC"."USER_ROADS_UC" ENABLE
The above runs perfectly in SQL Developer. However, when I get the following error when I run it using Ant:
[sql] Failed to execute: EXCEPTION WHEN OTHERS THEN RETURN
[sql] java.sql.SQLException: ORA-00900: invalid SQL statement
[sql] Failed to execute: END
[sql] java.sql.SQLException: ORA-00900: invalid SQL statement
[sql] Failed to execute: / ALTER TRIGGER "CMDC"."USER_ROADS_UC" ENABLE
[sql] java.sql.SQLException: ORA-00900: invalid SQL statement
I have already reviewed this question. However, I still couldn't modify the script to work with Ant.
Following is the ant target
<target name="create-db-schema" >
<echo message="############################################################"/>
<echo message="# Create Complete DB Schema #"/>
<echo message="############################################################"/>
<sql onerror="continue" classpathref="project.class.path" driver="${database.driverClassName}"
url="${database.url}" userid="${database.username}" password="${database.password}">
<path>
<fileset dir="${test.dbscripts.dir}/schema/">
<include name="*.sql"/>
</fileset>
</path>
</sql>
</target>