Questions tagged as 'sql'

2
answers

SQL - How to select or delete a column with a value of null in a query select

I have a table in a MySQL bd that has 5 fields. This would be a template query: select * from myTable where campo1= 4 and campo2=1 and campo3 =7. However, field3 may have null value and I would need to select or exclude combinations that in...
asked by 24.05.2016 / 21:52
2
answers

Read an Array or Bulk Collect as a table in an Oracle PLSQL

How do I load an Array or Bulk into a PLSQL and then read this as a table. Example DECLARE VA_ARRAY ....DEFINIÇÃO DO ARRAY VN_QTD NUMBER; BEGIN -- TABELA01 É UMA TABELA FÍSICA EXISTENTE NO BANCO SELECT * BULK COLLECT INTO VA_ARRAY F...
asked by 25.05.2016 / 18:31
2
answers

How to stop database query using time out in hibernate?

I'm developing an application that queries a gigantic database, so I'd like to maintain its integrity by allowing Hibernate to query up to 30 seconds. In the face of this problem, what would be the best way to solve it?     
asked by 19.02.2016 / 17:58
2
answers

Error converting decimal value in Insert C #

I have an insert that receives some parameters, but at the moment that the sql statement is giving this conversion error:    Error converting data type varchar to numeric. //http://localhost:7630/api/AspNetWebApi/cadastrar/jogo/451...
asked by 06.01.2016 / 15:19
2
answers

Exporting FireBird data

I have a client registration program connected to Firebird, however I will no longer use this program and need the data. Would you like me to get the file database.fbd, which I'm afraid you are all registered and generate some excel or something...
asked by 20.12.2015 / 22:47
2
answers

Function with return using 'case when'

I have a function that returns me the status of a request (in the database it's int) that only has two possible values, 0 (inactive), 1 (active). I was trying to increment it with 'case when' in case the result is 0 it returns 'Inactive Request'...
asked by 04.01.2016 / 13:57
1
answer

How to re-assign colunda ID again?

I have a table for example | ID | NOME | | 2 | Ana | | 7 | João | | 15 | Vera | The ID column is ID int NOT NULL AUTO_INCREMENT, What do I need to get? I want the column to be | ID | NOME | | 1 | Ana | | 2 | Jo...
asked by 26.12.2015 / 22:26
3
answers

How to compare data encrypted with crypt

Hello, I'm trying to learn how to encrypt data. I created a php code to save the data in the mySQL database and another to compare the user input data with the database. To encrypt I used the crypt() function. The problem...
asked by 30.12.2015 / 19:06
1
answer

How do I set a primary key to an existing table in Oracle?

I usually do it directly through the IDE (Sql Developer), but I need to run the script this time. Assuming the existing table TB_CR_INDICADOR_PERIODO and column COD_CR_INDICADOR_PERIODO as the unique ID column, how could I set t...
asked by 11.05.2016 / 21:40
2
answers

Increment a number in a SQL query

I have the query that returns me the results. I would like to add an incremental number to show the records from 1 to the end as if it were a new column. select *, sum(valor) as ValorSoma, count(pedido) as QtdPedido from tb_vendas where idvend...
asked by 12.04.2016 / 21:48