Statement.execute () returns an error with Slash at the end of PL / SQL

When executing pl / sql im getting error:

ORA-06550: line 1, column 316: PLS-00103: Encountered the symbol "/" The symbol "/" was ignored. 

PLSQL example:

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 this the right mistake? or am i doing something wrong?

thank

+3
source share
2 answers

A slash is how you execute an anonymous block through an interactive environment such as SQL * Plus. If you execute this block on a call from Java, you do not need a trailing slash.

+8
source

Answer found. Had to make a more complicated google request :)

, "/", . . . sqlplus SQL- sqldev, PL/SQL . ( sqldev), . , , ; -)

http://forums.oracle.com/forums/thread.jspa?threadID=519670

+2

Source: https://habr.com/ru/post/1733363/


All Articles