2012-08-07 34 views
0

是否可以從MySQL中的函數調用過程?我收到錯誤「不允許從函數返回結果集」。我希望將過程調用的結果插入到函數變量中,就像我直接在函數中完成SELECT INTO一樣。MySQL:從函數調用過程

該函數的(簡化的)定義爲

create function my_function() 
    returns int deterministic 
    begin 
    declare some_parameter int; 
    declare the_result int; 

    call my_procedure(some_parameter, the_result) 

    return the_result; 

    end; 

的步驟(簡化的)定義爲:

create procedure my_procedure(in my_parameter int, out my_result int) 
    begin 
     select 1 
     from dual; 
    end; 

回答

0

在本質上沒有什麼。函數正在查找數據類型,而不是記錄(這是從過程返回的內容)。