Get the App
SLTechnology News&Howtos  ›  Database  › 

Stored procedure + cursor

Shulou Source: shulou.com Published: 2022-06-01 15:51:59 11月25日 Update

Delimiter / /

Drop procedure if exists `test` / /

CREATE PROCEDURE `test` () comment 'test stored procedure'

BEGIN

Declare a varchar (255)

Declare i int (1) default 0

DECLARE cur CURSOR FOR select tname from `test`

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, NOT FOUND

Rollback

Start transaction

OPEN cur

While i

Tags: Procedure storage test cursor Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Microsoft Xiaomi Redmi Linux