daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT * FROM Sysibm.syscolumns WHERE tbname = '[NOMBRE_TABLA]';
  2.    
  3. SELECT * FROM Sysibm.syscolumns WHERE tbname = '[NOMBRE_TABLA]' AND FOREIGNKEY='S';
  4.    
  5. select  substr(R.reftabschema,1,12) as P_Schema, substr(R.reftabname,1,12) as PARENT,
  6.         substr(R.tabschema,1,12) as C_Schema, substr (R.tabname,1,12) as CHILD,
  7.         substr(R.constname,1,12) as CONSTNAME,
  8.         substr(LISTAGG(C.colname,', ') WITHIN GROUP (ORDER BY C.colname),1,20) as FKCOLS
  9. from syscat.references R, syscat.keycoluse C
  10. where
  11.    R.constname=C.constname and
  12.    R.tabschema=C.tabschema and
  13.    R.tabname=C.tabname
  14. group by R.reftabschema, R.reftabname, R.tabschema, R.tabname, R.constname;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top