Consulta sobre PL/SQL
Publicado por dani (1 intervención) el 16/05/2010 19:10:45
Hola,
tengo una duda sobre PL/SQL
Tengo que hacer un insert en una tabla. Antes de hacer el insert en la tabla, tengo que mirar si algunos valores que se pasan al insert existen o no otras tablas. ¿Que estructura tendria que tener el PLSQL? ¿Seria esta estructura correcta?
Begin
begin
select ..... into ..... from ......;
exception
when no_data_found
when other
end;
begin
select ..... into ..... from ......;
exception
when no_data_found
when other
end;
begin
insert
exception
when other
end;
end;
/
Gracias
tengo una duda sobre PL/SQL
Tengo que hacer un insert en una tabla. Antes de hacer el insert en la tabla, tengo que mirar si algunos valores que se pasan al insert existen o no otras tablas. ¿Que estructura tendria que tener el PLSQL? ¿Seria esta estructura correcta?
Begin
begin
select ..... into ..... from ......;
exception
when no_data_found
when other
end;
begin
select ..... into ..... from ......;
exception
when no_data_found
when other
end;
begin
insert
exception
when other
end;
end;
/
Gracias
Valora esta pregunta


0