Questions tagged as 'sql'

1
answer

When the Trigger SQL server is fired After Insert?

When a trigger is triggered after an insert and the insert is within a transaction, does the trigger execute at the time of the insert or at the end of the transaction?     
asked by 07.03.2018 / 21:18
1
answer

How to enter values in Laravel

I'm trying to use the following command to insert: $sql = "INSERT INTO tabela (campo1, campo2, campo2, campo4) values(:campo1, :campo2, :campo3,'S')"; $campos = array( ':campo1' => $nome,...
asked by 06.03.2018 / 20:18
1
answer

Select does not return broken value

I have the following command: SELECT CAST(450/4 AS DECIMAL(15,2)) Return : 112 where the right one would be 112.5 Why this? NOTE: My SCRIPT is in a procedure, but roughly my problem is in this select     
asked by 17.03.2018 / 21:42
1
answer

How popular is a postgres table with JSON?

I'd like to populate my tables with Json. But I can not. Does anyone have a solution? Follow JSON: link     
asked by 16.05.2018 / 01:25
1
answer

Query creation using PIVOT in SQL

I need to display the result of this query in columns, each row represents an employee point mark on the day, I'm trying to use the pivot, but I'm not getting it.     
asked by 16.05.2018 / 01:18
1
answer

ORACLE SQL - Sort by sum

I need to make a report and I can not sort it as a wish, I want to select customer debit between 60 and 120 days and sort by total. The code looks like this: SELECT SUM(cod_fat_cli) "Total", nom_cad_cli "Nome", end_cad_cli "Endereço" FR...
asked by 23.02.2018 / 16:57
1
answer

Query with date in sql includes the day in question?

I have a question about the exact days that SQL includes, and my system once per day performs the following query on the system: SELECT id,nome FROM products WHERE created_date between \'"+last_date+"\' and \'" + now+"\' Where to...
asked by 22.02.2018 / 16:27
1
answer

Start and end of a month / year passed in parameter (Oracle)

I need to return the total monthly data according to the parameter of MONTH and YEAR reported. I did as follows: WHERE a.dt_mesano_referencia between to_date('01/'|| :NR_MES ||'/'|| :NR_ANO ||' 00:00:00', 'dd/mm/yyyy hh24:mi:ss') and last_...
asked by 14.06.2018 / 15:08
1
answer

SQL function with mySQL

I'm implementing a function for a vendor search field and my sql function is in trouble, would anyone know which problem? This was a function of when I used postgree, but now I'm using mySQL. package br.com.project.bean.geral; import java.la...
asked by 14.06.2018 / 04:29
1
answer

Write and Use images in database (Delphi and MySQL)

Hello, I would like to know how to write images (.jpg, .png, .bmp, etc) in the MySQL database using Delphi XE6. I would like to use TDBImage, if possible, to show the images already recorded in the database. Where it stores the image in MySQL is...
asked by 13.02.2018 / 17:54