473,545 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving Result Set from Dynamically called Stored Procedure or function in a Function

Is there any way I can retrieve the result set of a Stored Procedure
in a function.

ALTER FUNCTION dbo.fn_GroupDev iceLink
@groupID numeric
RETURNS @groupDeviceLin k TABLE (GroupID numeric, DeviceID numeric)
Declare @command nvarchar(255)

SELECT @command = Condition
// @command is an SQL string or stored procedue name
FROM DeviceGroup
WHERE GroupID = @groupID

INSERT @groupDeviceLin k
EXEC @command


Is there any way i can do anything like this. @command is a variable
holding the name of a stored produre. I need to run that stored
procure and return the values in such a way that they can be used in a
SELECT Statement

My goal is SELECT * FROM Device INNER JOIN
dbo.fn_GroupDev iceLink(@groupI D) ON ....

this fn_GroupDeviceL ink should run the proper stored procedure and
return the values. What i also want to do is play with that result set
of the specific stored procedure before i return it. Is this possible?
If not, what is the work arround?


Jul 20 '05 #1
0 1604

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Mark Oueis | last post by:
Is there any way I can retrieve the result set of a Stored Procedure in a function. ALTER FUNCTION dbo.fn_GroupDeviceLink ( @groupID numeric ) RETURNS @groupDeviceLink TABLE (GroupID numeric, DeviceID numeric) AS BEGIN
by: bsandell | last post by:
I need to write a stored procedure to verify that a table exists and also that the user executing the stored procedure has access to the specified table. Any user can call this publicly available procedure and pass a database name, an owner name and a table name as parameters. The procedure returns success if the table exists and the user...
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will not work. I've been trying to get this to work with converting the UDF to a procedure, but I'm having no luck. Here is the background on what I'm...
by: Erik Hendrix | last post by:
Hi, Using UDB 8.2 there is a procedure called get_db_config. What I would like to do is to retrieve a certain value from the DB Config in a SQL Statement. To give some more detail, I created a view which will show me my complete bufferpool configuration. However, now with V8.2 I would like to show the value from BUFFPAGE for the size of...
by: Wojciech Wendrychowicz | last post by:
Hello to All, I'm trying to retrieve records from AS/400 in an VBA application. So, I've made an RPG program, then a stored procedure wchich calls that RPG program, and finally some VBA code to call the stored procedure and retrieve data from AS/400. The problem is, that when I finally run my VB code, it just hangs. But when I call the same...
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use). I then change dynamically the connection string by doing : My.Settings.Item("ConnectionString") = "some connection sring" The problem is that if...
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a data access layer, which contists of separate servicebases for each object within my database. CompanyDataService (contains CRUD methods)...
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio and run it once you've made sure there is no harmful code. Currently we have several stored procedures which final result is a select with several...
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done with moderate success using Saxon and <xsl:result-document>, but Saxon is throwing an error and I don't know how to resolve it. Maybe someone can offer...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.