Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Troubke with Execute SQL script in transformation

  1. #1
    Join Date
    Aug 2011

    Post Troubke with Execute SQL script in transformation


    I am trying to run a execute SQL script for a mysql db and I get :-

    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 '? varchar(256)' at line 1

    I have included screen shot of my setup.

    I am just trying to add a column to a table where the column name comes from the flow field.
    Name:  pentaho_sql.jpg
Views: 67
Size:  22.2 KB

    Any ideas?

    I am using PDI 4.1.0. Thanks in advance.

  2. #2
    Join Date
    Sep 2009


    Hey tnewman,

    JDBC does not allow binding parameters for field names. If you want to add columns on the fly, it's probably best to first assemble the ALTER TABLE query as a string. I'd use the JS step for that, you may construct this using the calculator and the group by step too .

    The aim would be to have a string like this in a field (my_sql_statement):

    ALTER TABLE repdef_dw.analytics_logging_repstar
    ADD column1 VARCHAR(255),
    ADD column2 VARCHAR(255),
    ADD column3 VARCHAR(255)...

    Then I'd use the Execute row SQL script step to execute the SQL from that field.


  3. #3
    Join Date
    Aug 2011



    Thanks for your answer - Your suggestion worked.

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.