on 04-13-2016 9:17 AM
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
Hi,
Please have a look at the SYS
-schema, especially its view. E.g. the view SYS.CONSTRAINTS.
Greetz,
Silvio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.