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.

1 open RAMM SQL.png

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.

2. start new query.png

3. In the code window of your new query enter the following SQL code….

3. write the following code.png

-> 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.

auto-expand off.png

5. Almost there already. Now just click the green play button to run the query.

press the play button.png

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.

list of roads in results.png

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.

layout panel.png

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.

layout panel settings.png

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

export options.png
 

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.



The Datastack is an asset information management and digital solutions consultancy.

Thanks for reading this article! If you would like to chat about how The Datastack can help you with your next project, please click the Get Started button at the top of the page.

Our clients partner with us to manage their infrastructure asset information more effectively, improve the quality of their RAMM systems, enhance their workflows, and get more from their investment in their data.

Previous
Previous

Filter by security zone in RAMM Map & RAMM Grid

Next
Next

How to setup a new security zone in RAMM