in reply to Re^2: DBI Prematurely Disconnecting
in thread DBI Prematurely Disconnecting

I don't mean to sound like i'm blaming DBD directly. I am an amateur and I may be doing something wrong or using something inappropriately. By proving my theory I only meant to communicate that my script operates fully within ssms and the return of the select seems to 'break' what I expect to happen. I have tried both do and prepare/execute.I understand how this would return multiple results. I have set nocount on and I understand what it does. It seems like I have to get both DBI and DBD upgraded and try odbc_more_results again. Am I accurate to say then that if a stored procedure does anything complex (e.g. multiple select / update / delete statements), I must use odbc_more_results if nocount is off. Or does it sound like I am having an abnormal issue as a result of my own doing and/or from not knowing how it works?

Replies are listed 'Best First'.
Re^4: DBI Prematurely Disconnecting
by mje (Curate) on Oct 09, 2013 at 17:57 UTC

    I answered your later post where it sounds like you are working now. I did not take your reponse as meaning you were blaming anything, I was just simply pointing out there were more parameters than you had considered.

    I'm interested in 2 things in particular (both of which could help me).

    1. Why are you using so old a DBI and DBD::ODBC?
    2. Why do you think you got to the point where you were calling a procedure with the do method and never got to odbc_more_results? Did you read any of DBD::ODBC and if so, how could I make it clearer so the next person who hits this doesn't have to go through your pain.
      1. I'm relying on the install of an existing server to which I am not an admin. However we will be upgrading. 2. The do method was only an attempt at trying something new at the time that I posted my code. I was actually using prepare/execute because I knew I was expecting a resultset. I usually work with .net and if I run any SQL using any of the methods, it executes 100% fully before continuing.

      I've come across odbc_more_results in previous research but DBD::ODBC only says "SQL Server supports this feature" so I assumed I didnt have to use this unless I was expecting to see multiple results from using sql such as select * from table1; select * from table2;

      You've been a great help. Thank you.

        Thank you for taking the time to explain how you got where you got. I've updated the pod in DBD::ODBC to try and make odbc_more_results clearer.