Skip to main content

Notifications

Microsoft Dynamics SL (Archived)

Fetch out of range

Posted on by 890

 Hi,

we are doing an exe that should create a journal import file and launch the SL transaction import. It calls a stored procedure to prepare data before creating the import file, etc.

It throws the error below. We would appreciate any input!!

SQL Server Message 65: [Microsoft][SQL Server Native Client 10.0]Fetch type out
                       of range

 

  Debugging info: ODBCsysfetch8_2 -
                       SQLFetchScroll Failed
  Cursor(4) xPF_Commitments 'HHH'
  Optional info: SqlState = HY106
                       NativeError = 0 ErrorMsg = [Microsoft][SQL Server Native
                       Client 10.0]Fetch type out of range pcbErrorMsg =
                       65
ODBCRowNumber = -1 Column = -1 SSrvrLine = 0
                       SSrvrMsgState = 0 SSrvrSeverity = 0 SSrvrProcname =
                       SSrvrSrvname =

*This post is locked for comments

  • Verified answer
    Mark E Profile Picture
    Mark E 6,405 on at
    RE: Fetch out of range

    It is version SL 2015 CU2.  What I found was that the sql call I was making was a fetch proc that was using SET NOCOUNT ON (as you suggested).  As I looked at other procs used for PVRec, I saw that they don't include SET NOCOUNT ON (I've gotten used to adding it to all my procs).  I removed that from this proc, and it seemed to help.  I also tried it with a SQL call directly from vba (e.g select * from....), and that worked too.  Thanks for confirming the issue.

  • CFROTON Profile Picture
    CFROTON 4,710 on at
    RE: Fetch out of range

    Mark,

    Thank you for the update on this post. Are you using SL 2011 or newer version?

    I found a couple reports of this type of message. One noted where the site had modified a standard SL proc to include the "nocount on" entry. Once removed and the proc returned to it's standard version the error went away. The only other reference was where the site copied the SQL query into SQL and found  it failed there also, but returned a better error to troubleshoot with.

    Hope this helps point in a direction to resolve. I checked our bug database and did not find anything reported with this message and what you are trying to accomplish in SL.

    Please let me know if there is anything else we can do to help on this issue.

    Thank you,

    Carolyn

    MSDSL Technical Support

  • Mark E Profile Picture
    Mark E 6,405 on at
    RE: Fetch out of range

    I am running into this same issue with a proc returning data within a current SL screen (not SDK) using Customization Mgr VBA.  Did you ever resolve this?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fetch out of range

    try to use Ltrim within SP.

  • Coen Pretorius Profile Picture
    Coen Pretorius 890 on at
    RE: Fetch out of range

    The developer syas that the SP is launched successfully and brings back the data but falls over when the internal cursor tries to populate the array

  • Coen Pretorius Profile Picture
    Coen Pretorius 890 on at
    RE: Fetch out of range

    Hi Elaine,

    unfortunately that did not resolve the issue

  • Coen Pretorius Profile Picture
    Coen Pretorius 890 on at
    RE: Fetch out of range

    Hi Elaine,

    thank you for the input. We will test and let you know.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fetch out of range

    Often the SQL 65 error concerns  having Set NoCount Off when it needs to be left on.

    The no count issue is prevalent in 2011 but we didn't see it in prior version.  The other numbers with this issue are 93 and 63.

    In one case using a custom trigger, the suggestion was to remove the SqlFastReadOnly if you have one.

    Another suggestion was to make the ORDER BY clause in the proc to include all the fields in the  index  .

    A trace running while the error is generated may lead to an idea.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans