I'm trying to execute an oracle PL/SQL procedure with groovy but I get exceptions. From what I've understood it is due to these intial lines-
SET SERVEROUTPUT ON
SET FEEDBACK OFF
execute dbms_output.enable(buffer_time);
My code looks like this:
Connection con=DriverManager.getConnection(url,username,password);
def sql= new Sql(con)
String stmt= " SET SERVEROUTPUT ON
SET FEEDBACK OFF
execute dbms_output.enable(buffer_time);
declare
//some varaibles
begin
//code
dbms.output.put.line(variable)
end
"
sql.execute(stmt);
When I remove the first 3 lines, I get no errors but there will be no output as I'm using dbms.output.put.line
hence they are neccessary. How do I resolve the SQL Syntax Exception I get from the intial lines?