Questions tagged as 'pl-sql'

1
answer

How to compare two fields of identical values but different size?

I have a database where you have fields of the same name but with different sizes I need to choose the field with the largest VARCHAR. How can I do this?     
asked by 19.01.2018 / 15:13
1
answer

Help in SQL query ORACLE

Dependency column: T - Holder; And wife; F - Children; FA - Adoptive Son As per table above, how do I bring data only from ZIP codes that differ from Zip Code:    Owner Admilson has 2 children with a different cp, as well as   holder...
asked by 13.06.2017 / 22:47
2
answers

Arrays in the 'NOT IN' WHERE clause

DECLARE string_valor VARCHAR2(100); lista_array dbms_utility.lname_array; contador binary_integer; BEGIN SELECT t.campo_a INTO string_valor FROM tabela t WHERE t.campo_cod = 1; dbms_utility.comma_to_table ( list...
asked by 05.02.2015 / 14:13
1
answer

Join two Select

I am developing a report in PowerBuilder and would like to know how to merge results from two SQL queries into the report. If I add the function f_block_to_number in the first query and add the invoice table in from, the records multiply in the...
asked by 20.05.2014 / 18:36
1
answer

convert varchar to date oracle plsql

I need to convert a varchar to date so that I can filter all dates longer than a certain date, for example: I want all dates that are greater than November 2018 to be listed, I'm doing it as follows: DATA_FINAL > TO_DATE('1...
asked by 17.10.2018 / 16:48
1
answer

String length in PL / SQL

CREATE OR REPLACE FUNCTION TamanhoString(texto char(100)) RETURN NUMBER IS tamanho NUMBER; BEGIN tamanho := LENGTH(texto); RETURN tamanho; END TamanhoString; I need to create a function that receives text as a parameter and returns...
asked by 18.10.2018 / 01:39
1
answer

Problems to invoke / insert data with the procedure

I created this procedure in Oracle, but I am not able to insert data with EXEC . How I'm Declaring EXEC: EXECUTE SP_PRODUTO(8,'teste' 1); erro APRESENTADO: ORA-06550: linha 1, coluna 126: PLS-00306: número incorreto de tipos de argum...
asked by 27.09.2018 / 04:11
1
answer

Error with trigger and exception

The detail is that I'm trying to insert a post and trigger a trigger to save the message according to whether the post is inserted or not. The error is that I can not capture the exception. When I enter a record that already exists a pk, orac...
asked by 05.10.2018 / 03:13
1
answer

multiple tables in PL / SQL in a Cursor

I need to put the SELECT below to work inside a cursor, but I am not able to join the 3 tables, can someone help me? SELECT DISTINCT PROFESSOR.NOME, ESTUDANTE.NOME FROM PROFESSOR INNER JOIN SUPERVISIONA ON PROFESSOR.ID_PROF=SUPERVISIONA.ID_PR...
asked by 03.06.2018 / 21:46
2
answers

How to insert for all users in PLSQL when there is no data?

Good afternoon! I'm trying to insert all users when there is not a type entered for all users: INSERT INTO USUARIO ( TIPO, PRIORITARIO) SELECT '130', 'N' FROM dual WHERE not exists (SELECT * FROM USUARIO WHERE tipo = '130'...
asked by 30.05.2018 / 19:00