Questions tagged as 'stored-procedure'

0
answers

Procedure stored in laravel with parameter

I have seen two syntaxes when calling stored procedures that receive parameters in laravel, both work perfectly: //Concatenando parametro DB::select('exec Miprocedimiento "'.$parametro.'"'); //Utilizando ? DB::select('exec Miprocedimiento...
asked by 11.04.2018 / 17:17
1
answer

Bring Query result (select * from ...) to XML

I wanted to know if there is a way in Oracle 10gR2, that the result of a query ( Select * from ... ) is stored in an XML. I want a stored procedure to have a single output parameter (XMLType), but the information in this parameter varie...
asked by 13.10.2016 / 01:18
1
answer

How to convert a boolean to string in a Store procedure SQL

I have the following procedure (select) that gives me some information: SELECT id_accion, accion_tomada, CAST(fec_inicio AS VARCHAR) AS fecha_ini, CAST(fec_fin AS VARCHAR) AS fecha_fin, estatus FROM detalles WHERE id_downtime = @id_dt...
asked by 02.05.2018 / 22:44
1
answer

Is it possible for a stored procedure to work with two databases?

I've been searching but I have not found exactly what I'm looking for. I have two databases, let's call them Base1 and base 2 and a stored procedure that executes in base 1 , this base has a series of mirror tables that lo...
asked by 24.04.2018 / 12:23
2
answers

Error in MySQL stored procedure - Python

I have this procedure in MySQL: sql_procedure = """CALL INSERTAR_OPORTUNIDAD(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%...
asked by 03.08.2017 / 22:18
2
answers

How to make a CASE WHEN from a Nvarchar Field that is sometimes Null or empty?

Well I have the following Query, it is a stored procedure for HANA STUDIO I have the Field A. "NumAtCard" which is of type nvarchar what happens is that many times the field will be empty or it will be null and I would like to know how to make...
asked by 09.11.2018 / 15:54
1
answer

How to use CASE within WHERE in SQL Server

I have the next part of a procedure on sql Server. FROM Personas as p inner join Estados as e on p.EstadoId=e.Id inner join ListaMarketing_Persona as lmpe on p.Id=lmpe.IdPersona inner join ListaMarketing as lm on lmpe.IdListaMarketing=l...
asked by 28.10.2016 / 17:01
1
answer

Procedure to give permissions to an Oracle 11g user?

I am trying to create a procedure that receives as a parameter the user to whom they wish to grant the tables permission directly, I know that it would be better with a role and simply grant it, but it is an exercise, to create a procedure that...
asked by 04.04.2017 / 03:58
2
answers

How to use several "IF" Conditionals in a Store Procedure in SQL Server

I would like to know how I can use several IFs in a Store procedure in SQL Server, How would Syntax be? Here I have an example of one, but this has only one If and one Else and within that ELSE there are two others, but I need to do more and it...
asked by 16.11.2018 / 17:36
1
answer

MySQL Query with a while and another query inside

I raise here a question that I have consulted in other places and nobody has been able to answer me. I'm a newbie in PHP and MySQL, and I'm doing my first steps. I just found a fairly frequent case, which is a query that leads to a while, within...
asked by 15.06.2017 / 15:11