Questions tagged as 'sql'

1
answer

stmt prepare nothing appears to me

I have this code to print the data on the page that comes from the database: <?php session_start(); include "conection.php"; $id_login = $_SESSION["id_login"]; $stmt =$db->prepare("select login.username, login.nome, lo...
asked by 30.01.2016 / 15:47
0
answers

Searching from form

I have a form with all the districts of portugal. When I select a city, I search using the post method, I get the value of the city and the search shows everything that exists with the city field. So far so good. But when the va...
asked by 30.01.2016 / 12:55
0
answers

MSSQL: SQLSTATE [] (null) (severity 0) after loading 1000 rows

I have some reports where I need to perform new SQL queries in the loop. These reports are running on PHP and datatables. At times, when the number of rows reaches a volume greater than 1000, the MSSQL: SQLSTATE [] (null) (severity 0) error...
asked by 02.02.2016 / 13:12
1
answer

How to calculate timestamp in SQL

I have an INT (Status) field in the database, I have a script that updates it every 5 minutes using php's time (). How do I calculate via sql? Follow the select I'm using. SELECT * FROM users WHERE status >= NOW() - INTERVAL 10 MINUTE...
asked by 11.02.2016 / 22:42
1
answer

SqlDataReader Not Closed?

Imports System.Data.SqlClient Public Class F_Contentor Dim F_Topo As New Form2() Dim F_Principal As New Form3() Dim Prof_Ses_Nome As String Dim Prof_Ses_Id As Integer Const cs As String = "Data Source=D01PC1\SQLEXPRESS;Initial Catalog=Desinov...
asked by 21.01.2016 / 10:44
1
answer

Maintenance plan SQL Server 2014

I created a maintenance plan in the bank of the company where I work, it is dealing with the following options: Check Database Integrity Shrink Database Reorganize Index Rebuild Index Update Statistics And after completing it, he...
asked by 20.01.2016 / 20:04
0
answers

How to create database via sql and utf8_bin?

I have the following sql script: CREATE TABLE IF NOT EXISTS 'pais' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'nome' varchar(60) DEFAULT NULL, 'sigla' varchar(10) DEFAULT NULL, PRIMARY KEY ('id') ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREME...
asked by 13.01.2016 / 19:25
1
answer

How to mount a generic query using jpa nativequery

Consider the following table: table: people_info || row || name || surname || nationality || time_do_coracao | 1 | marcelo | aragao | brasil | sp | 2 | maria | fonseca | brasil | sp | 3 | joao | timotio | brasil | palmeiras | 4 | marce...
asked by 16.01.2016 / 11:46
1
answer

How to return day of week and time formatted sql server 2008?

I need to make a query as follows, I have a table (script): 1 - Pick up the day of the week 2 - Get the server time in hh:mm format example: SELECT CASE DATEPART(DW, GETDATE()) WHEN 1 THEN 'DOMINGO' WHEN 2 THEN 'SE...
asked by 29.12.2015 / 03:47
0
answers

Traverse all strings by delimiter in the field and generate a column with the result

SET @contador := 0; SELECT SUBSTRING_INDEX( SUBSTRING_INDEX("BOX 01;BOX 02;BOX 03;BOX 04;BOX 05;BOX 06;BOX 07;BOX 08;BOX 09;BOX 10;BOX 11;BOX 12;BOX 13;BOX 14;BOX 15;BOX 16;BOX 17;BOX 18;BOX 19;BOX 20;BOX 21;BOX 22;BOX 23;BOX 24;BOX 25;B...
asked by 25.02.2016 / 17:09