この記事は
SQL*PLUSもどきを作る8
の続きです。
前回、SQL実行履歴を保存する関数を作成しました。
今回は、SQL*PLUSもどきを作る6で作成した関数に、この機能を組み込みたいと思います。
とは、いっても一行追加するだけです。
#========================================================================================= # Read-MultiLine: QueryStringを実行する # # UPDATE 2008/04/28 Ver.1.0.0 # 2008/05/19 Ver.1.0.1 # # copyright HIRO's.NET(http://hiros-dot.net/) #========================================================================================= function global:Execute-Query { #複数行のQueryStringを受け取る $strSQL = Read-MultiLine #履歴の作成(Ver.1.0.1) Write-SqlHistory $strSQL #QueryStringを実行する $dtSet = Execute-QueryString $strSQL if ( $dtSet.Tables.Count -gt 0 ) { #format-tableコマンドレットでデータを表示 $dtSet.Tables[0].Rows | format-table } } #エイリアス設定 Set-Alias -name EQS -value Execute-Query -scope "Global"
これで、実行したSQLがXMLファイルに履歴として作成されるようになります。
Theme design by Jelle Druyts
Pick a theme: BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2 BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2009, HIRO
E-mail