cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference btw. M_TABLES and TABLES view

WMuellner
Advisor
Advisor
0 Kudos

I looked into the definition of these two HANA views which are a bit complex but look similar, BUT from a 'documentation' point of view they are equal (=information on row and column tables).

Interestingly, there is a difference in the results I get when I query these tables. So, in order to find the differences I ran the following two queries with surprising results:

select schema_name, table_name from tables

minus

select schema_name, table_name from m_tables;

This should give me tables from system view "TABLES" which are NOT in system view "M_TABLES". And there are some.

Vice versa, when running the follwing query:

select schema_name, table_name from m_tables

minus

select schema_name, table_name from tables;

gives a different result set.

Why??

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

And just another SAP colleague who does prefer to ask question in a public SCN forum instead of using the many internal communities for that...

Anyhow, the reason for the different result sets is privileges and object types.

M_TABLES shows runtime information of tables that are stored in SAP HANA.

E.g. it doesn't show data for virtual tables (SDA) as those are not stored in SAP HANA but only kept as references to the remote tables.

TABLES on the other hand shows you what tables are available to the current user and explicitly filters out tables from the _SYS_* schemas.

Actually you can see that if you look at the view definition of SYS.TABLES.

There you go, now you know.

Cheers,

Lars

Answers (0)