Questions tagged as 'mysql'

1
answer

What is the best way to read an XML in PHP and insert it in the Database?

I am reading XML files of about 50M of information (about a hundred thousand records, may be more), and I have two classes read XML read from a DOM and another SAX. I'm having a problem in terms of runtimes, take me longer than 10 minutes, ma...
asked by 17.06.2014 / 15:34
1
answer

Is it possible to create a foreign key from another database?

I want to reference a foreign key from a different bank, I have seen in some forums that it is only necessary to 'nome_database'.'nome_tabela' , but it is not working. My code is as follows: ALTER TABLE 'relatorio_gestao'.'usuario_setore...
asked by 25.04.2014 / 21:30
1
answer

Calculating hours within the query

I've already done this and it works fine in C ++. My problem is to do within a select to appear in the table. If anyone wants to see the algorithm in C ++ to help mount it in MySql I can. My table is this: The fields after the stat...
asked by 01.01.2017 / 19:46
1
answer

Convert SQL query to LINQ

What would be the converted SQL query for LINQ: "SELECT SUM(valor_negocio) valor_negocio, " + " MONTHNAME(STR_TO_DATE(MONTH(data_inicio), '%m')) mes," + " STATUS" + " FROM negocio" + " WHERE data_inicio BETWEE...
asked by 04.11.2017 / 20:26
2
answers

Conflict of encoding using Tinker and Laravel

I'm learning how to use Laravel and got caught in an encoding problem. I am trying to use tinker to insert data into my tables, and there I am getting the following error when I try to include a new post: Illuminate\Database\QueryException w...
asked by 09.10.2017 / 18:09
1
answer

What are these sql modes in mysql?

Here is the code: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=...
asked by 27.09.2017 / 18:14
1
answer

Group items with a date difference of 10 minutes between each other

I have a table named tb_log , in it I have some data id , usuario_id , produto_id , ..., data . I need to group records by date as follows: All records that have a time difference of up to 10 minutes. That is,...
asked by 20.09.2016 / 21:51
1
answer

How can I prevent the deletion of relational data through referential integrity in MYSQL?

I have the SIMULATE and QUESTION tables, where a simulation can have several questions, but one question can only be for a simulated (1-n relationship). SIMULATED TABLE: simuladoId simuladoNome QUESTION TABLE questaoId questaoPergu...
asked by 14.09.2016 / 17:37
1
answer

How to detect MySQL changes in NodeJS?

Good evening, Has anyone used this package or do you know of a similar one that works? Link: link Purpose: to launch an event when there is a change in the database. Before I gave an error saying that it was not allowed to monitor my...
asked by 29.06.2016 / 23:28
2
answers

Query to get text after a certain character

Good morning, I need a way to get all the rest of a string after a given character, for example, I have the following database Ineedtoalwayssearchfortheremainderofthestringafterthelast"" " ie for the first line I needed to get all " System acce...
asked by 11.11.2015 / 15:04