Store procedure oracle with several queries at the same time

0

Hi, I want to run 2 queries on 2 different tables with a single store procedure.

    BEGIN
        UPDATE personal
        SET imei_equipo = v_imei WHERE PERSONAL_ID = v_personal_id;
    BEGIN
        UPDATE lugar
        SET latitud = v_latitud SET longitud=v_longitud WHERE LUGAR_ID = v_lugar_id;

        COMMIT;

Something like that but that works hahaha Pd > a single query if it works for me

    
asked by Alexis Granja 03.02.2017 в 21:09
source

1 answer

2

The problem with your example is that you have several begin . You only need one:

create procedure procname as
begin
    UPDATE personal
       SET imei_equipo = v_imei WHERE PERSONAL_ID = v_personal_id;

    UPDATE lugar
       SET latitud = v_latitud SET longitud=v_longitud WHERE LUGAR_ID = v_lugar_id;

    commit;
end;
/
    
answered by 03.02.2017 в 21:12