Reputation: 103
Like I can do in Microsoft Access, I would like to link to 2 IBM DB2 databases in one query statement.
The only way I can figure out how to do it is to link to the first database, extract to a datatable, then do a ForEach-Object
and query the second database.
$iSeriesAccount = "USSRF_ADM"
$iSeriesDSN = "DB2_MR0P"
$Db2Connection = New-Object System.Data.Odbc.OdbcConnection
$Db2Connection.ConnectionString = "DSN=$iSeriesDSN;" +
"Userid=$iSeriesAccount;" +
"Password=$iSeriesPassword"
Upvotes: 0
Views: 86
Reputation: 3901
You could consider Federation in one of the databases so that you can use a single query in that database and access tables from both databases
Upvotes: 2