Hi, I'm Philip from the HANA Academy.
In this series of videos, we're looking at the XS Advanced model.
In this video, we're going to look at the database explorer and see what's new with it with HANA 2.0 SPS 01.
Now, the database explorer is available when you're working with WebIDE for HANA.
It's the option on the left, it's been around for a while.
Now, we've already created in a previous video a HDI container called 'db' as part of our sales project
and we've put a couple of entities in there
so a couple of tables: 'Region' and 'Country'.
So, the first thing we will want to do is to go to the database explorer.
You've got it here on the left, or also in 'Tools' you've got 'Database Explorer'.
Now, if you've not already, actually, set up a connection in that it will prompt you, "Do you want to add a new one?"
It's the equivalent to pressing this plus sign up at the top
so let's say 'Yes'
and we want to connect to our HDI container.
Now, something that's also new here is that
if you have a long list of HDI containers that you want to select from it can be a pain scrolling through them
so there's actually the ability to do searching now
so something, for example sales, that you want to look for, it will filter and only show those HDI containers.
So this is the sales one we've just created
so that's great, it's in my dev space, it's part of my 'saphanaacademy' org, so I'm going to select that.
Now, what's also new here is we've got the ability to show advanced options, and we can specify things
and this can be useful when you're connecting to other things, not just only HDI containers
but you can specify, for example, something like 'CLIENT=100', or other kinds of options
so you've got the ability to do more specific settings or use advanced options when you're making connections.
Also notice that you can add other things as well as HDI containers.
It's already been available that you can access databases.
Typically when you're working with SPS 01 it's only working in multi-tenant
so either you are going to connect to the system database or a tenant database
you would use the HANA database multi-tenant mode
and also you can access application-managed service instances, and that's actually something that's new
so if you've got services that you've set up that are managed by different applications
you can connect with those, which are not necessarily ones which have been created by this actual developer
which is what we get by default with the HDI container option, so we've got new options in there.
I'm going to click 'OK' and connect to our sales one
and if we click on tables you should see that we've got 'Country' and 'Region'.
Now, there are quite a few nice newer options available here.
One of the things that we can do, for example, is create some data.
So I'm going to choose the SQL window first
so choose SQL
and I'm going to paste in a bit of code just to insert a few rows
and you'll find that in the same GitHub repository
and the same HTML5 Master-Detail that we saw in the previous video, maybe you still have it open.
So I'm going to select these insert statements, copy that, and paste them into my console.
You'll notice that there are some new features here if we right mouse button
for example, we can format the code
or we could download the statement
so if you're here writing code and you want to save what you've done
you don't necessarily have to copy and paste it into an editor, you can just download it
effectively save it in a file locally on your desktop.
So let's format it.
Not a big change, but there is a formatting option.
Let's go ahead and run that to do the inserts.
Okay, so that's run, so we've got some data now.
Now, if we go and look at our country table, for example, we can right mouse button on it.
You'll see there are a number of options
and one of them is called 'Open Data', which you can use to browse the data that you've got.
You'll find that there've been a very large number of enhancements to this 'Open Data' option.
You'll notice that you can actually select different rows, or indeed select all of the rows
and you could potentially delete the data
so you could make changes, or you could insert new rows or you could copy selected rows.
So you've got the option to actually make changes to the data, that's new in SPS 01.
You've got the ability to download the data
for example into a CSV file
and you can choose how you want it delineated – comma, tab, space, whatever.
You've also got the option to do some analysis
and this is more about getting to feature parity with what's been in HANA Studio, the desktop application
or Eclipse with the HANA Tools for some time.
So if we choose analysis you can do some charting and some, basically, initial data analysis.
It can be quite useful to do that when you're working with the database explorer
so, for example, we could choose the amount
put that onto the value axis so it shows us the total value of all of our data.
Maybe we want to put the continent on there so we can now see by the different continents
and then maybe we'll put the name of the country
so we can see grouped by continent we've got the actual sales amounts for each country
so of course you've got lots of different charting types
but it's quite nice that you've got some analysis capability directly when you're working with WebIDE for HANA.
If we go back to the 'Raw Data' tab you'll also notice that there are filtering options
so if you want you can actually filter the data you see, that's new in SPS 01
and also, just to go back to the SQL console
one of the things that you might want to do is
if you've got an HDI container, you might want to grant roles so other HANA users can have access
to maybe read data or work with data in that HDI container.
Now, that can be a little bit tricky
because the user we're using here is actually a technical user that's been created
but it's not a user that allows you to grant authorizations to other users
because actually there are different technical users for an HDI container.
So if you want to perform admin tasks
including granting rights
then what you can, in fact, do is use a special option, which is for your HDI container.
If you right mouse button and then choose 'Open SQL Console (Admin)'
and in this case, it's connecting with a different user
it's the user, the technical user, who has the right to make grants.
So now you can do your grant statements to regular HANA users to give access to that HDI container.
So that's something that's new and quite useful in SPS 01.
So, in this video, we've looked at the database explorer
we've created some data that we've added
we've seen how we can do analysis and all sorts of things with Open Data
so some great new things available with the database explorer.
In the next video, we're going to look at how we can make an OData service using Node.js and XSJS
so that we can actually get web access to this set of tables.
You can find more HANA video tutorials on our YouTube channel.
If you'd like to be informed as soon as new video tutorials are published, please subscribe to the channel.
You can also connect with us on LinkedIn, follow us on Twitter, and we have pages on Facebook and Google+.
Code snippets for all of our tutorials are published to GitHub.
Thanks for watching.