Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
-- creo tabella
CREATE TABLE "pti_quadri_elettrici"
"pk_uid" integer PRIMARY KEY autoincrement NOT NULL,
"data_ril" date,
"nome_quadro" text,
"path_quadro" text
--aggiungo colonna geometry
SELECT AddGeometryColumn ('pti_quadri','geom',3003,'POINT','XY'
-- creo una view
create view "v_nome_quadri" as
select q.pk_uid as rowid, q.nome_quadro, q.geom as the_geom
from "pti_quadri_elettrici" q;
-- registro spatiali_view
INSERT INTO views_geometry_columns
(view_name, view_geometry, view_rowid, f_table_name, f_geometry_column, read_only)
VALUES ('v_nome_quadri', 'the_geom', 'rowid', 'pti_quadri_elettrici', 'geom',1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment