This question was moved from Categorized Questions and Answers by Q&AEditors.
Please do not vote for this node. It will affect the wrong user. Thank You.

I had been trying to get a "native" connection to MS SQL 7 via freetds, but it caused me much grief. Instead I went with an ODBC connection using the openlinksw.com available drivers. This is fine and dandy.

My true problem lies hidden deep within the error_log now.

When I run particular fetchrow_hashref (yeah, yeah, I know about problems with it so I don't wanna hear use arrayref or array, I wanna hear answers to MY question. I have also had the same problem with fetchrow_array at times anyway.) it ends up giving this error:

DBD::ODBC::st_fetchrow_hashref failed: [OpenLink][ODBC][Driver]Function sequence error (SQL-S1010)(DBD: st_fetch/SQLFetch err=-1) at /path/to/filename line <i>n</i>

So, my fellow monks, I wish to ask not why I should use fetchrow_array instead of fetchrow_hashref. That information is easily obtained.

My real question is, why does the fetch itself fail? As stated above, I've seen this problem with all types of fetchrow.

I'm confused about what the Function sequence error is. During my testing, I've run this through 'perl -d' and can give you a final piece of information. It does fetch at least once in all cases. It may even fetch more than once in some cases. But it does fail after a subsequent number of fetches.

Thanks


In reply to DBD::ODBC problem. by Russ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.