프로그램/코드 기본형

mysql procedure 기본형

창업닉군 2020. 6. 6. 09:07

drop procedure if exists d_delete_filelist;
DELIMITER //

create procedure d_delete_filelist(
    IN __idx varchar(256)
)

begin

    declare result_input_check varchar(1024);

    -- 여기서 입력값에 대한 검사를 한다.
    call util_field_check ( 'delete_filelist', 'idx', __idx, result_input_check, 1 );

    -- 마지막으로 오류가 없다면 데이터를 삭제하고 정상 결과를 반환합니다.
    if( result_input_check is null ) then

        delete from delete_filelist where idx = __idx;
        call util_result( 0, "지정한 삭제 대상 정보를 삭제하였습니다.", "" );

    end if;

end

//
DELIMITER ;