• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MS SQL Stored proc returns multiple recordsets

#1
[eluser]btwong[/eluser]
I have a stored proc on a MS SQL server, that returns 3 recordsets.

How can i differentiate between each record set? (i want 1 field from the first recordset, and all of the second recordset).

Any ideas?

#2
[eluser]bretticus[/eluser]
You probably call mssql_next_result(). But I doubt this is possible using CI's ActiveRecord.

#3
[eluser]btwong[/eluser]
i will give it a go.

thanks

#4
[eluser]bretticus[/eluser]
You might wanna anaylze the adodb php library for how they accomplish this too:

http://phplens.com/adodb/reference.funct...rdset.html

Good luck

#5
[eluser]btwong[/eluser]
CI won't allow that call - mssql_next_result($query).

I will now suss out the adodb.

Thanks heaps for your help. If i find anything useful, i will be sure to post back here.

thanks again

#6
[eluser]WanWizard[/eluser]
Isn't that a bit drastic?

Nobody's stopping you from calling this function outside of CI's AR system, or to add the method to CI's AR library. That seems to me a lot easier than switching to adodb...

#7
[eluser]btwong[/eluser]
What is the AR system that you are talking about?

Is the mssql drivers php files, or is it something else?

------------

sorry, AR = active record.

i have been using the below:
Code:
do {
        echo $this->result_id ."<br>";
        while ($row = mssql_fetch_row($this->result_id)) {
            echo "$row[0] -- $row[1]<BR>";
        }
        } while (mssql_next_result($this->result_id));


i am attempting to play around with it, and i am getting some results.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.