我不完全确定为什么会这样。当我运行命令时:
ALTER TRIGGER ORIGDV87.UPDATE_TEAM_GROUP_TRIGGER DISABLE/ENABLE
我可以看到它如何改变触发器。我正在尝试从 java 以编程方式执行此操作:
private void trigger_alter(Connection con, String flag) throws Exception
{
Query query = new Query(con);
String selectSql = "select table_owner, trigger_name from user_triggers";
Query queryTrg = new Query(con);
query.executeQuery(selectSql);
while(query.next()) {
int i = 0;
String table_owner = query.getColValue("table_owner");
String trigger_name = query.getColValue("trigger_name");
String triggerSql = "ALTER TRIGGER " + table_owner + "." + trigger_name + " "+ flag ;
System.out.println( triggerSql);
queryTrg.executeQuery(triggerSql);
}
log_obj.FmtAndLogMsg("All triggers have been " + flag+ "D");
}
我得到这个例外:2013/02/26 10:38:56.795 TableConverter: ERROR main() occurred: java.lang.Exception: Error executing query: ALTER TRIGGER XXXX.UPDATE_TEAM_GROUP_TRIGGER DISABLE error=java.sql.SQLException: ORA-01003: no statement parsed
它是一个 oracle 数据库,我正在 Solaris 机器上尝试这个。