cancel
Showing results for 
Search instead for 
Did you mean: 

information_schema in HANA

Former Member
0 Kudos

Hello everybody,

I face this problem:

I need to translate this: the original program gets this info from the information schema from a Postgresql system.

SELECT

  tc.table_name, kcu.column_name

  FROM

  information_schema.table_constraints AS tc

  JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name

  JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name

  WHERE constraint_type = 'FOREIGN KEY'

  AND ccu.table_name = '_translation'

  AND ccu.constraint_schema = 'production'

  AND kcu.column_name = 'name'

What this query does is getting all the tables in the system which have a column called "name", and this column is a foreign key to "_translation".

Does anybody know how can I get this system tables information??? Please, I need help!

Thank you very much. Best regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please have a look at the SYS-schema, especially its view.  E.g. the view SYS.CONSTRAINTS.

Greetz,

Silvio

Former Member
0 Kudos

Hello Silvio, and thanks for your help.

I already check some of the tables from SYS...

SAP HANA Reference: System Tables and Monitor Views Reference

But inside CONSTRAINTS there was nothing useful, at least I didn't know how to get what I want...

I got the columns CONSTRAINT_NAME COLUMN_NAME TABLE_NAME...from that table, but none of them where useful...

There are a lot of tables, with a lot of columns, and I got a little lost...so if anybody knows the key, I would aprecciate it.

Does anybody know where the foreign keys are kept???

Thank you very much.

Former Member
0 Kudos

I also took a look at:

select * from "REFERENTIAL_CONSTRAINTS"


as told in some other forum, but all I got is this:

And the SYS.CONSTRAINTS shows only PRIMARY KEYs...

anybody can hel me?

thank you

Answers (0)