Questions tagged as 'oracle'

1
answer

To display the day of the week of any date in the last 1,000 years

I used this command select to_char(to_date('18-apr-1972','dd-mon-yyyy'),'day') day from DUAL; but gave execution error: ORA-01841: ano (completo) deve estar entre -4713 e +9999 e não pode ser zero 01841. 00000 - "(full) year must be betw...
asked by 28.12.2016 / 22:37
1
answer

How to load data in CSV in Oracle SEM SQL Loader?

The data in a table has been exported to a CSV file and would like to import it into a table in the Oracle database. However I need it to be without the sqlldr command. Because this load will be done in Java, and I have restrictions on using SQL...
asked by 04.01.2017 / 11:05
1
answer

SOMAR STRING as DATE - Oracle

I have the TEMPO column with type STRING and I need to add the values as hours. I use all sorts of queries to do this sum, but I always fall into the field problem with DATATYPE DATE do not accept values larger than 23:59:59 ....
asked by 09.11.2016 / 05:49
1
answer

Ignore date / time field in group by

I have the following query: Select msi.segment1 codigo, msi.description descricao, pcn1.quantidade Qtde_Romaneio, nvl(SUM(pcn2.quantidade),0) Qtde_C...
asked by 13.09.2016 / 14:00
2
answers

How to do for loop in SQL SERVER?

BEGIN <<LOOP_EXTERNO>> FOR V_EXTERNO IN 1..20 LOOP DBMS_OUTPUT.PUT_LINE('Contador externo: ' || V_EXTERNO); <<LOOP_INTERNO>> FOR V_INTERNO IN 1..5 LOOP DBMS_OUTPUT.PUT_LINE('Contador interno: ' || V_INTERNO);...
asked by 26.10.2016 / 15:00
1
answer

Invalid Data Types

I am trying to create a table in my database, however it is giving error of invalid data types Script from my table: create table Venda ( cod_Venda number(5)not null, DataVenda DATE, Hora TIME, cod_Comanda number(5)not null, const...
asked by 17.10.2016 / 00:18
2
answers

How to add multiple decodes on the same line?

I need to group the decode fields in a same line some hint follows SQL SELECT DISTINCT iTG.GUI_NUMERO " NUMERO GUIA ", DECODE(itg.pro_tipo_procedimento,'MAT', sum(NVL(itg.GUI_VALOR_PAGO_CUS,0)) + sum(NVL(itg.GUI_VALOR_PAGO_FIL,0)) +...
asked by 06.10.2016 / 20:43
1
answer

How to set a maximum size for a BLOB field?

I want to insert images and I want each record to have a maximum of 100M, if this value is exceeded, an error must be returned in the bank itself. For illustration example of problem: (same as error is returned if we try to insert a string of...
asked by 25.05.2016 / 13:24
1
answer

Query to transform columns into records

I have a query that involves multiple tables in Oracle, and returns a large number of columns. I wanted to instead of returning the records from this query, I would return the select columns as records. An example of how more or less the curr...
asked by 01.07.2016 / 14:37
1
answer

Improving bank connection problem with Visual Studio

Hello, does anyone know if I have any way to find problematic code in C # related to opening and closing database connections? I have an application that after a few hours processing a load while executing a select generates an idle time error (...
asked by 18.10.2016 / 22:02