尝试从Liquibase运行:
--changeset blah runOnChange:true endDelimiter:\n/\s*\n|\n/\s*$
DELETE MYTABLE;
INSERT INTO MYTABLE(A,B,C) VALUES ('A', 'B', 'C');
DECLARE
row_count NUMBER;
BEGIN
SELECT COUNT(1) INTO row_count FROM OTHERTABLE;
IF (row_count = 0)
THEN DELETE MYTABLE WHERE A LIKE 'BLAH:%';
END IF;
END;
/
但是得到了这个错误:
引起:java.sql.SQLSyntaxErrorException:ORA-00911:无效 字符
在这些情况下似乎有效:
但它并不是一起工作的。 ??
答案 0 :(得分:2)
尝试
DECLARE
row_count NUMBER;
BEGIN
DELETE MYTABLE;
INSERT INTO MYTABLE(A,B,C) VALUES ('A', 'B', 'C');
SELECT COUNT(1) INTO row_count FROM OTHERTABLE;
IF (row_count = 0)
THEN DELETE MYTABLE WHERE A LIKE 'BLAH:%';
END IF;
END;
或使用" /"在每个陈述之后