Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Set MySQL session variables during transformation

  1. #1
    Join Date
    Jul 2014
    Posts
    1

    Default Set MySQL session variables during transformation

    Hey guys,

    is it possible to set a system variable of the MySQL server dynamically during a transformation in kettle? I tried the following:

    Step 'Execute SQL Statements': SET SESSION group_concat_max_len = ?;

    The question mark is replaced by an argument of the step before. But even if I place an absolute value there instead of the question mark, it's still not working. The following steps, e.g. a table input step, will ignore the modified session variables so the default system values are used.

    Setting the system variable globally on the whole connection (and not only for the session) is no option in my case. Using PDI 5.0.7, MySQL 5.1.73.

    Many thanks,
    tba

  2. #2

    Default Ask for solution

    Quote Originally Posted by tba View Post
    Hey guys,

    is it possible to set a system variable of the MySQL server dynamically during a transformation in kettle? I tried the following:

    Step 'Execute SQL Statements': SET SESSION group_concat_max_len = ?;

    The question mark is replaced by an argument of the step before. But even if I place an absolute value there instead of the question mark, it's still not working. The following steps, e.g. a table input step, will ignore the modified session variables so the default system values are used.

    Setting the system variable globally on the whole connection (and not only for the session) is no option in my case. Using PDI 5.0.7, MySQL 5.1.73.

    Many thanks,
    tba
    Hello,

    Did you have find any solutions?

  3. #3
    Join Date
    Aug 2011
    Posts
    360

    Default

    In the configuration of your PDI conneczion, in the advanced tab i guess, you set a statement that is executed
    after each connection to DB. I guess this is a good place to set this variable.

    It wont work if you set it in a sql script step, since each step is creating its own connection to he db, so its own session

  4. #4

    Default

    Quote Originally Posted by Mathias.CH View Post
    In the configuration of your PDI conneczion, in the advanced tab i guess, you set a statement that is executed
    after each connection to DB. I guess this is a good place to set this variable.

    It wont work if you set it in a sql script step, since each step is creating its own connection to he db, so its own session
    You saved my life!!!!!!!!!!
    God bless you, I spend so much time trying to solve this. thank you!!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.