0

SP を実行すると、次のエラーが発生します。

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 '; select @nodata_issue,@dateof_issue' 
at line 1

SQL Error (1414): OUT or INOUT argument 2 for routine proc1 is 
not a variable or NEW pseudo-variable in BEFORE trigger

これらのパラメーターは次のように宣言されます。

PROCEDURE proc1(IN `idpap` INT, OUT `nodata_issue` TINYINT, OUT `dateof_issue` DATE)

*編集: 変更され、問題を開始したコードのチャンク:

PROCEDURE proc1(IN `idpapel` INT, OUT `nodata_issue` TINYINT, OUT `dateof_issue` DATE)
  DETERMINISTIC
BEGIN
DECLARE primeira_mov, data_anterior DATE;
select data into primeira_mov from excel.trade_mov where papel = idpapel order by data LIMIT 1;

BLOCK1: begin

DECLARE ...
DECLARE cur1 CURSOR FOR select data, valor_split, valor_div from excel.trade_correcao where data >= primeira_mov and id_papel = idpapel order by data DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
DECLARE CONTINUE HANDLER FOR 1329 BEGIN
        SET nodata_issue = 1;
        SET dateof_issue = datasplit;
    END;

set data_anterior = "2200-01-01";
set valor_aplicavel = 1;
set preco_fator = 1;
SET nodata_issue = 0;
SET dateof_issue = null;

CALL create_temp_tables();
TRUNCATE TABLE tbl1;


-- START TRANSACTION;

OPEN cur1;

read_loop_1: LOOP

このエラーの原因についてのアイデアはありますか?

4

0 に答える 0