Questions tagged as 'sql'

0
answers

Validate when executing a PHP query

I have a problem trying to validate 2 quantities before doing an update. In a table I have 2 columns, I send data of a product through a POST with which it makes update to the table, but I have to validate that quantity 1 is equal to quantity...
asked by 26.04.2018 / 09:33
1
answer

Show image stored in SQLServer in an ImageView (Java, Android Studio) [closed]

I'm doing an application on android with sql server and I do not know how to create the function ByteToImagen in java, that is in c # and vb.net had a function that I used to take the string of bytes [] stored in the image field of sql server, I...
asked by 26.04.2018 / 09:27
1
answer

reference field generated in stored procedure sql server

I'm doing a stored procedure, to add some data to a report in crystal reports. I'm doing the following: (df.valor_unitario * df.cantidad) as vtotality, /*realiza la operacion y el resultado lo muestra en el campo vtotality */ (select sum(vtota...
asked by 24.04.2018 / 18:13
1
answer

Help with field Balance in a table type view

I have a table with these fields: I need to create a table of type view where there is an additional column called Balance. The function of this column is to add or subtract the value of the column amount based on whether the value of N...
asked by 24.04.2018 / 17:39
2
answers

Problem with inner join sql

I'm going crazy, I've tried several databases and it does not work to see if you can help me. select 'Tienda.Codigo_de_barras' from "Tienda" inner join "Online" on 'Tienda.Codigo_de_barras' ='Online.Codigo_de_barras'; The code consists of...
asked by 21.04.2018 / 19:48
0
answers

Perform SQL query (access) that delivers a record of multiple lines

query can help me in an sql query that I'm running in access, as the image shows, the idea is to leave only one line with the fields that are visible. In the image there are 2 numbers of cpbnum and the idea is to summarize them as they appear in...
asked by 20.04.2018 / 01:02
0
answers

Postgres - SQL state: 22P02

In the following query: SELECT t1.codigo FROM tabla1 AS t1 INNER JOIN tabla2 AS t2 ON t1.codigo = t2.codigo WHERE CASE WHEN POSITION( '-' IN t1.codigo ) = 0 THEN CAST((t1.codigo) AS INTEGER) ELSE CAST(SUBSTRING( t1.codigo,...
asked by 19.04.2018 / 17:12
0
answers

Insert information in a MySQL table that contains a foreign key

The invoices table is linked to the provider table by the provider_id field, but when I insert data, I get a foreign key error, and tried in CASCADE, RESTRIC etc mode and it does not work, validate that the IDs of the tables be primary keys, the...
asked by 21.04.2018 / 03:56
0
answers

Expression in cognos 10.2.2

I want to run this expression in cognos 10.2.2 and it is giving me an error. Please Who can help me solve it? The error is as follows:    An analysis error has occurred before or near position 162. IF([MES]=MONTH(GETDATE()-1)) THEN...
asked by 19.04.2018 / 22:04
0
answers

Spring batch: [SQLITE_BUSY] The database file is locked (database is locked)

I'm doing a Batch that reads SQLite data and transforms it into CSV But every time I run the program it shows the same exception  "[SQLITE_BUSY] The database file is locked (database is locked)" The method that reads the data: @Bean Item...
asked by 17.04.2018 / 20:44