Custom Queries
To help you get started quickly using ATTOM Cloud Data, we have provided a simple SQL query editor.
Note: If you would prefer to use your own SQL editor, refer to Direct Integration for more information about how to connect external software such as editors to ATTOM Cloud.
Starting a New Query
Each time you wish to create a new query it is highly recommended that you use either the "New Query" or "Clone" features. If you don't, changes you enter to any existing code may be interpreted as changes to an existing query.
New Query
Select the "New Query" option to erase any existing code and start a new SQL query from scratch. Code can be pasted from other sources using the clipboard.
Cloning a Query
If you would like to use an existing query (either a preloaded or custom query) as the basis for a new query, the Clone icon can be used to place the code for the current query into a new query.
The clone option is only available if a previously saved query has been loaded.
Testing a Query
It is recommended that a Select Top 10, or Select Top 100 statement is added to your query in the early stages of development to reduce the time it takes to run each query. ATTOM has LOTS of property data. Some of our tables can contain billions of rows and lengthy queries can take considerable time to run.
Once you have a query that you think might work, click on the Run button to the right of the query editor. The results for a valid query will then be displayed in the area below the query window. If you are unlucky, an error message will be displayed
Formatting the Code
We have provided a format button to format your SQL code into a standard format. Once you have completed your query simply click on the Format icon to format the code.
SQL Server Syntax
ATTOM Cloud Data is stored in Microsoft SQL Server databases. The queries you write should be written to Microsoft's Transact-SQL (T-SQL) standards.
For example, use "Top 10" instead of "Limit 10" to restrict a query to the first 10 rows of data.
Saving the Query
Having written a query, you may want to save the query so you can run it again at a later stage. The name assigned to the current query is displayed above the code.
If "New Query" had been used, the query will not have a name.
If the Clone icon was used, the default query name will be set to "Copy of ...."
To assign the query an initial name, or to save a copy of the query with a new name enter the new name for the query and then click on the "Save" icon.
Saved Queries
Finding Saved Queries
All saved queries are stored under "My Queries". To access all saved queries select "Queries" from the menu.
To view a list of your own saved queries select "My Queries" from the dropdown. A preview of each query is displayed as you hover over each. Selecting (clicking) on a query will cause that query to be loaded into the query editor.
Note: When queries are saved, the SQL editor keeps track of which connection was last used to run the query. Loading a saved query may result in the current connection being changed to match that connection.
Running Saved Queries
Once a saved query has been loaded, it can be executed using the "Run" button.
Expanding the Results
The results of a query can be loaded into a separate browser window by selecting the "Table" option.
Deleting Saved Queries
To delete a saved query for which you no longer have a need, display the list of "My QUeries" and use the delete icon displayed next to the query to be removed.