Skip to content

Instantly share code, notes, and snippets.

@jonuwz
Created December 20, 2013 22:10
Show Gist options
  • Save jonuwz/8062471 to your computer and use it in GitHub Desktop.
Save jonuwz/8062471 to your computer and use it in GitHub Desktop.
primary keys on a table in DB2
db2 -x "SELECT A.COLSEQ, A.COLNAME FROM SYSCAT.KEYCOLUSE A, SYSCAT.TABCONST B WHERE A.CONSTNAME=B.CONSTNAME AND B.TYPE='P' AND A.TABNAME='$TABNAME' order by A.COLSEQ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment