Questions tagged as 'sql'

1
answer

doubt with Cursor type_warning

I can not understand how this type of cursor works, does anyone know or have an example in SQL? In the documentation says this:    Specifies that a warning message is sent to the client when the cursor is implicitly converted from the request...
asked by 30.10.2017 / 13:43
1
answer

Error query from php, function bind_param ()

I need help with this: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); include_once 'includes/funciones/funciones.php'; session_start(); usuario_autenticado(); if(isset($_POST['submit'])) { $nombre = $_P...
asked by 28.10.2017 / 17:10
1
answer

Problem with query

I have the following problem, I want the column Months to stop repeating, and the column Qty is added, but the table is the result of a query, I leave the query and the result table as an example: select DateName(month,date_esti...
asked by 03.11.2017 / 21:14
2
answers

NEW and OLD variables postgres

I have the following problem, I need to make a bitacora and that for each modified data create a record in the bd. Each table has a trigger that will call the bitacora function () and inside it I must capture the OLD and NEW and cycle so that...
asked by 06.10.2017 / 19:31
1
answer

Increase the value of a field

The code I have in the function is the following: DB::table('projects') ->where('order', DB::raw("(select 'order' from projects)")) ->order + 1; The error that shows me is the following:    Undefined property: Illuminate...
asked by 24.10.2017 / 16:45
1
answer

SQL (ORACLE) How can I insert the current date into a table when inserting a record?

I know it's a Trigger and I have this, but it generates an error: create or replace trigger INSERTAR_HORA AFTER insert on TAREA_SOPORTE for each row begin UPDATE TAREA_SOPORTE SET HORA_GENERADO= CURRENT_TIMESTAMP...
asked by 04.10.2017 / 08:19
2
answers

Return 1 pair by SQL Id SERVER

I have the following query SELECT IdentificadorAutomovil, Automovil.Titulo, Automovil.Precio, Automovil.Anio, Automovil.Kilimetros, Automovil.Ubicacion, Imagenes.Imagenes FROM Automovil INNER JOIN Imagenes ON Automovil.IdentificadorAutomovi...
asked by 21.09.2017 / 16:22
1
answer

How can I convert this query from SQL to LINQ

SELECT STUFF(( SELECT ','+EXC_Nombre FROM Bloqueos as B, Excursiones as E Where B.BloqueosId = 3 and E.ExcursionesId IN ( SELECT [BLE_ExcursionId] FROM [BloqueoExcursions] Where BLE_BloqueoID = 3) FOR XML PATH('')...
asked by 21.09.2017 / 00:44
1
answer

PHP: Start the update with value 1 and not 0

I have a table where I drag and drop, drag a row and place it in another position. The 'order' field starts with 1 and when I do a drag and drop they are updated from 0. I would like the update to be maintained from the order field with value...
asked by 15.09.2017 / 09:47
1
answer

Simulate a kind of FOR EACH in Mysql

Currently I'm doing a query that shows the total of reports of a specific type sent (sent = 1) for each user. The current query that I have works and is: SELECT username, SUM(inf_name='INF_01') AS INF_01, SUM(inf_name='INF_02') AS INF_02, S...
asked by 14.09.2017 / 21:26