Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active May 29, 2018 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdave/a1f5d8a6333d32ca8baa to your computer and use it in GitHub Desktop.
Save phpdave/a1f5d8a6333d32ca8baa to your computer and use it in GitHub Desktop.
alias db2='function _db2(){ echo "Running $1"; system -i "call QSYS/QZDFMDB2 parm('\''$1'\'')"; };_db2'
db2 "SELECT * FROM MYLIB.MYTABLE"
#Get fancy and search the data
db2 "SELECT * FROM MYLIB.MYTABLE" | grep "Smith"
#Alternatively you can run it through qsh - https://kadler.github.io/2018/05/29/calling-qsh-utilities-from-pase.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment