Questions tagged as 'sql'

1
answer

how can I insert in the table all the data of the query and not only take the first data that the query returns me?

$conexion= new mysqli($host, $usuario, $contraseña, $base); if ($conexion -> connect_errno) { die("Fallo la conexion:(".$conexion -> mysqli_connect_errno().")".$conexion -> mysqli_connect_error()); } $Query="call insertCons('$selec...
asked by 31.05.2018 / 23:34
0
answers

Select in SQL the current date and time of the assigned time zone even if the user changes the date of the S.O.

Is there any way to be able to select in SQL the current date and time of the time zone assigned to the database, even if the user changes the date of the operating system? I have tried with the following sentences but if I change the date of...
asked by 31.05.2018 / 00:02
0
answers

how to save the result of a query in a variable

I'm debugging this code SqlCommand cmd2 = new SqlCommand("SELECT LOCT_LOGIN_EMAIL from LOCT_LOGIN_V Where LOCT_LOGIN_USUARIO=@usuario", cnsec); cmd2.Parameters.AddWithValue("@usuario", usuario); I would like to save a variable wi...
asked by 31.05.2018 / 00:28
0
answers

java- How to use PreparedStatement correctly?

It turns out that I am trying to parameterize a querie , apparently it takes the data but returns an erroneous result for example. Select campo from tabla where nombre ='pepito' Does not return anything select campo from tabla whe...
asked by 29.05.2018 / 17:07
0
answers

-Java Can you parameterize a column with preparedStatement?

I have a dropdown that when the user selects it, he asks for a column of one db. The problem is that I can do SQLinyection with the same options. Next to the dropdown I have a field that also queries the db but it is parametrized, I wanted to kn...
asked by 29.05.2018 / 17:57
1
answer

Error UPDATE with PDO

I'm trying to update the data, but when I update it, I change the user_id, but I want to continue saving it. Function, public function actualizaPagador($id_pago,$id_usuario,$pago){ $db=BaseDatos::conectar(); try{...
asked by 01.06.2018 / 11:57
0
answers

Insert DataSet in SQL

A question to the knowledgeable public of this forum .. I am with a system in Visual with MVC, in which I must consult some data and for this I must load initial information to the database with a dataset, it is filled with an excel file. The qu...
asked by 08.06.2018 / 01:47
0
answers

Flow control in a user-defined function

I have created a function that responds to the following code: -- Pasando un numero de departamento, obtener los empleados de este y su id. CREATE FUNCTION F_Emp_NumEmp (@NumDe NUMERIC(3)) RETURNS TABLE AS RETURN (...
asked by 28.05.2018 / 15:11
1
answer

SELECT in SQL Server last week

Hi, I would like to do a SELECT of SQL server but only select me the last days from Monday to Sunday. NOT the last 7 days would be something like this: select GETDATE() - 7 but in that only I get the last 7 days but I want to start from Mon...
asked by 30.05.2018 / 06:40
0
answers

query with sql pivot

I have this query but I like to add the number of calls and the sum TMO per hour example so I want to do it: usuario 8 9 10 cantidad|tmo cantidad|tmo cantidad|tmo juan 20 | 45.20 20 | 10.3 52...
asked by 26.05.2018 / 01:34