Database Reference
In-Depth Information
Serif;
font-size: 12px; background: #fff; margin: 45px; border-collapse:
collapse;
text-align: left; }
th { font-size: 14px; font-weight: normal; color: #039; padding: 10px
8px;
border-bottom: 2px solid #6678b1; }
td { border-bottom: 1px solid #ccc; color: #669; padding: 6px 8px; }
tbody tr:hover td { color: #009; }
</style>
"@
$dt | ConvertTo-HTML -head $head `
-Property employee_id, employee, job_title, hire_date, manager `
| Out-File $filename
Invoke-Item $filename
This code builds an HTML head section into
$head
to provide some nice styling of the table
and speciies that with the
-head
parameter of
ConvertTo-HTML
. It also speciies what
property names to include with
-Property
to prevent other properties of the
DataTable
from being included (such as
RowState
,
ItemArray
, and so on).
Adding records (Simple)
In this recipe we will look at adding new records to Oracle tables with PowerShell.
Getting ready
To run the sample against Oracle's sample HR schema, you may need to irst disable the
SECURE_EMPLOYEES
trigger. See
README.txt
in this recipe's sample code for more details.
How to do it...
1.
Create the following
Add-Oracle
function:
function Add-Oracle
{
Param(
[Parameter(Mandatory=$true)][Oracle.DataAccess.Client.
OracleConnection]$conn,
[Parameter(Mandatory=$true)][string]$sql,
[Parameter(Mandatory=$false)][System.Collections.Hashtable]
$paramValues,
[Parameter(Mandatory=$false)][string]$idColumn
Search WWH ::
Custom Search