UrbaneRove
Programmer
Hey all, I don't know if this can be done but any help is greatly appreciated.
I would like to utilize two separate Stored Procedures, one as a master which will bring in one bit of data that needs to be returned and a slave that will bring in the rest of the data based on two variables sent off the master. I need to tier the information to be returned from one call to the master stored procedure.
The question is how do you loop through a recordset in a stored procedure that has of course multiple records. Then using an Execute call a second Stored Procedure that also will return multiple records for each of the multiple record in the first SP. Then return the header values from the first Stored Procedure and all the associated records from the second
Ex. 1st 2nd
Name start end ID value
Bob 123 211 125 $565
154 $443
205 $665
Joe 211 344 224 $343
254 $488
266 $534
324 $232
Matt 344 515 348 $343
354 $543
362 $334
The first SP brings back the people that worked on one day with their start and ending invoice numbers. The second SP brings back the invoices that are for that employee. There is no link between the two except for the beginning and ending invoice numbers. These number do not overlap in the application.
1-looping with SQL in a Stored Procedure
2-returning information in one recordset off two sql statements in one stored procedure.
Regard
Urbane Rove.
I would like to utilize two separate Stored Procedures, one as a master which will bring in one bit of data that needs to be returned and a slave that will bring in the rest of the data based on two variables sent off the master. I need to tier the information to be returned from one call to the master stored procedure.
The question is how do you loop through a recordset in a stored procedure that has of course multiple records. Then using an Execute call a second Stored Procedure that also will return multiple records for each of the multiple record in the first SP. Then return the header values from the first Stored Procedure and all the associated records from the second
Ex. 1st 2nd
Name start end ID value
Bob 123 211 125 $565
154 $443
205 $665
Joe 211 344 224 $343
254 $488
266 $534
324 $232
Matt 344 515 348 $343
354 $543
362 $334
The first SP brings back the people that worked on one day with their start and ending invoice numbers. The second SP brings back the invoices that are for that employee. There is no link between the two except for the beginning and ending invoice numbers. These number do not overlap in the application.
1-looping with SQL in a Stored Procedure
2-returning information in one recordset off two sql statements in one stored procedure.
Regard
Urbane Rove.