LoginSignup
6
6

More than 5 years have passed since last update.

PowerShell スクリプトから DB2 関連コマンドを使用するためのおまじない

Posted at

おまじない

必要な理由とかは DB2CLP などでぐぐれば出てくると思うので割愛します。

バッチファイルの解説はあったけど、PowerShell 版はなさそうだったので作成。

サンプルスクリプト

DB2 関連コマンドを呼ぶ前に、setupDB2Env 関数を呼びださねばなりません

DB2Sample.ps1
function setupDB2Env($DB2BinPath) {
    $env:DB2PATH = "${DB2BinPath}"
    $env:path += ";${DB2BinPath}"
    $env:DB2CLP = $(db2cmd /c /i /w echo %DB2CLP%)
}

...

setupDB2 'C:\Program Files\IBM\SQLLIB\BIN'
db2 get db cfg for sample #など
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6