Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###### FUNCTION DOES WORK (FUNCIONA)
- DELIMITER |
- CREATE OR REPLACE FUNCTION TesteFunction() RETURNS INT DETERMINISTIC MODIFIES SQL DATA
- BEGIN
- DECLARE Retorno INT;
- UPDATE Produto SET CD_Extra = "CD00472-5" WHERE CD_Codigo = 6;
- SELECT ROW_COUNT() INTO Retorno;
- RETURN Retorno;
- END |
- ###### PROCEDURE WITH TRANSACTION DOES WORK (FUNCIONA)
- DELIMITER |
- CREATE OR REPLACE PROCEDURE TesteFunction() DETERMINISTIC MODIFIES SQL DATA
- BEGIN
- START TRANSACTION READ WRITE;
- UPDATE Produto SET CD_Extra = "CD00472-5" WHERE CD_Codigo = 6;
- SELECT ROW_COUNT();
- COMMIT;
- END |
- ###### FUNCTION WITH TRANSACTION DOESN'T WORK (NÃO FUNCIONA)
- DELIMITER |
- CREATE OR REPLACE FUNCTION TesteFunction() RETURNS INT DETERMINISTIC MODIFIES SQL DATA
- BEGIN
- DECLARE Retorno INT;
- START TRANSACTION READ WRITE;
- UPDATE Produto SET CD_Extra = "CD00472-5" WHERE CD_Codigo = 6;
- SELECT ROW_COUNT() INTO Retorno;
- COMMIT;
- RETURN Retorno;
- END |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement