Questions tagged as 'stored-procedures'

2
answers

Store procedure is not working correctly

I created a StoreProcedure named, CancelNote, which, by using cursors, returns the products to the stock, passes the status of the item to canceled. It is working, however, not setting the "status" value in the [status] column. If someone can he...
asked by 30.05.2017 / 21:12
1
answer

Safe update error using stored procedure in MYSQL

I'm having trouble updating my stock table using a stored procedure in MYSQL. Here is the code: CREATE DEFINER='root'@'localhost' PROCEDURE 'atualiza_estoque'(id_produto int) BEGIN update estoque e inner join reposicao r on r.produto = e.prod...
asked by 13.05.2017 / 00:13
0
answers

SQLSTATE [HY000]: General error: 2053 when I call a Stored Procedure?

I am using Laravel 4.2 and am calling a Stored Procedure from a database on the server. Locally it works fine, but on the server, using the same DB, it gives error. The call is as follows: $result = DB::select('CALL sp_precos_...
asked by 07.02.2017 / 18:21
1
answer

How to optimize a select within an update?

I created a stored-procedure that updates the balances of the Handle table. At first I tried to use From Movimentacao within the update of the move, only that returned error. I fixed this problem by doing FROM (SELECT * FROM M...
asked by 31.01.2017 / 21:54
1
answer

SQL UPDATE SUM VALUE NOT NULL

dataTmp referencia nStock 2017-02-18 DC01234567 NULL 2017-02-18 DC01234567 NULL 2017-02-18 DC01234567 NULL 2017-02-19 DC01234567 0 2017-02-19 DC01234567 0 2017-02-19 DC01234567 0 2017-02-20 DC01234567 0 201...
asked by 18.02.2017 / 23:47
4
answers

How to write a store procedure that uses values from the current and previous row?

I have the following table, # id # dataTmp # referencia #nProduz#nStock # id2 #necessi# # 115237 # 31-01-2017 # VL03280103 # 0 # 0 # 6 # 0 # # 115238 # 01-02-2017 # VL03280103 #...
asked by 30.01.2017 / 15:26
0
answers

Using Store Procedure for User Authentication

I have the following Store Procedure in my MySQL database, SP_Autentica : BEGIN SET @id = (SELECT ID FROM userdata WHERE Username = user AND Password = pass); END In ASP code, conn.asp : connectstr = "Driver={MySQL ODBC...
asked by 11.11.2016 / 01:37
2
answers

Encrypted password verification

I'm having a hard time checking the login with Delphi with encrypted password in the MySQL database, I can do the registration and encrypt the password in the database through Delphi with the StoredProcedure that I cr...
asked by 05.11.2016 / 00:43
2
answers

Generate random name in MySQL - Stored Procedure

Good evening, is there any way to generate random names with stored procedures in MySQL? I have the following table:    ALUNO (id: int [PK], name (varchar (100)), age: int, Cr (float)) I need this table with 10mil entries popular. To gene...
asked by 20.05.2016 / 03:23
1
answer

Sort the table by the closest value of the parameter passed in stored procedures

How to sort a table according to the approximate value of a parameter passed in a stored procedure Ex: Let's say in a table the name field has the following values: Tiago, Iago and Thiago and I pass as a parameter in the stored procedure "...
asked by 18.03.2016 / 20:19