Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-13-2007, 06:41 AM
Rich Mogy
 
Posts: n/a
Default Stored Procedures using 2 queries, the second dependent on the results of the first

Hi all,
I have a database with two tables, called cost and costdesc. For each
record in cost, there can be 1 to 100 records in costdesc, each of these
records having parts of the narrative of the cost.

I want to create a stored procedure that will select records from the cost
table, and then, for each record in the result set, select records from the
costdesc table and concatenate them into one string, thus:

Cost record -- index, person authorizing cost, amount of cost, date of cost

Costdesc record -- index, line 1, narrative 1
index, line 2, narrative 2
index, line 3, narrative 3


Result set

index, person authorizing cost, amount of cost, narrative 1 narrative 2
narrative 3


Go to next cost record.


Any assistance would be appreciated.

Thanks in advance.

Richard Mogy


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:12 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.