Questions tagged as 'sql'

0
answers

Insert SQL Server Column receives no value

I'm trying to insert into a simple table, but a field of it, is not saving the value I'm passing to it, and the strangest thing is that all other columns get right. Example INSERT TabelaExemplo (id, nome, outroId) values (1,'Gabriela', 2) I...
asked by 02.05.2017 / 15:22
1
answer

SQL Report Builder 3.0 Merge Rows into a Totalizer column

Considering a simple query where you bring a list of people containing your name, code and your age, I would like the last number of the right column to appear in the sum of the ages according to the image (in this example I consider that each o...
asked by 02.05.2017 / 15:56
1
answer

Export DESCRIBE TABLE from Postgres to txt

Is it possible to generate a .txt file with the DESCRIBE TABLE from a table in Postgres by PHP? I need to download a .txt file with the description of the fields (name, type, character size) of the table where the query is being made.     
asked by 02.05.2017 / 15:09
0
answers

Convert NVARCHAR to NUMERICO

I have a table that has a VALUE column, but the column is in nvarchar, this nvarchar column does not let me do the correct formatting in the report I'm using select. I can do the conversion in SQL Server for the money type, but it is not in t...
asked by 27.04.2017 / 21:52
2
answers

Return primary key after insertion in MySQL

I need to insert two tables into my database, one of the tables has a primary key and the other one will use that value as a foreign key. My question is: How can I return the value of this primary key at the time of insertion? Or how can I do...
asked by 28.04.2017 / 05:29
1
answer

Update and maintain update code when it is repeated

I've made this update: declare @rx_num varchar(20), @id_oit_max int, @id_exm_rea int, @id_xfc_novo int, @id_xfc int = 0 declare oit_cur cursor for select pl.rx_num, er.id_exm_rea, er.id_xfc from t_cmo_planilha_leitura pl inner join T_CMO_EXA...
asked by 26.04.2017 / 23:39
1
answer

Condition (if) does not work to insert data

I made this query to insert data. I should only enter data if there is nothing in the OIT1980 table. Then I mounted a cursor and ran and put an IF. If I remove the IF, it works, but if I leave it there, I do not know if the way I compare is corr...
asked by 24.04.2017 / 21:03
0
answers

PHP form data does not enter the database

Hello, I'm new to PHP and I'm doing a small scheduling page but I've stuck in the data insertion part of the database, below my codes: Index.php <html> <head> <title> Controle de Coleta </title> <link rel="st...
asked by 24.04.2017 / 18:31
0
answers

Find columns from two tables that are not directly related

I have 5 tables: cliente , produto , compra , compra_produto and fornecedor . And the following relationships: compra (fk_cliente) compra_produto (fk_compra) compra_produto (fk_produto) produto (fk_fornecedor...
asked by 23.04.2017 / 02:20
2
answers

php- upload image and upload to database

I'm trying to insert an image into the database but when I click upload image, it gives the following error: Warning: getimagesize (): Filename can not be empty in /home/unn_w17015779/public_html/upload.php on line 9 File is not an image.; HT...
asked by 21.04.2017 / 18:01