1
I’m new to creating PROCEDURE. I am trying to create this PROCEDURE plus this tando error.
DELIMITER //
DROP PROCEDURE IF EXISTS `P_lgs`;
CREATE PROCEDURE `P_lgs` ( idcod INT, dt VARCHAR(20), ip VARCHAR(20), msg VARCHAR(250), mail VARCHAR(250) )
BEGIN
DECLARE numid INT DEFAULT 0;
IF idcol <> 0 THEN
numid = idcol;
END IF ;
INSERT INTO `logs`(logs_cod,logs_dt,logs_ip,logs_mensagem,logs_email) VALUE(numid,dt,ip,msg,mail);
END //
DELIMITER ;
Which error? In which section?
– gmsantos
You’d better read the documentation: https://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html
– Edgar Muniz Berlinck
@gmsantos error is on line create Procedure,
– Weliton Figueiredo
Query: drop Procedure if exists
P_lgs
; create ProcedureP_lgs
( idcod int, dt varchar(20), ip varchar(20), msg varchar(250), mail v... Error Code: 1064 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 'create ProcedureP_lgs
( idcod int, dt varchar(20), ip varchar(20), msg varcha' at line 2– Weliton Figueiredo
@Welguri Before Creating The Future Again You Need To Drop The Old...
– gmsantos
@gmsantos more before the CREATE PROCEDURE, I put the DROP.
– Weliton Figueiredo
@Welguri but with the delimiter
;
old. Try changing the delimiter toDROP PROCEDURE IF EXISTS P_lgs//
– gmsantos