Questions tagged as 'sql'

1
answer

Generate score of a table based on a scoreboard

I have a job to do SQL database I have the following problem ... I have in a GAMES table the columns    JOG_ID, MAJOR_ID_JOG_TIM, JOG_TIM_ID_VISITANT,   JOG_MANDANTE_PLACAR, JOG_VISITANTE_PLACAR explanation:    JOG_TIM_ID_MANDANT...
asked by 05.06.2017 / 00:15
1
answer

How to create a trigger that loopes in MySQL

In my database I have the following tables: module_user, module and control. I need to create a trigger that is executed after an insert in the table user_group. This trigger should make a select in the module table and create a loop that...
asked by 17.06.2017 / 19:38
1
answer

Display Java Database Values

I'm a beginner in Java and I'm doing a mini-RPG-style program for database testing, and I want to display the data contained in the DB using a ArrayList , however the output is always like this:    [rpg.Personagem@1de0aca6, rpg.Personag...
asked by 14.06.2017 / 06:07
1
answer

Error executing SQL "Create Trigger ..." within a C #

Goal: Run a create trigger script using a string inside C #. Problem 1: Table not found (because the script does not indicate in which Table to create the trigger). Attempt2: Start the string with "Create Trigger on [dbo]. [Table]". Pro...
asked by 14.06.2017 / 14:23
2
answers

SELECT on a date in the range of ONE entered date and the date of the next record

How to generate a select that brings the date between an informed date and the date of the next record? In the Cargos table I only have a date, not a data_inicio and a data_fim , and I need to know the date between th...
asked by 31.05.2017 / 15:13
1
answer

Return data from a N: N table only with foreign keys

Good afternoon, I'm a beginner in the SQL language, and I'm wondering how to return the values of the foreign keys in a N: N relationship, for example, return the product name and part name. Thank you in advance.     
asked by 31.05.2017 / 18:53
2
answers

Function with insert according to a select that returns a list of ID's - Postgresql

I need to make a after insert trigger that calls a function that takes the last record inserted in a certain table and inserts the ID of that last record into another table according to a select that returns several ID's. EX: tb_...
asked by 07.06.2017 / 19:53
2
answers

Operator in postgres function returns SQL Error [42883]: ERROR: operator does not exist: integer = integer []

I have the following error in a function    Postgres SQL Error [42883]: ERROR: operator does not exist: integer =   integer [] I have tried to convert the data to varchar and text but even then I could not return the require...
asked by 29.05.2017 / 21:37
1
answer

PHP & SQL-Query is not being read

I have the following code, something is happening but I can not figure out why. ie the query is not being read, the echo appears to say "error" <?php $_SESSION['message'] =''; include("config.php"); if($_SERVER['REQUEST...
asked by 28.05.2017 / 23:29
0
answers

How to relate these tables, returning specific values?

[Firebird] sgbd - IBExpert I need to know how I can relate these two tables (comment below), so that I get the following results: TABLE: CONTARECEBER DTDOCUMENTO (date you entered the system) DTVENCIMENTO (date the document will...
asked by 01.06.2017 / 15:54