Questions tagged as 'procedure'

1
answer

Selection with LEFT JOIN

I'm studying sql and I do not know if this is possible. But I have the following tables: Table contatos ______________________ id | nome | sobrenome | ______________________ That only contains one contact: 1 | andrei | coelho...
asked by 24.03.2018 / 22:44
1
answer

Using last_insert_id (), is it credible if multiple users are entering the database at the same time?

I have a question regarding the last_insert_id() method of mysql. And the following: I am creating a procedure to insert into 3 tables, example:    person (idPerson, first name, last name)       employee (idEmpregado, idPessoa, cargo)...
asked by 26.01.2016 / 14:48
1
answer

"Trace" in (VBA / Excel), how do I get the name of a subroutine?

How do I get the name of a subroutine (VBA / Excel) within itself to use in a "Trace" type code? ( See basic code in the UPDATE block after the sample code ) The idea is to use something like "ME.Name", which takes the name of the project....
asked by 25.11.2015 / 23:56
1
answer

Oracle procedure return query rows

I have the following table: CREATE TABLE CARRO ( CD_CARRO INT ,DONO VARCHAR(20) ,MARCA VARCHAR2(20) ); The inserts INSERT INTO CARRO VALUES (1,'VICENTE','FERRARI'); INSERT INTO CARRO VALUES (2,'CARLOS','FUSCA'); INSERT I...
asked by 29.03.2017 / 15:26
1
answer

Make an IF to define WHERE

I need a help with a command in a SQL proc. I basically need something like this: ... ... WHERE IF ( @Id_ProductClass IS NULL ) WHERE CLIENTPROD.Id_ProductClass NOT IN (59, 150) ELSE WHERE CLIENTPROD.Id_ProductClass = @Id_Product...
asked by 20.02.2015 / 17:49
1
answer

Passing parameters to procedure in postgresSQL

I will create a trigger in postgreSQL to copy information from one table to another, the tables will always have the same structure, so I want to pass the table names, make a WHILE and copy the files from one to another, but I can not remember...
asked by 17.12.2014 / 13:15
1
answer

Allow a user to view stored procedures created by other users

I have a MySQL database populated with some stored procedures . The problem is that two different users have created several procedures, so that only the user who created the stored procedure can see its contents. In this context, I would like...
asked by 17.11.2014 / 16:56
1
answer

I can not execute a procedure in Firebird

Good afternoon, guys. I need to insert a record in the database but no duplication. I tried this: create procedure My_Proc as begin if(not exists(select * from alunos where nome = 'Mateus')) then insert into Alunos (Matricula, Nome, Idade, O...
asked by 02.01.2019 / 16:16
1
answer

Assign execute command to a variable

I need the return of the execute command to be assigned to variable @PAGO because I will insert it into a temporary table only what returns is the script, not the value. DECLARE @COMANDO_COMANDO_PAGO VARCHAR(2000) SET @SITUACAO = 'PAGO'...
asked by 12.10.2014 / 19:59
1
answer

Error: procedure or function has too many arguments specified

Criei uma procedure para popular uma grid view: create procedure [dbo].[spc_listaafiliadosadmin] ( @nome varchar(100), @login varchar(100), @cpf varchar(100) ) as begin if(@nome is not null) begin sele...
asked by 18.09.2015 / 21:05