0
我有創建在MySQL中使用該視圖的過程的問題,我已經到處和它看起來很好,但它不工作CREATE PROCEDURE不工作
這是我的看法,這是工作的罰款:
CREATE OR REPLACE VIEW V_Ficha AS SELECT R.Id_rota, R.Tempo, R.Nome, F.Data, F.Tab_pesquisador_Id_pesquisador as Pes,
F.Tab_municipio_Id_municipio as Mun, F.Tab_instrumento_Id_instrumento as Ins FROM Tab_ficha F LEFT JOIN Tab_rota AS R ON F.Tab_rota_Id_rota = R.Id_rota;
這是我的程序:
CREATE OR REPLACE PROCEDURE P_Ficha(IN id INT)
BEGIN
IF id > 1 THEN
SELECT * FROM V_Ficha WHERE Id_rota = id;
ELSE
SELECT 'Id must be greater than 0' AS Msg;
END IF;
END;
我把分隔符,但它仍然沒有工作
DELIMITER //
CREATE OR REPLACE PROCEDURE P_Ficha(IN id INT)
BEGIN
IF (id > 1) THEN
SELECT * FROM V_Ficha WHERE Id_rota = id;
ELSE
SELECT 'Id must be greater than 0' AS Msg;
END IF;
END
//
DELIMITER ;
如何在不工作?戴上我的魔法猜測帽,我想說你需要閱讀'DELIMITER'。 –