create or replace TYPE AABSPARC_PSR_REC FORCE AS OBJECT ( 
CAMPAGNA NUMBER,
CUAA VARCHAR2(100),
ID_ATTO_AMMI number,
ID_SCHEDA varchar2(100),  
ID_PARC number,           
ID_INTE number,
SUPERFICIE number,        
SHAPE MDSYS.SDO_GEOMETRY,  
COD_COLT VARCHAR2(100) );
/ 
create or replace TYPE AABSPARC_PSR_COL AS TABLE OF AABSPARC_PSR_REC;
/ 
CREATE PUBLIC SYNONYM AABSPARC_PSR_REC FOR AABSPARC_PSR_REC;
/
CREATE PUBLIC SYNONYM AABSPARC_PSR_COL FOR AABSPARC_PSR_COL;
/

CREATE  TABLE AABSPARCPSR_TAB (
ID_ORPA	NUMBER	,
ID_INVIO	NUMBER	,
CAMPAGNA	NUMBER	,
CUAA	VARCHAR2(16)	,
ID_ATTO_AMMI	NUMBER	,
ID_SCHEDA	VARCHAR2(100)	,
ID_PARC	NUMBER	,
ID_INTE	NUMBER	,
SUPER_PARC	NUMBER	,
SHAPE	        CLOB	,
PRG_PARC	NUMBER	,
DATA_INS	Date	,
constraint AABSPARCPSR_TAB_PK
		primary key(PRG_PARC,ID_ORPA));
/
CREATE PUBLIC SYNONYM AABSPARCPSR_TAB FOR AABSPARCPSR_TAB;
/

CREATE TABLE AABSAPAGPSR_TAB (
ID_INVIO	NUMBER	,
ID_ATTO_AMMI	NUMBER	,
ID_PARC	NUMBER	,
COD_COLT	VARCHAR2(100)	,
ID_ORPA	NUMBER	,
PRG_PARC	NUMBER	,
DATA_INS	DATE,
constraint AABSAPAGPSR_TAB_PK
		primary key(PRG_PARC, COD_COLT, ID_ORPA));
/

CREATE PUBLIC SYNONYM AABSAPAGPSR_TAB FOR AABSAPAGPSR_TAB;
/	

CREATE SEQUENCE  AABS_DG_INVIO  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 100 NOORDER  NOCYCLE ;
/

