Personal tools
You are here: Home DB2 How To's How to find out foreign key on DB2 tables
Navigation
Log in


Forgot your password?
 
Document Actions

How to find out foreign key on DB2 tables

syscat.references - db2look


SYSCAT.REFERENCES

select substr(tabname,1,20) table_name,substr(constname,1,20) 
fk_name,substr(REFTABNAME,1,12) parent_table,substr(refkeyname,1,20) 
pk_orig_table,fk_colnames from syscat.references where tabname = 
'TABLE_NAME'


  DB2LOOK

db2look -d <database_name> -e -t  <table_name>
Look for 'DDL Statements for foreign keys on Table table_name in the output.
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls