statement.execute()在PL / SQL结束时返回Slash错误 [英] statement.execute() returns error with Slash at the end of PL/SQL

查看:170
本文介绍了statement.execute()在PL / SQL结束时返回Slash错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行pl / sql时获取错误:

When executing pl/sql im obtaining an error :

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() );

是否正确错误?或者我做错了什么?

is it correct error ? or i'm doing something wrong ?

谢谢

推荐答案

斜杠是指通过SQL * Plus等交互式环境执行匿名块的方式。如果您通过Java调用执行此块,则不需要使用终止斜杠。

The slash is how you execute the anonymous block through an interactive environment such as SQL*Plus. If you are executing this block by a call from Java you don't need the terminating slash.

这篇关于statement.execute()在PL / SQL结束时返回Slash错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆