Acronym for Structured Query Language. A syntax for retrieving and manipulating data from a relational database.

learn more… | top users | synonyms

0
votes
0answers
9 views

Failure of non existant SQL statement after executing statements from a file with ArcSDESQLExecute object

As you see in my code I iterate and execute all the sql statements in an sql file using ArcSDESQLExecute object. It does work but when all statements have been executed the object returns 'None' ...
1
vote
1answer
364 views

How to import .csv file to CartoDB using SQL?

How to import .csv file to CartoDB using SQL, the data given below : POINT | TOP_dm | BOTTOM_dm | X_RD | Y_RD 35AP7600 | 4418 | 4368 | 262053 | 467223 35AP7601 | ...
1
vote
1answer
363 views

How do you create a CartoDB viz with a dynamic SQL statement?

I want to create a CartoDB viz where the where parameter in my SQL statement changes dynamically at runtime. When I share my CartoDB viz from the dashboard, I can't help but notice the the SQL ...
0
votes
1answer
17 views

Redirect if Clicked on a Marker in CartoDB

How can the user be redirected if he clicks on a marker in CartoDB? I have a dataset with the markers — the geometry and inside of the description-field the URL to redirect the user. I know I can ...
1
vote
1answer
256 views

SQL-query should return GeoJSON FeatureCollection

I'm trying to return a GeoJSON FeatureCollection object from a SQL-query with PostgreSQL 9.3 and PostGIS 2.1. This is my query so far: SELECT row_to_json(fc) AS p FROM (SELECT 'FeatureCollection' ...
1
vote
2answers
190 views

adding geometries to a source, target table for multiple rows in pgrouting

I am having an issue trying to perform the pgr_dijkstra algorithm and getting back a line in my table for multiple rows. I have a table that has a columns of source, target node id's but I cannot ...
0
votes
1answer
42 views

Definition Query to find next date value in ArcSDE attribute table?

I have an ArcSDE feature class that contains a date field called "SALE_DATE". This sale date represents the bid date for ALberta crown mineral rights sales. A sale occurs about twice per month (one ...
1
vote
0answers
18 views

User Permissions on ArcSDE Geodatabase in SQL Server 2012

We set up an enterprise geodatabase in SQL Server 2012; Is it possible to set user permissions at a feature class/table level to only view certain attribute types? For example, a pipe layer has ...
1
vote
1answer
50 views

Split a table of Multi/Linestrings into Unique Linestrings

Is there an efficient way to split a table of Multi/Linestrings that overlap() and touch() into unique Linestrings (note: creating edges using topology is going very...very...very slow). Here is ...
1
vote
1answer
32 views

Select ID by most recent date

I have a personal GDB table that has a non-unique SLID field and a date field. Basically there are multiple records with the same SLID numbers but different dates. I want to select only the most ...
0
votes
1answer
209 views

CartoDB layer selector - selecting data from 2 layers

I used the CartoDB layer selector example (http://cartodb.github.io/cartodb.js/examples/layer_selector.html) with my data. Works fine. Now, what I really want to do is to select data from 2 layers at ...
2
votes
1answer
407 views

SQL Server UNion of geography feature returns FULLGLOBE result?

I have some trouble with sql server 2012. I store coordinates of french cities in my database as geography object (with ESRI 4326) and i want to make the UNION of some cities. I have in result ...
0
votes
0answers
25 views

SQL fails in python. In ArcMap error FDO error: -2147024871 returned

I'm having issues with an SQL expression for a feature class in a file geodatabase. When working in ArcMap, the SQL will fail on its first attempt, and produce the following error: However, when I ...
1
vote
1answer
311 views

Using sql SELECT DISTINCT in Fusion Tables API

How do I go about using sql SELECT DISTINCT in fusion tables API?
0
votes
1answer
46 views

SQL and ArcGIS data querying: what's the difference?

I am wondering if the language used by ArcGIS for data querying (e.g., search by attribute) is part of the SQL language, or to what extent there is a connection between the two (and where does it come ...
0
votes
0answers
34 views

Densifying OpenStreetMap (OSM) network nodes?

I am working with osmconverter to convert osm files(*.osm) to *.pbf, then i use osm2po to get sql file that run into PostGis to get a network table. The last step is to run a createTopology ...
2
votes
2answers
424 views

Selection subquery using another table in database ArcGIS

I need to 'extract' a list of variables based on the IDs from another table. Using a subquery seems to be the best method. I have a large list of variables and have outside calculated a second list. ...
0
votes
1answer
45 views

MapInfo SQL: Selecting all columns from one table, some cols from second table?

I'm fairly adept with the SQL Select in MapInfo, but I'm running into something that's got me a bit stumped. I've got data in two tables that have a few columns in common. I want to join the tables ...
1
vote
1answer
239 views

Can't select geometry from Oracle DB using SQL

I'm trying to select the geometry field from an ArcSDE feature class in an Oracle 11g database (inside of a Python script via PyODBC). This is my query: SELECT SHAPE FROM USR.FEAT_CLASS This is ...
0
votes
0answers
10 views

Obtain minor distance given am array of points

I have built a query to obtain the minor distance given a point. SELECT name, city, region, Distance(GeometryFromText('POINT(-56.237076563852 ...
1
vote
1answer
135 views

connecting cartodb to existing mysql database

I'm trying to create a simple heat map based on longitudinal and latitudinal map coordinates that can be transferred from a database on mysql that I've created. I read that cartodb can be connected to ...
2
votes
2answers
242 views

Finding Polygons which do not touch any other polygon in a single oracle database table

I currently have an oracle table of approximately 100,000 records - all of which are polygons. I want to find all the polygons which do not touch any other polygon within the same table. There are a ...
1
vote
1answer
61 views

Reference Selection in SQL query (where clause)

I keep raising errors with my where_clause in the 9th line of this script. FID is an Object ID field and I want the cursor to select whatever row it is currently pointing at. I don't know how to do ...
2
votes
1answer
21 views

SQL Server Geography Query works but Geometry Query Does Not - Different Tables, Similar Schemas

I am trying to get a Geometry query to work. A similar Geography query works fine but I must work with a table that uses a Geometry type. Although the Geography version returns lots of records as ...
1
vote
2answers
49 views

SQL query new feature with loop

I'm trying to create an individual buffer feature class for each column of an input feature class, where there is a field that contains the buffer distance. I think there is a problem with my SQL ...
1
vote
1answer
69 views

What's the correct syntax for Execute SQL in Processing QGIS 2.6?

I made a small model with Processing in QGIS 2.6. The final layer should be the result of a SQL query. Now, in the Execute SQL dialog window I can add the query: select name, max(ele) as ele, geom ...
1
vote
1answer
51 views

arcpy; Select by attribute with an If, then statement

I am looking for some advice on how to construct an if, then statement based on a select by attribute SQL query or some other method (search cursor?). I am asking users to input a unique ID ...
0
votes
1answer
46 views

Updating Oracle Spatial geometry column using SQL?

I am trying to update a table B geom column with the coordinates from table A. Table A having coordinates in two separate columns x and y. Table B to have the coordinates from Table A into Table B's ...
1
vote
1answer
843 views

ArcMap “One or more layers failed to draw: An invalid SQL statement was used”

I created a model involving the tool Make XY Event Layer because I want to plot latitude and longitude points in CSV file columns. The model runs without errors and appears to have plotted the points ...
1
vote
1answer
43 views

ArcSDE - spatial index grid size for empty table

I'm trying to write the SQL to create a feature class and spatial index in an Oracle SDE geodatabase using ST_Geometry. This is how I'm making the table: CREATE TABLE STREETS (ID NUMBER(11) NOT NULL ...
17
votes
5answers
3k views

PostGIS: Select features that do NOT intersect

This seems to me like such a simple question (and it probably is) yet I cannot seem to find an example that gives me the answer. Using PostGIS, I just want to select points that fall outside of ...
1
vote
1answer
32 views

Query Sql Error

I want to join these 5 tables with MapBasic, because i want to use in statistic : Select * From Malade, Maladie, Ilot, Etat_Ilot, Pauvreté Where Malade.Maladie = Maladie.ID_maladie ...
2
votes
1answer
135 views

Model Builder Query by date

I've created a model that does several spatial joins based off of a lat/long in a table. In the table, I have a "Modified_date" which gives year, month, date, time. This model is set to run ...
0
votes
1answer
27 views

storing metadata of various services according to ISO 19119

I need to store the metadata of web services according to ISO 19119 standard.Hence I am looking for some guidelines for designing the database for storage.Can any one suggest any document to help in ...
2
votes
3answers
77 views

How to use the SQL in select by attribute to select the entries for each values in certain field?

I am trying to use select by attribute for the table in ArcGIS, which is similar to the following picture (lets say): I want to select those entries for each A and B, which have maximum count. I ...
0
votes
0answers
37 views

Geo spatial extensions in MariaDB vs MySQL

MariaDB is interchangeable with MySQL, but are there any differences in terms of each respective GIS features? Switching from one to the other is still a drop-in replacement with geo data types or ...
2
votes
0answers
65 views

Visualizing variability in the size and shape of polygons

I am working with a data set of area restrictions imposed by criminal courts. These restrictions ban a person from entering a demarcated area. These restrictions vary in their size, shape, and ...
6
votes
3answers
598 views

How to Comment Out Definition Queries

I use Definition Queries a lot in my daily GIS life, but one of the many things I've found annoying about ArcMap is the inability to comment out Definition Queries. I'd like to have this option as ...
0
votes
1answer
32 views

How to connect SQL SSMS to ArcGIS file geodatabase

I've found this reference article talking about how to query a file geodatabase using SQL. ...
0
votes
1answer
512 views

SQL Geometry Query similar to Select by Centroid

Does anyone know if it's possible to query SQL geometry by something like 'centroid of polygon'...similar to ArcMap's select by location? I'm using SQL Server 2008 R2 as the DBMS. I have two polygon ...
1
vote
1answer
466 views

How to create a search box and SQL statement for searching an attribute field?

How can I add a HTML search bar that the user can use to search an attribute field for a polygon layer, and then tie that input into the SQL statement? So far I am able to hard code the query of ...
0
votes
2answers
120 views

Dynamic connection between Mapinfo and a database

I'm trying to create a dynamic connection between a database and a Mapinfo table. My database countain only one table, with a list of bus stops, characterized with their ID, name, and X Y coordinates. ...
0
votes
1answer
50 views

select by location point in polygon with sql query

I have 2 tables table a this one a polygon layer with 10000 records table b this one a point layer with 600000 records in postgresql geodatabase i select a polygon feature with the query by input ...
4
votes
2answers
292 views

Which Geodatabase supports SQL and is easily portable?

I want to choose the geodatabase type, which could be: permits direct sql queries. easily portable, because the app would installed in one computer. I know that the personal geodatabase is a good ...
1
vote
1answer
95 views

PostgreSQL: insert from multiple select?

Is it possible in PostgreSQL to insert field values into a table using multiple selects from various other tables? Something like the following SQL (I have over simplified my original problem). I ...
0
votes
0answers
21 views

Get table of adjacent polygons

I am using the cb_2013_us_zcta510_500k shapefile to push zipcode polygons. I have the shapefile, and a SQL Server table loaded where the polygon is loaded in the GEOG data type. What I need is to ...
1
vote
2answers
44 views

How to use STUnion with GroupBy

I'm using SQL Server 2008 R2 to store Geometry data types. I have a bunch of lines as individual features, that share common names ('NAME' field). I would like to create a view that Groups By 'NAME' ...
1
vote
2answers
113 views

Adding Nodes to Linestrings at Overlapping Points with Polygon Layer in Spatialite

I have two Spatialite tables. A table called 'lines' which contains a PK column called OGC_FID and a LINESTRING column called GEOM. A table called polys which contains a PK column called OGC_FID and ...
0
votes
1answer
42 views

Spatial join points and polygons in PostGIS

I have two spatial data sets in PostGIS tables: polygon grid (table: grid_jakarta) points (table:tweets) For each point in 'tweets', I want to retrieve the reelvant attribute 'gridID' from the ...
2
votes
1answer
169 views

Trying to use SQL API from Oracle PL/SQL to CartoDB

I am trying to make an http call from within an Oracle server to CartoDB. To do so I have developed a custom PL/SQL package that will generate the SQL and make the calls. A sample API call is below. ...