Questions tagged as 'procedure'

0
answers

Two declared cursor

I would like to leave two cursors declared at the beginning of the procedure DECLARE R CURSOR FOR SELECT C.CODIGO FROM TABELA1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done2 = TRUE; DECLARE aulas CURSOR FOR SELECT DISTINCT a.codigo FRO...
asked by 16.08.2018 / 19:50
0
answers

Error creating a procedure: Cursor declaration after handler declaration

I'm trying to create a procedure But I'm getting this message: Cursor declaration after handler declaration I'm trying to do 3 loops DROP PROCEDURE IF EXISTS 'sp_curso_aprovados'; DELIMITER $$ CREATE PROCEDURE 'sp_curso_aprovado...
asked by 16.08.2018 / 16:21
0
answers

Manipulate array in mysql with procedures

I have a much more complex procedure than the one I'm going to post here, I use it to export to a excel sheet all my product information, but the information comes from messed up because I attach a lot of foreign keys. for summary purpose I h...
asked by 08.08.2018 / 20:31
0
answers

Value returned from procedure (PDO)

The procedure is running fine, but in case I am not able to get the value it returns, I already looked in the php documentation link , but not yet. function static function inserirCliente($cpf, $nome, $sobrenome, $usuario, $senha) { $...
asked by 06.07.2018 / 23:16
0
answers

Error in MySQL procedure

People are doing this procedure: CREATE DEFINER='root'@'localhost' PROCEDURE 'adicionarPessoaTelefone' (IN cpf VARCHAR(14) , IN nome VARCHAR(100), IN rg VARCHAR(9), IN data_nasc DATE, IN end_rua VARCHAR(200), IN end_bairro VARCHAR(25), IN...
asked by 17.05.2018 / 08:11
0
answers

registration procedure with error in if chained

I made this procedure to make user registration, I made an inquiry to know if that field had already been registered, to do the insertion of the data in the table I had the idea of doing a chained if that refers to all the fields and in the end...
asked by 20.05.2018 / 23:39
0
answers

Count records returned from a SQL procedure in PHP

Good afternoon, I'm a beginner in PHP and I'm running the code below, the records are returning correctly, however I can not count the number of records returned and print on the screen. It prints the -1 amount, before I was doing a simple se...
asked by 12.04.2018 / 20:55
0
answers

Query by part in SQL clause IN

I have to query more than 400 thousand records in the IN clause. It turns out that I can not do everything at once because I can crash the system of my company. So I have to run at a specific time and every 5,000 at a time. But I do n...
asked by 11.04.2018 / 15:20
0
answers

Call one procedure inside another - MySql

I have to retrieve some values before running my cursor, as the MySql syntax does not allow to make select before the cursor declaration, I thought of dribbling, doing the select in a first procedure and then calling the second that will iterate...
asked by 05.03.2018 / 14:50
0
answers

Error creating a PROCEDURE

I am creating a procedure to be able to insert data into a table in the database, but it is giving an error that I can not identify: Command: begin INCLUIR_CLIENTE(1, 'SUPERMERCADO XYZ', '12345', NULL, 150000); end; Message submitted:...
asked by 09.02.2018 / 18:01