Migrate a store proc from MSSQL to MySQL
Posted by:
Kai Huang
Date: March 05, 2011 06:08AM
Here's the MSSQL version, I cannot convert it into MySQL version due to lack of experience. Thanks for help.
CREATE procedure [dbo].[usp_save_etl_error](
@mlsboard_id int
,@mls_id varchar(50)
,@is_data tinyint
,@is_picture tinyint
,@message varchar(1000)
)
as
begin
IF NOT EXISTS(SELECT 1 FROM mlsassistant.dbo.etl_error WHERE mlsboard_id = @mlsboard_id AND mls_id= @mls_id AND is_fixed=0 )
BEGIN
INSERT INTO mlsassistant.dbo.etl_error
(mlsboard_id, mls_id, is_data, is_picture, is_fixed, message, create_date)
VALUES(@mlsboard_id, @mls_id, @is_data,
@is_picture, 0, @message, getdate() )
END
end