I'm using ODP.net with Powershell to execute query on my Oracle Database.
I want to time-out the execution of my query. This is my code :
[void][System.Reflection.Assembly]::LoadFile("C:\Oracle.ManagedDataAccess.dll")
$OracleConnexion = New-Object Oracle.ManagedDataAccess.Client.OracleConnection('User Id=test;Password="test";Data Source=10.0.0.0/TEST')
$FluxSiebel = "SELECT * FROM BLABLA"
Try {
$OracleConnexion.Open()
}Catch {
Write-Output "Connection KO"
$OracleConnexion
Exit 2
}
$Query=$OracleConnexion.CreateCommand()
$Query.CommandText=$FluxSiebel
$TimeTaken= (Measure-Command {
$ExecuteQuery=$Query.ExecuteReader()
}).TotalMilliseconds | Out-String
I want to add a timeout of 1minutes on this section of my code : $ExecuteQuery=$Query.ExecuteReader()
How can I do this? I can't find any cmdlet doing this...
Thanks