-- Los datos que hay que introducir en esta plantilla son:

-- UUID-DEL-PLUGIN

-- NOMBRE-DEL-PLUGIN


SET DEFINE OFF;
DECLARE
    existegeoperfil int;
BEGIN
    SELECT count(*) into existegeoperfil FROM GRADG_GEOPERFIL WHERE C_UUID = 'UUID-DEL-GEOPERFIL';
     
    IF existegeoperfil = 0 THEN
        INSERT INTO GRADG_GEOPERFIL
            (ID_GEOPERFIL, D_DESCRIPCION, C_UUID, L_SECURIZADO, C_CREADOR, F_CREACION, C_MODIFICADOR, F_MODIFICACION)
        VALUES
            (GRADG_SEQ_GEOPERFIL.nextval, 'NOMBRE-DEL-PLUGIN', 'UUID-DEL-PLUGIN', 'N', 'GRADGPRMG', SYSDATE, 'GRADGPRMG', SYSDATE);
    END IF;
END;
/
COMMIT;
/
 
DECLARE
    b_blob blob;
    str varchar(32767);
BEGIN
    b_blob := Empty_Blob();
    UPDATE gradg_geoperfil
    SET b_geoperfil = Empty_Blob()
    WHERE c_uuid = 'UUID-DEL-GEOPERFIL'
    returning b_geoperfil into b_blob;
 
str := utl_raw.cast_to_raw('
');
 
dbms_lob.writeappend(
    b_blob,
    utl_raw.length(str),
    str
);
 
str := utl_raw.cast_to_raw('
');
 
dbms_lob.writeappend(
    b_blob,
    utl_raw.length(str),
    str
);
 
END;
/
 
DECLARE
    b_blob blob;
    str varchar(32767);
BEGIN
    b_blob := Empty_Blob();
    UPDATE gradg_geoperfil
    SET b_mapv = Empty_Blob()
    WHERE c_uuid = 'UUID-DEL-GEOPERFIL'
    returning b_mapv into b_blob;
 
str := utl_raw.cast_to_raw('
');
 
dbms_lob.writeappend(
    b_blob,
    utl_raw.length(str),
    str
);
 
str := utl_raw.cast_to_raw('
');
 
dbms_lob.writeappend(
    b_blob,
    utl_raw.length(str),
    str
);
 
END;
/
 
DECLARE
    b_blob blob;
    str varchar(32767);
BEGIN
    b_blob := Empty_Blob();
    UPDATE gradg_geoperfil
    SET b_wms = Empty_Blob()
    WHERE c_uuid = 'UUID-DEL-GEOPERFIL'
    returning b_wms into b_blob;
         
str := utl_raw.cast_to_raw('var predefServersArray = [];');
     
dbms_lob.writeappend(
    b_blob,
    utl_raw.length(str),
    str
);
 
END;
/
COMMIT;