Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Use Call db Procedure with Environment variables

  1. #1
    Join Date
    Aug 2009
    Posts
    28

    Default Use Call db Procedure with Environment variables

    Hi everyone.

    I have a kettle 3.0, and i have a Generate row, i generate a "new row" that i will use in a DB Procedure step (this is because db procedure needs to be triggered) so in the new row i wrote the variable name and in the value column i wrote ${MesProcesado}, which is an environment variable, but when i run the transformation the row does not take the variable value.

    how can i accomplish this? i mean to pass variables to procedure's parameters with "Call db procedure" step

    thanks
    Edgar Valdez

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Try the "Get Variables" step instead
    It will pull a variable into the data stream.

  3. #3

    Default

    Hi Edgar,

    Remember to set the variable outside the transformation, i.e. in the job that calls the transformation.

    Regards
    Paul

  4. #4
    Join Date
    Aug 2009
    Posts
    28

    Default

    Hello

    well i tried to use "Get variables" in a preview transformation but still fails, i saw the log and found this:

    - ERROR (version 3.1.0, build 826 from 2008/09/30 11:32:36) : Error buscando campo: ${Country}]
    2009/08/13 10:13:18 - Procesa Putty.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 11:32:36) : Este paso no puede continuar debido a un error:
    2009/08/13 10:13:18 - Procesa Putty.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 11:32:36) : No se ha podido encontrar el campo '${Country}' en la fila!

    where ${Country} is the variable that i defined, and pentaho says "can't find the field ${Country}", in the object "Call DB Procedure" where you define the name of parameters i wrote the variable name, but pentaho does not replace the variable's value, it left the name of variable as parameter, example:

    ${Country} = 'ABC'

    Pentaho sends ${Country} instead of 'ABC'.

    i used "Row Generator" because Pentaho's FAQ says i need that object before a "Call DB Procedure". look:
    http://wiki.pentaho.com/display/EAI/Call+DB+Procedure

    Then i added the "Row Generator" again and y wrote the variable name where you define the value of the row, example:

    Object: "Row Generator"
    name Country
    Type: String
    Value: ${Country}

    in a preview of this step show me Country: ${Country}, instead of Country: ABC, that is the value of ${Country}


    Any idea or suggest?

    Regards...
    Last edited by edgarvaldez; 08-13-2009 at 09:57 AM.

  5. #5
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    The FAQ is saying that you have to send a row to the the "Call DB Procedure" step before it will do anything. If you use a "Get Variables" step to generate a row with a column "Country" which gets set to ${Country}, you can then use that column as the input to the DB Procedure.

    Note that DB Procedure does not accept variables.

    Your model doesn't work, as the column "Country" is getting set to the string "${Country}" rather than the value of the variable.


    As suggested before, try using the "Get Variables" step *INSTEAD* of the "Generate Rows"

  6. #6
    Join Date
    Aug 2009
    Posts
    28

    Default

    Ohhh really, you're right, i did not read well, yes, if i use a "Get Variable" it works!!!

    thanks a lot!!

    regards....

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.