Hi All.
I have set up a server running Windows Server 2008 R2, PowerShell 3.
I would like to query an Oracle 9.2 database from this server using, so i have installed Oracle Data access components version 11.2(X64). I have used this previously to query my oracle database.
My PowerShell script looks similar to the following
$reader = $null
Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342\oracle.dataaccess.dll"
$con = New-Object Oracle.DataAccess.Client.OracleConnection("CONNECTION DETAILS HERE")
$con.Open()
$OracleSQLQuery = "SQL QUERY HERE"
$command = New-Object Oracle.DataAccess.Client.OracleCommand($OracleSQLQuery,$con)
$reader=$command.ExecuteReader()
When i run my script i get the following error Exception calling "ExecuteReader" with "0" argument(s): "Connection must be open for this operation"