# encoding: ascii
# api: powershell
# title: PowerOracle
# description: Retrieve data from an Oracle database into a dataset.
# version: 0.1
# author: foureight84
# license: CC0
# x-poshcode-id: 6664
# x-archived: 2017-01-10T08:26:59
# x-published: 2017-01-04T15:44:00
#
# Prerequisite: Install the Oracle Data Provider for .NET > Google it! =)
#
# Load assembly
[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess")

# Connection information
$ConnectionString = "Data Source=your_server/sid;User Id=user_name;Password=password"

#Standard SQL Query Syntax
$QueryString = "SELECT * FROM table_name WHERE #Case"

$OracleConnection = New-Object Oracle.DataAccess.Client.OracleConnection($ConnectionString)
$dtSet = New-Object System.Data.DataSet
$OracleAdapter = New-Object Oracle.DataAccess.Client.OracleDataAdapter($QueryString, $OracleConnection)

[void]$OracleAdapter.Fill($dtSet)
