Questions tagged as 'plsql'

1
answer

Doubt about PL / SQL function

I wanted to know how to create a function that inserts data into a table. What value should I return ( return )? With a procedure I do it correctly, but when it comes to doing it with a function, I do not understand what value I should ret...
asked by 18.04.2017 / 19:56
2
answers

Error executing Cursor

When I execute the next SQL block, it tells me that I must declare the variable p_name, but I have declared it before. declare p_nombre varchar2(200) ; BEGIN FOR REG IN (select c1000 INTO p_nombre from edyficar.cl_clientes2...
asked by 17.04.2017 / 07:39
2
answers

PL / SQL: convert varchar to time to get difference later

I have saved in a table a varchar that represents a time, for example '23: 30 '. What I want to do is convert that value to time and then calculate the difference with respect to sysdate ... Will there be any way to do it? I con...
asked by 25.11.2016 / 05:59
2
answers

Request user data conditionally in PL / SQL

Problem Using the Oracle SQL Developer version 4.1.0.19 I am asking the user for data but the program asks me for more data than necessary, skipping the statements if and elsif . Code declare v_nombre varchar2(500);...
asked by 23.01.2016 / 17:24
1
answer

How can I group my records by name in Oracle PL / SQL

This is my SQL query as I could group by only the names to retrieve the Top of sold items SELECT A.ART_DESCRIPCION, SUM(VD.VD_CANTIDAD), SUM(VD.VD_TOTAL_GS) FROM VENTAS V, VENTAS_DETALLE VD, CLIENTE C, ARTICULO A WHERE V.VEN_NRO = VD.VD_NRO AN...
asked by 12.11.2018 / 15:01
2
answers

Concatenate several VARCHAR2 + 4000 characters

I request your collaboration to indicate how I can concatenate more than one VARCHAR2 in a SELECT , this VARCHAR2 has a more than 4000 characters therefore this error comes out: [Error] Execution (31: 64): ORA-01489: el res...
asked by 26.09.2018 / 16:49
1
answer

Trigger to avoid duplication of data in ORACLE

I'm learning Oracle and I had a problem. I have my Chat table: create table Charla ( id_charla number, codigo_usuario number, fecha_charla date, fecha_fincharla date ) Now, create a trigger so that it does not allow me to enter...
asked by 02.08.2018 / 00:03
1
answer

Problems with a trigger in ORACLE

I'm learning ORACLE and I create a trigger that after each insertion in the Commission table is added in the Pago_Com column from the table UEA em> which in turn is related to the table Guia_Transito and when I try to insert in the table...
asked by 25.06.2018 / 04:47
1
answer

Error Trigger AFTER DELETE

I have the following code: create or replace trigger calckmdl after delete on tsegmento for each row declare total rutas.km%type; begin if deleting then select km into total from rutas where ruta=:new.ruta; if :old.unidad = 'km...
asked by 26.06.2018 / 02:30
2
answers

FOR loop with hops in PLSQL

I have to do an exercise that is a for loop but delimiting the minimum the maximum and the jump, the thing is that both the minimum and the maximum is done but the jump is not how to define it, I hope someone helps me. I leave you my exercise...
asked by 08.05.2018 / 11:31