HOW TO
This article describes how to set up a non-geodatabase table for publishing as a feature service and subsequent editing.
To enable editing of feature services that have been created from Oracle non-geodatabase tables, the following steps must be followed, paying particular attention to the sequence name and the trigger name. For these steps, user TEST is being used to created the table.
SQL> create table testtab (id number(38) not null, data varchar2(10), geom sdo_geometry); Table created.
SQL> insert into user_sdo_geom_metadata values ('testtab', 'geom', SDO_DIM_ARRAY(SDO_DIM_ELEMENT('', -180, 180,0.005), SDO_DIM_ELEMENT('',-90, 90, 0.005)), 4326); 1 row created.
SQL> insert into testtab values (1,'test',sdo_geometry(2001, 4326, sdo_point_type(10,10,null), null, null)); 1 row created. SQL> create index testtab_indx on testtab(geom) indextype is mdsys.spatial_index; Index created. SQL> commit; Commit complete.
SQL> desc testtab; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER(38) DATA VARCHAR2(10) GEOM PUBLIC.SDO_GEOMETRY
SQL> CREATE UNIQUE INDEX TEST.TESTTABINDX ON TEST.TESTTAB ( "ID" ); Index created.
SQL> ALTER TABLE TESTTAB ADD UNIQUE (ID); Table altered.
Note: This is a required step
SQL> COMMENT ON COLUMN "TEST"."TESTTAB"."ID" IS 'ESRI auto-incrementing'; Comment created.
SQL> select object_id from all_objects where owner = 'TEST' and object_name = 'TESTTAB'; OBJECT_ID ---------- 78484 SQL> CREATE SEQUENCE TEST.SEQ_78484 MINVALUE 1 MAXVALUE 2147483647 INCREMENT BY 1 START WITH 7 NOCACHE NOORDER NOCYCLE ; Sequence created. SQL> CREATE OR REPLACE TRIGGER TEST.BIFER_78484 BEFORE INSERT ON TEST.TESTTAB FOR EACH ROW DECLARE BEGIN IF :NEW.ID IS NULL THEN :NEW.ID := SEQ_78484.NEXTVAL; END IF; EXCEPTION WHEN OTHERS THEN RAISE; END; / Trigger created.
SQL> grant select on seq_78484 to gdb; Grant succeeded.
SQL> grant select,insert,update,delete on testtab to gdb; Grant succeeded.
Article ID: 000012057
Get help from ArcGIS experts
Download the Esri Support App