Hi There
I'm working with some jobs at the moment that have to run on both Mysql and MS SQL. All is fine and the lovely feature of Mysql called SQL_MODE allows me to use
I can even write
in a comment hint so that it is only executed in Mysql and when the same SQL is run on MS SQL it is safely ignored.
My problem comes to running this in Pentaho (either in the Advanced section of Database Connection dialog or in SQL job itself). It works fine if I just put SET sql_mode = 'MSSQL' - but if I use it in the second form in the comment hint then Pentaho thinks it's a comments and strips the comment out.
I've found the code that does this in SqlScriptParser.java - sure I could patch it, but I am wondering if there is a better way to do this that anyone can think of?
Originally I was going to make this pre-run-SQL a variable (so I could not have it for when we run on MSSQL) but the Database Connection method does not support variable substitution.
Any ideas much appreciated!
Steve
I'm working with some jobs at the moment that have to run on both Mysql and MS SQL. All is fine and the lovely feature of Mysql called SQL_MODE allows me to use
Code:
SET sql_mode = 'MSSQL';
Code:
/*! SET sql_mode = 'MSSQL'*/;
My problem comes to running this in Pentaho (either in the Advanced section of Database Connection dialog or in SQL job itself). It works fine if I just put SET sql_mode = 'MSSQL' - but if I use it in the second form in the comment hint then Pentaho thinks it's a comments and strips the comment out.
I've found the code that does this in SqlScriptParser.java - sure I could patch it, but I am wondering if there is a better way to do this that anyone can think of?
Originally I was going to make this pre-run-SQL a variable (so I could not have it for when we run on MSSQL) but the Database Connection method does not support variable substitution.
Any ideas much appreciated!
Steve