I'm trying to write one script that makes a query to a 32 bit database and insert the result set into a 64 bit database and I dont want to make after the query to the 32 bit db a csv file and then insert it into the 64 bit db. I wrote a little script to test the 32 bit and 64 bit db connection in one script and it's working fine my problem is to read the 32 bit result set with my ISE 64 bit.
Here is my code:
$ConnAny = New-Object System.Data.Odbc.OdbcConnection
$ConnAny.ConnectionString = "DSN=SQLAnywhere32"
$ConnAny.Open()
$query = "MyQuery"
$stmt = New-Object System.Data.Odbc.OdbcCommand($query,$ConnAny)
$result = New-Object System.Data.DataSet
(New-Object System.Data.Odbc.OdbcDataAdapter($stmt)).fill($result) | Out-Null
#Everything is working fine until here
#Now I'm using the 64bit ISE trying to read the 32bit result set
&"$env:systemroot\sysnative\windowspowershell\v1.0\powershell.exe" -NonInteractive -NoProfile -Command {
#When im trying to print the result set with ISE 64bit the Dataset is NULL seems for me the it cant be red cause the dataset isnt null
$result.Tables[0]
#I need to find a way that the ISE 64 bit can read the result set (Array) of my query executed from the ISE 32 bit.
}
Is there any way to solve my problem without creating a csv file and then read the csv to insert it into the database?
Thank you in advance.
Greetings LittleStudent