CREATE OR REPLACE FORCE VIEW AB39A.AB3901V00 
(
	ID,
	ID_PROVINCIA,
	DESC_OF,
	ID_AUTONOMIA
) AS 
SELECT 1, ID, DS_O,AUTONOMIA_ID FROM T17I.T17_PROVINCIA WHERE AUTONOMIA_ID = 16
UNION ALL
SELECT 2, ID, DS_O,AUTONOMIA_ID FROM T17I.T17_PROVINCIA WHERE AUTONOMIA_ID != 16
ORDER BY 1, DS_O;
   
 
   
CREATE OR REPLACE FORCE VIEW AB39A.AB3902V00
(
   ID_MUNICIPIO,
   ID_PROVINCIA,
   DESC_OF
)
AS
   SELECT ID, PROVINCIA_ID, DS_O FROM T17I.T17_MUNICIPIO;
   
    

CREATE OR REPLACE FORCE VIEW AB39A.AB3903V00
(

   ID_LOCALIDAD,
   ID_MUNICIPIO,
   ID_PROVINCIA,
   DESC_OF

)
AS
   SELECT ID, MUNICIPIO_ID, PROVINCIA_ID, DS_O  FROM T17I.T17_LOCALIDAD;
   
   
COMMIT;
exit;