View difference between Paste ID: VqVJr7AP and x89KcVMf
SHOW: | | - or go back to the newest paste.
1
#Oracle Strings
2
[Reflection.Assembly]::LoadFile("C:\oracle\product\10.2.0\client_1\odp.net\bin\2.x\Oracle.DataAccess.dll") #Obviously this path needs to be correct
3
$constr = "User Id=<>;Password=<>;Data Source=<>"
4
$conn = New-Object Oracle.DataAccess.Client.OracleConnection($constr)
5
$conn.Open()
6
$sSQL = "<Query>"
7-
$sSQL_AGR = "select AGR_SNAME from tAgreement where agr_lkey = 110338"
7+
8-
$sSQL_MBS = "select MBS_SNAME from MBS_Search where mbs_lkey ="
8+
9
#....
10-
$commandAGR = New-Object Oracle.DataAccess.Client.OracleCommand($sSQL_AGR,$conn)
10+
11-
$commandMBS = New-Object Oracle.DataAccess.Client.OracleCommand($sSQL_MBS,$conn)
11+
12
	for ($a=0;$a -lt $reader.FieldCount;$a++){}
13
	
14
			While ($reader.read())  {  
15
					$str1=$reader.Getstring(0)  #This is the first column value. You can assign others to Getstring(1) 
16
					$Var1 = <Do something with> $str1
17
						}