-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths-16-p-insercion-de-logs-pruebas.sql
More file actions
75 lines (71 loc) · 1.88 KB
/
s-16-p-insercion-de-logs-pruebas.sql
File metadata and controls
75 lines (71 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-- Autor: Tepal Briseño Hansel Yael y Ugartechea González Luis Antonio
-- Fecha: 08/12/2024
-- Descripción: Pruebas que validan el funcionamiento del procedimiento p_insercion_de_logs
set serveroutput on
declare
v_file utl_file.file_type;
v_operacion operaciones_temp%rowtype;
v_contador number;
begin
begin
dbms_output.put_line('Caso 1: Insertando registros en la tabla operaciones_temp');
insert into operaciones_temp(
operaciones_temp_id,
usuario,
accion,
tabla_afectada,
detalle_accion,
valor_anterior,
valor_nuevo
) values(
40,
'Hansel',
'INSERT',
'USUARIOS',
'Se inserto un nuevo usuario',
null,
'valor_nuevo'
);
insert into operaciones_temp(
operaciones_temp_id,
usuario,
accion,
tabla_afectada,
detalle_accion,
valor_anterior,
valor_nuevo
) values(
41,
'Luis',
'UPDATE',
'USUARIOS',
'Se actualizo un usuario',
'valor_anterior',
'valor_nuevo'
);
insert into operaciones_temp(
operaciones_temp_id,
usuario,
accion,
tabla_afectada,
detalle_accion,
valor_anterior,
valor_nuevo
) values(
42,
'Hansel',
'DELETE',
'USUARIOS',
'Se elimino un usuario',
'valor_anterior',
null
);
p_insercion_de_logs;
dbms_output.put_line('Registros insertados correctamente');
exception
when others then
dbms_output.put_line('Error al insertar registros: ' || sqlerrm);
end;
end;
/
rollback;