Questions tagged as 'stored-procedures'

2
answers

Do a procedure with SQL language that returns the number of clients that have no business done

I can not resolve this issue, I want it to show client numbers without primary key repeat, no business done, and show a warning if customers have business done. This error has appeared here. CREATE FUNCTION sem_negocios() RETURNS integer AS...
asked by 28.06.2017 / 03:45
1
answer

Parameter-based query in SQL Server

I have a situation where I need to bring results depending on the parameter reported. If I enter some number, that would be the code, it would only bring the result that has the code. If I did not report anything, it would fetch all the results...
asked by 17.12.2015 / 14:50
2
answers

Insert procedure into three tables

Hello everyone, I am trying to change a procedure that I created to insert a new book into three tables. The table has autoencrement in the book_id column, and tables B and C are not null, I am using @@ IDENTITY to get the last value of table_id...
asked by 05.12.2018 / 12:03
1
answer

Tanned system with Stored Procedure

I'm trying to make a stored procedure for a simple tanned system, my table is organized like this: Tanned id INT (11) - Auto Increment post INT (11) - foreign key (id - post) user INT (11) - foreign key (id - users) Users...
asked by 26.10.2018 / 23:02
1
answer

Problems to invoke / insert data with the procedure

I created this procedure in Oracle, but I am not able to insert data with EXEC . How I'm Declaring EXEC: EXECUTE SP_PRODUTO(8,'teste' 1); erro APRESENTADO: ORA-06550: linha 1, coluna 126: PLS-00306: número incorreto de tipos de argum...
asked by 27.09.2018 / 04:11
1
answer

Double INSERT in stored procedure

Currently what I basically have is this: CREATE PROCEDURE 'Teste'( IN '@valorX' INT, IN '@valorY' INT ) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER INSERT INTO tabelaX(colunaX) VALUES (@valorX) INSERT INTO tabelaY(colunaY) VA...
asked by 24.10.2018 / 15:14
1
answer

Procedure price range

I'm trying to create a procedure that, depending on the price range, takes a different field from the table. Create Procedure BuscaPreco @preco decimal, @faixa1 int, @faixa2 int, @faixa3 int, @faixa1=100, @faixa2=200, @faixa3=300 Select case...
asked by 24.10.2017 / 16:15
1
answer

Bulk insert into a table

I have two proc's that my system in VB already uses. One for Insert and one for Update. I need to use it right now, right in the bank. The target table has a composite key as follows. A field named ID_OIT_LET and another field called ID_OIT. ID_...
asked by 20.04.2017 / 14:18
1
answer

C # with Storeprocedure

Good evening guys I'm doing a system for college and I'm trying to do with the procedure but it's not recording in the bank I think there's something wrong but I do not think so. I tried to use CM.Parameters.AddWithValue and CM.Parameters .Add m...
asked by 28.03.2016 / 04:31
1
answer

Group Query Results

The procedure below makes a query per day between the start and end dates, so it brings up multiple queries, is there a way to group all queries generated in just one? Also, how to eliminate the empty results? DELIMITER // CREATE PROCEDURE pro...
asked by 23.06.2015 / 01:42