执行pl / sql时获取错误:
ORA-06550: line 1, column 316: PLS-00103: Encountered the symbol "/" The symbol "/" was ignored.
PLSQL示例:
DECLARE
SQL1 VARCHAR2 (1500);
SQL2 VARCHAR2 (1500);
BEGIN
SQL1 := 'INSERT INTO das_html_caption VALUES (''test_test'')';
SQL2 := 'DELETE FROM das_html_caption where wording = ''test_test''';
EXECUTE IMMEDIATE SQL2;
EXECUTE IMMEDIATE SQL1;
EXECUTE IMMEDIATE SQL2;
COMMIT;
END;
/
Java的:
Statement statement = dbConnection.createStatement();
ResultSet rs = null;
boolean ret = statement.execute( sql.getValue() );
这是正确的错误吗?或者我做错了什么?
谢谢
解决方法:
斜杠是通过SQL * Plus等交互式环境执行匿名块的方式.如果通过Java调用执行此块,则不需要使用终止斜杠.