Questions tagged as 'sql'

1
answer

How to do a Ray calculation in SQL, using MySQL, with two conditions?

Hello, I already do a ray calculation in SQL, using MySQL and PHP, which takes the location of the device (latitude and longitude) and filters the radius according to the location of the device. It's like this (excerpt): (6371 * acos(...
asked by 06.05.2017 / 19:29
1
answer

Sub-Select with MAX / SUM / INNER JOIN?

I need to make a SUM within MAX to return the highest product billing within a summary. I was able to do this: SELECT MAX(Faturamento) MAX_Faturamento FROM (SELECT SUM(P.preco * I.qtde) Faturamento FROM produto P IN...
asked by 01.05.2017 / 17:01
0
answers

'SET ANSI_WARNINGS ON' Laravel 5.4

I'm using Laravel 5.4 with 2 connections, one of them is just to access some Views of a Sql Server bank, and one of them does a LINKED SERVER which forces me to set some settings before making a query. p> Today I can do this in my Controller a...
asked by 09.05.2017 / 18:30
1
answer

Modeling ER "academic system"

Can anyone help me? I'm doing a database job in which I have to make an academic "system" I developed this ER from the photo, I have doubts of the type: How do I make the teacher store the notes and frequencies? How do I get the student to view...
asked by 09.05.2017 / 18:33
0
answers

Integrate ComboBox with TableView QT

I have a table Courses: create table Cursos( ID_curso int not null auto_increment, Nome_curso varchar (50), primary key (ID_curso) )default charset = utf8; And another table registered: create table Cadastrados( Nome varchar(50), Matricul...
asked by 03.04.2017 / 17:00
1
answer

How to pass Pervasive SELECT DB parameter

I'm having to work with Pervasive database, so I'm having trouble passing a parameter to make a SELECT I've tried using: DBCmd.Parameters.Add("@inicio", PsqlDbType.VarChar).Value = date_inicio; DBCmd.Parameters.Add("@fim", PsqlDbType...
asked by 02.04.2017 / 00:03
1
answer

Assign a cursor value to a table column

I have a cursor. I need in an insert to insert the value of each cursor position to a table. How do I do this? I need to insert the value of the exame_cur cursor. My code below: set nocount on declare @id_xfc int, @id_exm_rea int, @id_...
asked by 24.04.2017 / 17:44
0
answers

How to do linked server with Oracle database for SQL Server 2008 (and considering VPN connection)?

I need to create a Linked Server connection to my client's SQL Server 2008 database. This Linked Server will be with an Oracle database. My SQL Server 2008 database is on a client-side server. The Oracle database is located on another remote...
asked by 27.03.2017 / 15:02
0
answers

Connection Sql Server Express 2014 with Visual Studio 2015

I can not get the server name to appear in Visual Studio, I have the firewall disabled and I already verified that the server is active, please help me Thank you in advance.     
asked by 06.04.2017 / 15:29
0
answers

Hibernate query (HQL) in Java with foreign key ... ERROR!

I need help with my code, I have two tables: -CDF (Employee Registry) CREATE TABLE public.cdf( ativo character varying(1) COLLATE pg_catalog."default", reg integer NOT NULL, nome character varying(30) COLLATE pg_catalog."default" N...
asked by 23.03.2017 / 22:12