Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Call DB Procedure - calling MySQL function

  1. #1

    Default Call DB Procedure - calling MySQL function

    Hello,

    I am facing some issue in using mysql function.

    I tried with very simple mysql function:-
    ===============================
    DELIMITER $$

    DROP FUNCTION IF EXISTS `ritesh`.`testfun` $$
    CREATE FUNCTION `ritesh`.`testfun` () RETURNS INT
    BEGIN
    return 6;
    END $$

    DELIMITER ;
    ===============================

    This function is working fine. It returns 6 for following query:-
    select testfun();

    However when I tried to use the same in Pentaho Job (attaching transformation file), it fails with error --

    2011/02/22 21:43:02 - Call DB Procedure.0 - ERROR (version 4.0.1-stable, build 13826 from 2010-08-26 14.18.03 by buildguy) : Because of an error, this step can't continue:
    2011/02/22 21:43:02 - Call DB Procedure.0 - ERROR (version 4.0.1-stable, build 13826 from 2010-08-26 14.18.03 by buildguy) : Unable to call procedure


    Request you to please have a look at it. Any help will be highly appreciated.

    Regards,
    Ritesh
    Attached Files Attached Files

  2. #2

    Default

    For information, I am using PDI version 4.0.1

    Regards,
    Ritesh

  3. #3
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hi Ritesh,

    could it be that all you need is simply a table input step that does the select?

    A function is different from a procedure in MySQL, and they also need to be invoked differently.

    A function can be "Selected" because it returns a value, a procedure may or may not, and it must be CALL'ed

    http://dev.mysql.com/doc/refman/5.0/...procedure.html
    http://dev.mysql.com/doc/refman/5.0/en/call.html

    The call procedure step does a CALL and can't find a procedure named testfun, because there isn't one

    Cheers

    Slawo

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.