MySQL Forums
Forum List  »  Stored Procedures

Re: Returning a recordset
Posted by: micdearmas
Date: November 25, 2005 04:54PM

Thanks for your reply, but I don't see how that could help. The VIEW does not have the flexibility to do all the calculations I need to do and the SP does but it does not return a recordset.

The closest I have found to what I need is to use function, but it's a very inefficient approach. Let's say that I have a table of X and for each record in there I compute some values that cannot be calculated in a VIEW. What I tried looks somthing like this

SELECT X.id, Func1(X.id), Func2(X.id), Func3(X.id),... FROM X

It is inefficient becasue every time that one of those functions is called it has to iterate through the same records in other tables to do the calculations, so what I'm doing now is to calculate all the values in a function return them in a delimited string. It looks like this

SELECT X.id, Func(X.id) FROM X

However, that's not very clean and complicate things when I want to ORDER BY any of the values in the delimited string. I also have to work harder in the scripting of my web pages.

Michael.

Options: ReplyQuote


Subject
Views
Written By
Posted
2379
November 24, 2005 10:03AM
1519
November 24, 2005 11:10AM
Re: Returning a recordset
1658
November 25, 2005 04:54PM
1904
November 27, 2005 05:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.