Questions tagged as 'stored-procedure'

2
answers

How can I do a Select and an Update in the same query?

I have 2 tables: Users [Id, UserType, Email, Password] Clients [Id, TypeUser, Email, Password, UltimaSesion] I have created a login query through the Email and password looking in both tables to know if it is a User of the company or a...
asked by 18.08.2017 / 02:43
1
answer

Help in procedure or function error ... expects parameter @ ... which was not supplied

MY PROCEDURE IS: ALTER proc [dbo].[spinsertar_detalle_ingreso] @id_detalle_ingreso int output, @id_ingreso int, @id_producto int, @precio_compra money, @precio_venta money, @precio_especial money, @precio_especial2 money, @stock_inicial...
asked by 24.12.2018 / 05:03
2
answers

Error when trying to insert an insert into MySQL

I'm doing a procedure in which I create a temporary table and fill it with the result of a query, or at least that's what I'm trying to do. I have the following script: CREATE TEMPORARY table tblTemporal( id bigint AUTO_INCREMENT PRIMARY KE...
asked by 21.07.2018 / 18:41
3
answers

Sum of NULL problem with result, if the value of the data is null

I need to bring the sum of 2 data: dato1 = 1 dato2 = 2 totalsuma = 3 Currently I do it like this: SET totalsuma = (SELECT SUM(dato1+dato2) from tabla WHERE CODIGO = codigo_new); up there all right the totalsum variable takes me the...
asked by 27.06.2018 / 00:36
1
answer

Error converting the data type varchar to datetime

My problem is I want to add three dates that are in datetime format in sql. these date variables are in an SP and when sending the information manually in sql server: exec spInsertaCargoCobranzaMV '00024','002',21554,1,0,500.00,'5-19-2017',...
asked by 15.11.2017 / 01:25
1
answer

Any way to insert records when the table has default and identity in SQL Server?

CREATE PROCEDURE USP_ADD_CLIENTE @PNIDTIPDOCUMENTO INT, @PSNUMDOCUMENTO VARCHAR(35), @PSNOMBRES VARCHAR(40), @PSAPEPAT VARCHAR(25), @PSAPEMAT VARCHAR(25), @PSCORREO VARCHAR(40), @PSTELEF VARCHAR(25), @PNESTADO INT, @PSUSUREG VARCHAR(40) AS IN...
asked by 06.11.2017 / 19:16
2
answers

Create Stored Procedure to create a new table - SQLServer 2014

I need to create a procedure that creates a new table from the selection of one or several entities. The selection of 'IdEntity' I do from a gridView in the presentation layer in Visual Studio. What I have is this: CREATE PROCEDURE [dbo].[sp_...
asked by 06.07.2017 / 16:29
3
answers

HTTP Error 404.0 Not Found

Good day mates I have this code of the contrlador and the view in asp.net mvc but when clicking on edit I get this error and verify to have created the view, I think it does not identify by id but in my code in the controller what I put it to go...
asked by 28.06.2017 / 00:16
1
answer

If I execute a second stored procedure within the first stored procedure, does the first wait until the second stored procedure ends?

What happens is that I want to send a table-like parameter to a stored procedure that is called inside the body of another stored procedure. The second process takes a little more time so I wanted to know if the first one waits for the second...
asked by 01.12.2016 / 16:05
1
answer

Store procedure in oracle, select

I am trying to generate an SP in oracle which returns a select of a column. Currently CREATE OR REPLACE PROCEDURE get_usuario(idUser IN USUARIO.ID%TYPE, O_EMAIL OUT USUARIO.EMAIL%TYPE) AS BEGIN SELECT EMAIL INTO O_EMAIL FROM USUA...
asked by 09.08.2018 / 00:21