1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| # INSERTION_DATE,VPN_ID,CALLING_NUMBER,CALLED_NUMBER,SESSION_TIME,DISCONNECT_CAUSE,VPN_NAME,STARTTIME,STOPTIME
$SQLQuery = "insert into " + $DBTable + " (INSERTION_DATE,VPN_ID,CALLING_NUMBER,CALLED_NUMBER,SESSION_TIME,DISCONNECT_CAUSE,VPN_NAME,STARTTIME,STOPTIME) values "
$SQLQuery += "(to_date('" + $INSERTION_DATE + "','mm/dd/yyyy hh24:mi:ss')"
$SQLQuery += ",'" + $VPN_ID + "'"
$SQLQuery += ",'" + $CALLING_NUMBER + "'"
$SQLQuery += ",'" + $CALLED_NUMBER + "'"
$SQLQuery += ",'" + $SESSION_TIME + "'"
$SQLQuery += ",'" + $DISCONNECT_CAUSE + "'"
$SQLQuery += ",'" + $VPN_NAME + "'"
$SQLQuery += ",to_date('" + $STARTTIME + "','mm/dd/yyyy hh24:mi:ss')"
$SQLQuery += ",to_date('" + $STOPTIME + "','mm/dd/yyyy hh24:mi:ss'))"
# IMPORT TO DATABASE
try
{
$SQLCommand = New-Object Oracle.DataAccess.Client.OracleCommand($SQLQuery,$SQLConnection)
$SQLReader = $SQLCommand.ExecuteReader()
}
catch
{
Write-Host $_
} |