3

What is a H2 command to list all views in the database?

I have expected that SHOW command would do the job but there is no option there to list views.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
tomto
  • 33
  • 1
  • 4

3 Answers3

3

These are listed in the information_schema

So, you need to run:

select *
from information_schema.views;
1

please check System Tables provided for H2 database engine under INFORMATION_SCHEMA schema

You can display all views by querying INFORMATION_SCHEMA.VIEWS system table

Eralper
  • 6,461
  • 2
  • 21
  • 27
1

Try this one and it should work.

SELECT TABLE_NAME as [View Name]
FROM   INFORMATION_SCHEMA.VIEWS 

H2 Database

Narayan Yerrabachu
  • 1,714
  • 1
  • 19
  • 31