Questions tagged as 'oracle'

1
answer

PLSQL displays error: PLS-00487: Invalid reference to variabel

I have a PLSQL code: in which I get two values one numeric and another varchar. Code: create or replace FUNCTION hospitalTeste123(MatriculaMedico in number, nomeSchema in varchar2 ) return varchar is type Tmedicos is record( matM...
asked by 14.05.2018 / 21:28
1
answer

Can not put result in SQL table

I want to put the result of this equation there where it is 'RESULT1' already tried to do result1 = x More did not work, I have little experience with SQL yet; SELECT (VA * VB) / VC FROM (SELECT 5 AS VA, 10 AS VB, 5 AS VC, X AS RE...
asked by 12.02.2018 / 01:32
2
answers

Replace the second repeated character

I have the following value in an Oracle query. SELECT '3.0.' FROM DUAL I would like it to return only 3.0 and remove the Last Point (.) I tried using REGEXP_REPLACE like this: SELECT REGEXP_REPLACE('3.0.','(.){2,.}','') FROM DUAL...
asked by 15.02.2018 / 16:01
1
answer

In pl-sql can I assign the SUM value to a variable?

In the system you have a% variable of% that should receive the total value of the sum of the Values column. How can I assign the sum value vsoma ?     
asked by 24.01.2018 / 14:10
1
answer

In PL-SQL how to partially sum a value?

I have to add the value partially the values of a category (goes the code in below) DECLARE --VARAVEIS CURSOR CPRODUTO IS SELECT * FROM PRODUTO_TESTE2; VPRODUTO PRODUTO_TESTE2%ROWTYPE; Vsoma real; BEGIN Vsoma := 0; FOR VPRODUTO IN CPRODUTO...
asked by 24.01.2018 / 14:51
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
3
answers

How do I meet the first Tuesday of a month ?! (SQL)

I am performing the following exercise: Thetablesareasfollows: I already have the following code: SELECT NOME FROM CLIENTES C,VENDAS V, LIVROS L WHERE V.CODIGO_CLIENTE=C.CODIGO_CLIENTE AND L.CODIGO_LIVRO=V.CODIGO_LIVRO AND TO_NUMBER(...
asked by 14.12.2017 / 16:59
2
answers

If it does not fit on the div, show: more X results

I need to solve the following problem: I have a div that displays a list of names that are loaded according to a query condition. This list of names varies a lot, sometimes it appears 5, sometimes 30 names appear. I need to limit the di...
asked by 20.12.2017 / 16:05
1
answer

Trigger to update stock

I'm trying to create a trigger to update my product inventory, when the status of my purchase is closed (CF = Buy Closed). However, it is giving me an error, and I could not identify what is causing this error to be generated. Anyone h...
asked by 23.08.2017 / 23:30
2
answers

Ensure random sorting of query result

I have the following query, which I use to verify valid IP's of collectors in the network for distribution of items for separation: Select distinct IP, USUARIO, trunc(DATA) from PCN_ROMANEIO_ACESSO PRA Where pra.STATUS = 'OK' AND trunc(pra....
asked by 21.07.2017 / 14:22