Home  >  Article  >  Database  >  MySQL Advanced Four - Custom Conditions and Processing

MySQL Advanced Four - Custom Conditions and Processing

黄舟
黄舟Original
2016-12-29 16:32:341301browse

Syntax:

declare continue handler for sqlstate 'error code value' set variable = variable value

For example:

create procedure p_insertDome()
begin
	declare continue handler for sqldate '42S02' set @x=1;
	insert into userinfo2(uid,name,password)values('1','demo','123456');
	insert into employ('empno','date')values('2220','1993-12-14');
end;
$$;

If the data table does not appear in the first statement If it exists, it will not affect the execution of the next line of statements

The above is the content of MySQL Advanced 4 - Customized Conditions and Processing. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn