Last active
February 2, 2019 14:04
-
-
Save pigreco/64afa98f2aef3aef38047a232234f587 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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