Database Reference
In-Depth Information
7.
Connect and retrieve some data:
$conn = Connect-ODP (Get-ConfigConnectString .\App.config
AppConnect)
$dt = Get-ODPDataTable $conn "select employee_id, first_name,
last_name from employees where job_id = 'SA_MAN'"
$dt | ft -auto
$conn.Close(); $conn.Dispose()
8.
Open a PowerShell command-line host, change the directory to the location of the
scripts, and run IncludeTest.ps1 with . \IncludeTest.ps1 :
How it works...
First we moved common ODP.NET functions to Oracle.DataAccess.ps1 so they can be
reused across multiple scripts and we can start building a useful library of Oracle functions.
Next we did the same for Utilities.ps1 for any common functionality that is often used
with Oracle script code but isn't Oracle-speciic. This allows each script using these script
libraries to focus on speciic tasks and not setup, helpers, and infrastructure.
Next , we included the contents of these script iles into IncludeTest.ps1 with the following:
. .\Utilities.ps1
. .\Oracle.DataAccess.ps1
 
Search WWH ::




Custom Search