Using Query Results within Stored Procedure

Using Query Results within Stored Procedure

Post by Don Mille » Sun, 01 Oct 2000 04:00:00



I'd like to perform a query within a stored procedure and then use 3 or 4 of the fields from the returned recordset (consisting of only one row) from that query in an action statement within the same sp. It's trivial to get a single value (e.g. COUNT) but I need to use several of the fields.



Thanks.

* Sent from Devdex.com http://www.devdex.com The Web Developers Index *
The world's largest index site for web developers.

 
 
 

Using Query Results within Stored Procedure

Post by Mujahi » Mon, 02 Oct 2000 09:50:40


Hi


You can try something like this.



--
Mujahid Wazir
IQura Technologies Pvt. Ltd

 
 
 

Using Query Results within Stored Procedure

Post by Tom Morea » Tue, 10 Oct 2000 04:00:00


Try

SELECT



FROM
    MyTable
WHERE

    Tom

---------------
I'd like to perform a query within a stored procedure and then use 3 or 4 of
the fields from the returned recordset (consisting of only one row) from
that query in an action statement within the same sp. It's trivial to get a
single value (e.g. COUNT) but I need to use several of the fields.


but I'd like to find out if there's less tedious and more intuitive way of
doing this before I write dozens of them creating all of those cursors and
local variables.



Thanks.

* Sent from Devdex.com http://www.devdex.com The Web Developers Index *
The world's largest index site for web developers.

 
 
 

1. Using query results within a stored procedure

I am trying to create a stored procedure that runs a query on a large
database of points in an area.  In addition to the recordset of
points, I would like to return, in output parameters,  the average
latitude and longitude of the set of returned points in order to
generate a map that is centered around all the points.

This is a pseudo-code example of the query:

CREATE PROCEDURE GetPoints






SELECT Lat, Long, Picture
FROM PointDB


---- After running the query, I would like to query the result set
 SELECT AVG(Lat), AVG(Long)
    FROM [above recordset]

Is this possible?  A temporary table would work, but it seems
redundant.

Thanks,
Chuck

2. Help with genxtab.prg

3. Retrieving result from a stored procedure called within another stored procedure

4. Help!! How to refer a button not by calling its name?

5. How do I retrieve the results of a dynamic query within a store procedure

6. Cursors: Software versions

7. Reusing Query Result Rowsets within a Stored Procedure

8. OPS raw devices questions

9. Using stored procedures within stored procedures

10. using SQL stored procedure results in stored procedure

11. Using Stored Procedure's results in a Stored Procedure

12. Using the result from one stored procedure in a second stored procedure

13. Using Results Of Stored Procedure As Input Into Another Stored Procedure