Database Reference
In-Depth Information
HR.employees e
join
HR.departments d
on e.department_id = d.department_id
where
e.commission_pct > :commission_threshold
2.
Create HighCommission.ps1 and add the following script to it:
param (
[Parameter(Mandatory=$true)][string]$outputPath,
[Parameter(Mandatory=$false)][decimal]$commissionThreshold = .25)
$errorActionPreference = "Continue"
3.
Add a function to HighCommission.ps1 to deine set host line widths:
function Set-HostSettings
{
if ($Host -and $Host.UI -and $Host.UI.RawUI) {
$ui = (Get-Host).UI.RawUI
$winSize = $ui.WindowSize; $buffSize = $ui.BufferSize
$buffSize.Width = 120; $ui.BufferSize = $buffSize
$winSize.Width = 120; $ui.WindowSize = $winSize
}
}
4. Deine an Invoke-Script function in HighCommission.ps1 :
function Invoke-Script
{
try {Set-HostSettings} catch {}
"Processing started. Commission threshold is
$commissionThreshold, output path is $outputPath"
"Checking existence of output path $outputPath"
if (!(Test-Path $outputPath -PathType Container)) {
throw "outputPath '$outputPath' doesn't exist"
}
"Importing Oracle.DataAccess.ps1"
. (join-path $_scriptDir Oracle.DataAccess.ps1)
$sqlFilename = (join-path $_scriptDir Query.sql)
$configFile = (join-path $_scriptDir App.config)
$outputFilename = (join-path $outputPath HighCommission.csv)
 
Search WWH ::




Custom Search