Home > Database > Mysql Tutorial > MySQL Advanced Four - Custom Conditions and Processing

MySQL Advanced Four - Custom Conditions and Processing

黄舟
Release: 2016-12-29 16:32:34
Original
1319 people have browsed it

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;
$$;
Copy after login

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)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template