Procidure includ not duplicate [message #653385] |
Mon, 04 July 2016 08:58 |
|
rkled
Messages: 1 Registered: July 2016
|
Junior Member |
|
|
Please, help me on this cod.
I need to implement a procedure that inserts data into a table, if you mistake for 'AG' existing, will return an error with the description that I put in the exception.
create or replace PROCEDURE MY_PROC_01
(
T_DATA VARCHAR2,
T_NAME VARCHAR2,
T_TURN VARCHAR2,
T_AG VARCHAR2
)
IS
BEGIN
INSERT INTO TESTETAB (DATA, NOME, TURNO, ID, ALGO) VALUES (T_DATA, T_NAME, T_TURN, TESTTAB_SEQ.nextval,T_AG);
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE('ERRO!');
END;
Thanks!!
|
|
|
|
|
|