Questions tagged as 'oracle'

1
answer

Dynamic access oracle cursor column

I have a situation where I need to access the attributes of a cursor differently. I have a cursor that returns me a list of records, with columns like col_1, col_nova, col_teste (illustrative names). I loop this cursor to fit a return string....
asked by 06.07.2016 / 21:22
1
answer

SQL: Can I have clauses in GroupBy that do not appear in Select?

I know that I can not have clauses in the select that do not appear in Group By. But is it possible otherwise? For example: Select B From Table Group By A,B     
asked by 10.05.2015 / 03:36
2
answers

Multiple Schemas in an Oracle Owner

Hello, I have a question at a time and I do not find a definitive answer: Can I have multiple schemas in an oracle owner? Ex: Owner: Renan Schemas: Indicators Alert Etc Tables: renan.Indicadores.tb_rend_acum_test...
asked by 10.03.2015 / 19:41
1
answer

Check if CONSTANT exists in the Package

I have a Package: CREATE OR REPLACE PACKAGE LETRAS AS possuiA CONSTANT BOOLEAN NOT NULL := TRUE; possuiB CONSTANT BOOLEAN NOT NULL := TRUE; possuiC CONSTANT BOOLEAN NOT NULL := TRUE; possuiD CONSTANT BOOLEAN NOT NULL :=...
asked by 21.10.2014 / 22:40
1
answer

How to obtain via IN the records found and not found

I have a simple command SELECT MATRICULA FROM ALUNOS WHERE ID_ALUNO IN (1,2,3,4,5,6) I would like to know how to get a result like this in SQL: ID | STUDENT 1 | LUIZ 2 | MARIA 3 | 4 | JOHN 5 | CARLOS 6 | That is, bri...
asked by 07.11.2014 / 13:43
1
answer

Error PLS-00324 when creating Package Body

When compiling the Package Body below, I was returned the following error:    Error (16,8): PLS-00324: cursor attribute can not be applied to non-cursor 'V_CD_ESTADO' What implied is that the attribute returned by the cursor can not be as...
asked by 07.03.2014 / 23:27
1
answer

Database changing accent by "?"

In my PL / SQL all accents are being replaced by "?". Example of a comment from a table:    Flag of legal device to be ???? used in the term of business or not. Possible values: 1 - Yes or 0 - No. Default: 1 When I create a table direc...
asked by 01.11.2018 / 14:52
1
answer

last_insert_id oracle

I have a question about oracle bank. I created two tables and set one of them with a field with foreing key (see below FK) tbl_city * id_city * (PK and auto increment) - generated with sequence since we do not have auto_increment in orac...
asked by 15.02.2014 / 13:42
1
answer

Select with two fields as FKs of the same table

I would like to know how to mount a select in Oracle to exit the names of teams that participated in a game, using the structure below: Hereisthecodeforcreatingthetable: Code for creating the table I think the output would be some...
asked by 28.11.2018 / 02:34
3
answers

I can not sum the column

I want to sum the Value column, I know that in order to use SUM () I have to use GROUP BY as well, but I can not do the summation. I do not know what fields I have to put in GROUP BY. SELECT DISTINCT z.sales_office AS kam, z.customer,g.sales_o...
asked by 25.09.2018 / 14:44