MySQL高級(jí)四——自定義條件和處理

語法:

declare continue handler for sqlstate ‘錯(cuò)誤代碼值’ set 變量=變量值

如:

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;  $$;

假如第一個(gè)語句出現(xiàn)數(shù)據(jù)表不存在,就不會(huì)影響下一行語句執(zhí)行

?以上就是MySQL高級(jí)四——自定義條件和處理的內(nèi)容,更多相關(guān)內(nèi)容請(qǐng)關(guān)注PHP中文網(wǎng)(www.php.cn)!

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊12 分享