stored-procedures

How do I return values from a MySQL stored procedure?

I started learning MySQL after 20 years of working with SQL Server. 95% of my database queries are stored procedure calls, wh ... ything is clear. The syntax is no different from Transact-SQL. I would appreciate more elegant solutions (if there are any).

How to get the primary key identity of an entered record?

I need to create a stored procedure to insert a game into my database. A game relates to a championship through Table campeon ... I would get the codJogo which is primary key identity of my insert and so inserting into campeonatoJogo. Thank you right now.

Safe update error using stored procedure in MYSQL

I'm having trouble updating my stock table using a stored procedure in MYSQL. Follow the Code: CREATE DEFINER=`root`@`local ... would like to understand what is causing this error, since the procedure worked perfectly twice before presenting the error.

How to assign a run SP EXECUTESQL @ SQLSTRING to a temporary table

Is it possible in the same script to create a temporary table from a run like this? --****************************EM ... temporary table, something like this: insert into #tab2 EXECUTE SP_EXECUTESQL @SQLSTRING To manipulate the data.

Foreach in SQL to put a value in a variable

My problem is that I have a subquery that works perfectly, but for this I have to enter the id I want in the variables. In ... c.id_carro join tblDespesa d on pc.id_despesa = d.id_despesa where c.id_carro = @id_carro) as nv1) as nv2)as nv3

How to call an oracle C "Stored Procedure"#

I have the following procedure in my bank: I'm trying to call my store procedure in .NET like this: publi ... Incorrect number of argument types in the call to 'COUNT_EVENT' Could anyone help me in why the parameters are wrong?

Difference between Triggers and Stored Procedures

What are the differences between Triggers and Stored Procedures?

Error trying to remove a temporary table [closed]

closed . This question needs details or to be clearer and is not currently accepting answers. ... Cannot drop the table '# temp ' because it does not exist or you do not have permission. [SQLSTATE 42S02] (Error 3701).

What does Overhead mean in physical database design?

I just read about physical design and database tuning and I couldn't understand the concept of overhead, and consequently I c ... red by the answer quoted above, then I will remove it. Book : Database Systems, 2011. Elmasri R, Nevathe B, chap 20, pg 495.

How to run an INSERT procedure with the GETDATE field? SQL Server

Next, I created a procedure that has two parameters Dt_inclusion and Dt_Alteracao, I would like to know how do I insert (or i ... or this procedure to work, so that with just GETDATE I get the current date and time when using insert? Thank you right now!

Create SQL Server procedures

Good afternoon everyone! :) I'm new to programming and I'm having some difficulties I am trying to create a procedure to u ... n venda v on vp.ven_ID = v.ven_ID inner join cliente c on v.cli_ID = c.cli_ID where c.cli_ID = @cli_id group by c.cli_id end

How to pass a list of values to a Stored Procedure?

I am creating a stored procedure in SQL Server 2008 R2 and would like to pass a list of values per parameter, for example: ... . My doubt is how to make stored procedure receive a list of values, and these values will vary and can be 1, 2, 3...N ids.

Error performing PROCEDURE call in SQL Fiddle

When calling a PROCEDURE in SQL Fiddle, the following error appears: DDL and DML statements are not allowed in the query ... ; END// In the SQL execution tab: CALL PROC_TEST() Follows the fiddle used in the creation and calling of PROCEDURE.

Missing if in procedure

I did the following procedure, but in END// appears 'missing if', does anyone know why? William helped me with this problem ... constraint cpf_usuario_login_fk foreign key (cpf_login_fk) references tbl_usuario on delete cascade on update cascade );

If I inform parameter it does not bring any data in Stored Procedure (Oracle)

Guys I'm having a problem in the Stored Procedure below, where it only brings the data if the parameter of EmpresaId comes bl ... ar = 'codigo' THEN "Codigo" ELSE "NOME" END, "fornecedorId", "DataOrder", "ParcelaId"; END;

Select with SUM until sum B is equal to or less than A

I have two tables, products and lots: Products codigo qtdatual Lots codigo qtdlote validade An select example wou ... uld bring the batches 1 and 2, but then it would be a matter of adding the DESC in validity, it will not change the question.

What is the difference between a view and a stored Procedure in SQL? [duplicate]

this question already has answers here : ... en a view and a stored procedure and what are its purposes? Would it be possible to provide 1 case study for each situation?

Filters records via datetime and trace them between a start and end date

I have the balance table, which always when performing a procedure, a new record is generated in it, and can have several r ... nd date, but bringing only the last record of every day, as in the above procedure. The table fields are shown in the image.