Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Javascript and/or execute sql problem

  1. #1

    Default Javascript and/or execute sql problem

    Hi

    I have a problem that maybe someone can help me with. I need to dynamically create a CREATE TABLE script in javascript and then run it with the execute SQL step in spoon.

    I build up a succesful create table script (can copy it and run in mysql) but when I execute in execute sql step it does nothing.

    I am putting a single ? as sql script to execute and replacing the variable which is the create table script.

    I also noticed that when I put another javascript between the first one and the execute sql with an Alert of the variable it never does Alerts. In fact even if I do Alert('test') no alert pops up running from within spoon. If i click test script in the 1st javascript step with an Alert at the bottom it works properly

    Any ideas?

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    You don't use ? for PDI variables, but the ${variable_name} notation. So in your case you would have to set a variable with your javascript generated text in another transformation beforehand.

    Regards,
    Sven

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.