Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Execute SQL script

  1. #1

    Post Execute SQL script

    database: mysql
    error : create produce
    why ?
    Name:  1.jpg
Views: 651
Size:  30.5 KB
    code:



    DELIMITER //


    CREATE PROCEDURE proc7(IN s INT)


    begin
    declare i int;
    declare s int;
    set s = 0;
    set i = 1;
    while i<=n do
    set s =s+i;
    set i=i+1;
    end while;
    select s;
    end;
    //


    DELIMITER ;

    error :

    2016/01/06 15:33:20 - test1.0 - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : An error occurred, processing will be stopped:
    2016/01/06 15:33:20 - test1.0 - Couldn't execute SQL: DELIMITER //
    2016/01/06 15:33:20 - test1.0 -
    2016/01/06 15:33:20 - test1.0 - CREATE PROCEDURE proc7(IN s INT)
    2016/01/06 15:33:20 - test1.0 -
    2016/01/06 15:33:20 - test1.0 - begin
    2016/01/06 15:33:20 - test1.0 - declare i int
    2016/01/06 15:33:20 - test1.0 -
    2016/01/06 15:33:20 - test1.0 - 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 'DELIMITER //
    2016/01/06 15:33:20 - test1.0 -
    2016/01/06 15:33:20 - test1.0 - CREATE PROCEDURE proc7(IN s INT)
    2016/01/06 15:33:20 - test1.0 -
    2016/01/06 15:33:20 - test1.0 - begin
    2016/01/06 15:33:20 - test1.0 - declare i int' at line 1
    2016/01/06 15:33:20 - test1.0 - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : 错误初始化步骤[test1]
    2016/01/06 15:33:20 - test - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : 步骤 [test1.0] 初始化失败!
    2016/01/06 15:33:20 - test1.0 - Finished reading query, closing connection.
    2016/01/06 15:33:20 - Spoon - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : test: preparing transformation execution failed
    2016/01/06 15:33:20 - Spoon - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : org.pentaho.di.core.exception.KettleException:
    2016/01/06 15:33:20 - Spoon - 无法初始化至少一个步骤. 执行无法开始!
    2016/01/06 15:33:20 - Spoon -
    2016/01/06 15:33:20 - Spoon -
    2016/01/06 15:33:20 - Spoon - at org.pentaho.di.trans.Trans.prepareExecution(Trans.java:1155)
    2016/01/06 15:33:20 - Spoon - at org.pentaho.di.ui.spoon.trans.TransGraph$28.run(TransGraph.java:3991)
    2016/01/06 15:33:20 - Spoon - at java.lang.Thread.run(Thread.java:744)
    2016/01/06 15:33:20 - test - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : 错误被检测到!
    2016/01/06 15:33:20 - test - ERROR (version 6.0.0.0-353, build 1 from 2015-10-07 13.27.43 by buildguy) : 错误被检测到!
    Attached Images Attached Images  
    Last edited by xiaomifeng789; 01-06-2016 at 03:51 AM.

  2. #2
    Join Date
    Nov 2009
    Posts
    688

    Default

    Use a Job to create a stored procedure and not a transformation. In the Execute SQL script check "Send SQL as single statement"

  3. #3

    Default

    thanks !!! help me greatly

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.