Jump to content


Photo

Stored Procedure - Tratamento De Erros


  • Faça o login para participar
6 replies to this topic

#1 Agnus hallard

Agnus hallard

    Novato no fórum

  • Usuários
  • 9 posts
  • Sexo:Não informado

Posted 03/06/2011, 11:23

Bom dia, galera, sou novo em mysql
criei esta Stored procedure para adicionar e alterar dados em uma tabela. Queria saber a opinião de vocês sobre como ficou minha procedure. O que mais posso colocar nela?

Sobre o tratamento de errors, fiz o tratamento para chaves duplicadas e dados truncados. Tem como capturar qq erro que aconteça durante a execução da stored procedure?


DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_ADDBANCO`(in p_CONTROLE char, in p_ID int, in p_NOME varchar(80), out p_MSG varchar(80))
BEGIN

    DECLARE EXIT HANDLER FOR SQLSTATE '23000'
        BEGIN
            ROLLBACK;
            Select 'Violação de chave primaria' as p_MSG;
        END;

    DECLARE EXIT HANDLER FOR SQLWARNING
        BEGIN
            ROLLBACK;
            Select 'O dado foi truncado!' as p_MSG;
        END;


    START TRANSACTION;
        if CONTOLE="G" then
            Insert into BANCOS(NOME) values(NOME);
        elseif CONTROLE="A" then
            Update BANCOS set NOME=p_NOME where ID=p_ID;
        end if;

    COMMIT;
    Select 'Registro efetuado com sucesso.' as p_MSG;
END


#2 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 20/09/2017, 16:44

Prednisone Online Bestellen cialis buy online Viagra Giugno 2013 Dapoxetina Cuanto Cuesta Se Vende Viagra En Farmacias Sin Receta Metformin Achat Generique Kamagra France cialis Achat De Pilule Cialis
No Perscription Low Cost Diflucan generic cialis Zithromax Rash Child Cheap Generic Prevacid Treating Bronchitis With Amoxicillin Clomid Glucophage Effets Secondaires Alli Back On Shelves cialis price On Line Provera Gen

#3 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 08/10/2017, 01:21

Viagra Danemark Rezeptfrei Prozac Free Sample Online Pharmacy Cheap Retin A buy viagra online Buy Cialis Portland Oregon Propecia O Finasterida

#4 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 02/11/2017, 22:37

Cialis Medikament Bestellen Generic Elocon On Sale Secure Ordering C.O.D. Rhode Island viagra Keflex For Gum Infection Baclofene Sur France 2
Furosemide No Prescription viagra online pharmacy Progesterone Medicine Where To Buy On Line Fludrocortisona 0.1 Mg

#5 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 03/11/2017, 11:37

Fluconazole Buy Uk Levitra Cost Uk Levitra Acquisto Farmaci viagra Rapid Tab Kamagra Cheapest Online

#6 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 30/11/2017, 11:57

Dental Abcess Pediatric Allergy To Amoxicillin cialis Urimax .4 Without Prescription Keflex Affects On Birth Control Pills Propecia Cost Auckland
Cialis Vente viagra Peut Acheter Viagra Sans Ordonnance Zithromax While Trying To Conceive
Buying Domperidone In Canada Canadian Pharmacy Ed Meds viagra Rask Levering Cialis

#7 JeffMalm

JeffMalm

    Super Veterano

  • Usuários
  • 12254 posts
  • Sexo:Feminino
  • Localidade:Mount Carey

Posted 10/02/2023, 10:26

Avoiding drug interaction problems is important so that your medicines work as well as possible doxycycline long term use
I immediate started another IUI cycle until they found a polyp and we cancelled the IUI and just did a medicated cycle instead legit cialis online
I have seen lots of post about nausea vomiting, muscle cramps, body aches, vaginal dryness, and constipation, headache, and mood swings, brain fog, forget fullness, dizzy buy cialis online us Marshall, USA 2022 04 30 14 27 38




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq