MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » March 2014

Re: The maximum number of statements has been reached for the current connection



fixed

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 =
'ABC'

Do this:
select * from openquery(AS400_PROD_OLEDB4DB2, 'select * DCMTLIBD.STATIONF
WHERE KEY = '''ABC''')

That will send the query to the IBM to be processed.

HTH,
Charles



On Thu, Mar 20, 2014 at 7:36 AM, Gad Miron <gadmiron@xxxxxxxxx> wrote:

Hello guys

After setting up an IBM i (a.k.a AS/400) as a linked server in SQL Server
2012
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?


Thanks

Gad
--
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,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact