The SP is quite easy but there are several issues:
- replace [] with `` in identifiers (or do not use delimiters at all)
- change @ to v_ (to not confuse parameters/local variables with column names)
- remove dbo.
- convert getdate() to current_timestamp
- convert END to END IF
The result should look like this:
DELIMITER //
CREATE procedure usp_save_etl_error(v_mlsboard_id INT
,v_mls_id VARCHAR(50)
,v_is_data TINYINT
,v_is_picture TINYINT
,v_message VARCHAR(1000))
begin
IF NOT EXISTS(SELECT 1 FROM mlsassistant.etl_error WHERE mlsboard_id = v_mlsboard_id AND mls_id = v_mls_id AND is_fixed = 0) then
INSERT INTO mlsassistant.etl_error(mlsboard_id, mls_id, is_data, is_picture, is_fixed, message, create_date)
VALUES(v_mlsboard_id, v_mls_id, v_is_data,
v_is_picture, 0, v_message, CURRENT_TIMESTAMP);
end if;
end;
//
You can convert data types, built-in functions in stored procedures online at
http://www.sqlines.com/online or use SQLWays at
http://www.ispirer.com/ for complete conversion.
Thanks,
Dmitry