Closed
Description
Currently the Oracle PL/SQL blocks are not fully supported by ScriptRunner.
There is a common workaround:
ALTER TABLE TAB1
ADD CONSTRAINT PK_TAB1
PRIMARY KEY (TAB1_ID)
/
CREATE OR REPLACE PROCEDURE UPDATE_TAB1 AS
BEGIN
UPDATE TAB1 SET NUMBER_FIELD = NUMBER_FIELD + 1;
COMMIT;
END;
/
using:
send_full_script=false
delimiter=/
full_line_delimiter=true
...but this is not a clean solution:
- we need to modify a bunch of SQLs for the sake of a few PL/SQL
- not standard
There is a suggested solution that modifies the ScriptRunner (https://code.google.com/p/mybatis/source/diff?spec=svn4001&r=4001&format=side&path=/trunk/src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java) but it has been rejected.
Is it possible to annotate the PL/SQLs instead of the SQLs and keep the common delimiters?
ALTER TABLE TAB1
ADD CONSTRAINT PK_TAB1
PRIMARY KEY (TAB1_ID);
-- //@PLSQL
CREATE OR REPLACE PROCEDURE UPDATE_TAB1 AS
BEGIN
UPDATE TAB1 SET NUMBER_FIELD = NUMBER_FIELD + 1;
COMMIT;
END;
/
Metadata
Metadata
Assignees
Labels
No labels