Note that using the link to IBM i in that manner is generally a bad idea.
Reason, assuming you have a WHERE clause, MS SQL Server actually pulls back
every row and then applies the WHERE.
So instead of this:
select * from AS400_PROD_OLEDB4DB2.PRODDB.DCMTLIBD.STATIONF WHERE KEY =
select * from openquery(AS400_PROD_OLEDB4DB2, 'select * DCMTLIBD.STATIONF
WHERE KEY = '''ABC''')
That will send the query to the IBM to be processed.
On Thu, Mar 20, 2014 at 7:36 AM, Gad Miron <gadmiron@xxxxxxxxx> wrote:
After setting up an IBM i (a.k.a AS/400) as a linked server in SQL Server
using MS OLEDB Provider (V4) for DB2 ,
I get the following error with each Select statement I test.
OLE DB provider "DB2OLEDB" for linked server "AS400_PROD_OLEDB4DB2"
returned message "The maximum number of statements has been reached for the
current connection. SQLSTATE: HY000, SQLCODE: -1500".
Here's a sample SQL stmt:
select * from AS400_PROD_OLEDB4DB2.PRODDB.DCMTLIBD.STATIONF
Anyone out there familiar with this kind of error?
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives