Questions tagged as 'oracle'

3
answers

How to declare a cursor type variable in PL-SQL?

I have a course: Cursor Pessoa is Select nomeFuncionario From empresa; -- Variaveis para uso da rotina variavel How would the variable be?     
asked by 31.01.2018 / 21:08
1
answer

Decode function e (+)

Problem: Resolution:SELECTNOME,DECODE(COUNT(CODIGO_LIVRO),0,'NENHUM',COUNT(CODIGO_LIVRO))"NR LIVROS" FROM AUTORES A,LIVROS L WHERE A.CODIGO_AUTOR=L.CODIGO_AUTOR(+) GROUP BY NOME ORDER BY 1; Tables: You can not reply to this topic...
asked by 17.12.2017 / 19:05
1
answer

How do I save an image on a path by searching from an Oracle database?

I'm trying with the PHP GD library, like this: <?php $con = oci_connect('root', '123', '172.16.1.100/DB'); $stmt = oci_parse($con, "SELECT Nome, Imagem FROM Tabela where ID = '1'"); oci_execute($stmt); $row = oci_fetch_array($stmt, OCI_ASS...
asked by 30.07.2018 / 22:47
1
answer

How to declare "nullable" parameters in an Oracle procedure?

I need my procedure to accept null values in some parameters of type Number. How do I do this in PL / SQL? Currently: PROCEDURE SP_EDITAR_QUADRO( P_IDQUADRO IN NUMBER, P_IDFUNC IN NUMBER, P_IDTRAB IN NUMBER ); ... I need the...
asked by 16.11.2017 / 18:43
1
answer

Copy of Oracle Material Structure

We have the following material registration structure: Table Pk FK Filial Descricao material Group Cod_grupo 1 - 1 Materiais de escritório 2 -...
asked by 23.05.2017 / 18:50
1
answer

USING PIVOT ORACLE

I have this result:    Ana DEC 123 7 2016 1GG       Ana DEC 123 3 2016 1GG       Ana DEC 123 3 2016 1GG       Ana JCM 123 5 2017 1GG       Edson DES 123 11 2016 1GG       Edson DES 123 3 2017 1GG I'm using this PLSQL: SELECT *...
asked by 28.07.2017 / 17:12
2
answers

Create trigger for sequence in primary key

I have the following table in oracle: host table id_hospede nome login senha rg cpf telefone sequence: create sequence seq_hospede_1 start with 1 increment by 1 maxvalue 1000 minvalue 1 nocache cycle; trigger: CREATE...
asked by 11.11.2016 / 17:33
1
answer

SP2-0552: Bind variable "19" not declared

I am using Oracle SQL Developer to terminate a project, when the database was popular, the software accused an error in the following line: INSERT INTO musica (cod_musica, data_composicao, titulo, duracao) VALUES (11111, '1993/01/01', 'Fênis',...
asked by 22.12.2016 / 20:49
1
answer

Is there any function to calculate the trend line in PL SQL?

Good morning everyone. I need a function to calculate a trend line. I have a query (part of the function): select round(sum(nvl(vl_indice, vl_meta))/12, 2) from ( SELECT SUM (vl_indice) vl_indice, SUM (vl_meta) vl_meta FROM (SELECT cd_mes...
asked by 11.05.2016 / 16:29
1
answer

Saturation of foreign keys?

After a long time with non-relational database I decided to go back and I came across a strange situation. My application is a simple chat where this chat has sub rooms. I made a small demonstration: I need the user id in the room to kn...
asked by 03.05.2016 / 15:13