RAMM SQL basics and writing a simple query
Have you heard of the RAMM SQL application before?
Do you want to have a go at writing a simple query?
Have you ever needed to get a current list of roads that are in your RAMM database?
If you answered yes to any of the questions above you are in the right place. As follow up to the last few blog posts (here and here) today we are going to export the list of roads from our TalkData network. We will do this using the RAMM SQL application.
RAMM SQL provides a very quick and easy way to interact with your database. To demonstrate this, you will see that only a couple of lines of code are needed to get a the list of roads out of a RAMM database.
If you are not sure what SQL actually is, there is a very quick introduction below. Then after that you can follow along with the steps listed below to get the list of roads for your network.
So first...what is SQL?
SQL stands for Structured Query Language. Basically its a language that lets us write some code to interact with a database. Not all databases out there in the world use SQL, but it will work with all RAMM databases as they are built around SQL Server technolgy.
How do you use the SQL language in RAMM? The RAMM SQL application is where all the SQL magic takes place. It is an interface where you can design, store and run SQL scripts, to access and manage the database.
SQL scripts can be an incredibly efficient and powerful option for doing things in your RAMM database. As you will see in the following steps, only a few lines of SQL code are needed to pull out a list of all the roads in a RAMM database.
Step-by-step RAMM SQL walkthrough to write a simple road list query
The steps below will use the RAMM SQL application to generate a road list for our network. You can use the same steps in your own database (assuming you have the right permissions) to get the list of roads out of there as well.
1. From the RAMM Menu screen, search for SQL and open the RAMM SQL application.
2. Start a new query. You can do this by clicking the shortcut button highlighted below, or by going to the Query menu and selecting Add. This will create a new Unnamed query in your Personal query list.
3. In the code window of your new query enter the following SQL code….
-> If you want to copy and paste the code, grab it below…
SELECT road_id, road_name, road_type
FROM roadnames
4. For now, make sure the auto-expand button is switched off. If you are not really sure what this does, there will be a future blog post doing a bit more of a deep dive into this neat feature.
5. Almost there already. Now just click the green play button to run the query.
6. A results window will pop open to show the list of roads in our database. This includes the three attributes that were in the SELECT statement in step 3 above; the road_id, the road_name and the road_type fields.
If the results don’t quite look the same for you, its possible RAMM will be hiding some of the attribute fields in the results window. To check for this happening, click on the little blue panel with 3 arrows to access the ‘layout options’ panel.
In the layout options panel you can choose to show or hide attributes in your results. Simply tick them off or on as needed. If you can’t see one or more of the road id, road name or road type attributes when you first run your script, RAMM may have just hidden them by default.
7. To export the road list out of RAMM, click on the Export button in the toolbar. There are a few different export options available, with the easiest to use being the Clipboard option. When using this option the data goes onto your computer’s clipboard, from which you can then paste into applications such as Microsoft Excel
And thats a wrap for today’s post. Follow along with these quick and easy steps using RAMM SQL, to get a list of roads out of your RAMM database.