Hi all, I'm trying to do something which perhaps isn't intended to be done with jOOQ, but I'm sure someone should be able to see what I'm trying to do.
Basically, I create a "temporary" table on top of a view (its not actually temporary, it's a table name with a random number appended to the end of it), which I am then going to merge back in to another table once I have performed some SQL statements on the "temporary" table. I needed it to be not a real temporary table so that I can create triggers on it. I am trying to create a trigger using SQL in a String, but I get a syntax error even though the syntax is valid when used in MySQLWorkbench. I've snipped the trigger here to make it easier to read. String sql1 = "create table temptable123456 as (select * from underlyingview)"; String sql2 = "delimiter $$ create trigger temptable123456_bupd before update on temptable123456 for each row begin if(condition1) then set field = value; end if; if(condition2) then set field = value; end if; end$$"; create.execute(sql1); create.execute(sql2); The error I get is the standard syntax error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter $$ create trigger temptable123456_bupd before upd' at line 1 So my question is - is there a way to achieve what I'm trying to do here? Thanks! -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
