Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.66 KB | None | 0 0
  1. -- cr_spatial_index.sql
  2. --
  3. -- Note: if geometries do not span more than 1 row, you can remove
  4. -- the DISTINCT qualifier from the SELECT statement
  5. --
  6. DECLARE
  7.    CURSOR c1 IS SELECT DISTINCT sdo_gid FROM POLYGON_SDOGEOM;
  8.    gid NUMBER;
  9.    i NUMBER;
  10. BEGIN
  11.      i := 0;
  12.      FOR r IN c1 LOOP
  13.        BEGIN
  14.         gid:= r.sdo_gid;
  15.         sdo_admin.update_index_fixed('POLYGON', gid, 15, FALSE, FALSE, FALSE);
  16.         EXCEPTION WHEN OTHERS THEN
  17.           DBMS_OUTPUT.put_line('error for gid'||TO_CHAR(gid)||':  '||SQLERRM );
  18.        END;
  19.        i:=  i + 1;
  20.        IF i = 50 THEN
  21.           COMMIT;
  22.           i:= 0;
  23.        END IF;
  24.      END LOOP;
  25. COMMIT;
  26. END;
  27. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement