473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Storing return type from a function

1
Hi
I have one function returning TABLE and I want to save the value returned by this function into a stored procedure to reuse later.

Function:
CREATE or replace FUNCTION list_to_tbl (@list nvarchar(MAX))
RETURNS @tbl TABLE (ename varchar2 NOT NULL) AS
BEGIN
....

Stored Procedure:
REATE PROCEDURE testme1 @ids varchar(50) AS
declare @mytable TABLE
set @mytable= list_to_tbl((@ids)
------------
-----------

But I am not able to set the value as getting error at statement :
set @mytable= list_to_tbl((@ids)
The MS SQL server is expecting a built-in function not an user defined one.
Please help...
Jul 10 '07 #1
1 1888
Infide
28
Hi
I have one function returning TABLE and I want to save the value returned by this function into a stored procedure to reuse later.

Function:
CREATE or replace FUNCTION list_to_tbl (@list nvarchar(MAX))
RETURNS @tbl TABLE (ename varchar2 NOT NULL) AS
BEGIN
....

Stored Procedure:
REATE PROCEDURE testme1 @ids varchar(50) AS
declare @mytable TABLE
set @mytable= list_to_tbl((@ids)
------------
-----------

But I am not able to set the value as getting error at statement :
set @mytable= list_to_tbl((@ids)
The MS SQL server is expecting a built-in function not an user defined one.
Please help...
Try this:
DECLARE @mytable Table (field1 varchar(2))

INSERT INTO @mytable
SELECT ename
FROM list_to_tbl(@ids)
Jul 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
14
by: David M. Wilson | last post by:
Further to my last post here, I was playing some more with building a regex object and storing it somewhere for use internally by a function. I'm not happy with any of my solutions: # I don't...
1
by: jason | last post by:
Hello. I'm working with ASP.NET serverside and am looking for an easy way to retain scroll position of the window. Is there any way that a hidden form field could *always* have the current...
4
by: matevz bradac | last post by:
Hi, I'm trying to implement delayed function execution, similar to OpenGL's display lists. It looks something like this: beginList (); fcn1 (); fcn2 ();
8
by: psema4 | last post by:
Hi all, I've spent several days trying to work this out. Maybe I'm just searching for the wrong keywords/phrases. I have some code that looks like: Console = new Object(); Console.init...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
10
by: deciacco | last post by:
I'm writing a command line utility to move some files. I'm dealing with thousands of files and I was wondering if anyone had any suggestions. This is what I have currently: $arrayVirtualFile =...
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
3
by: mk | last post by:
Hello everyone, I'm storing functions in a dictionary (this is basically for cooking up my own fancy schmancy callback scheme, mainly for learning purpose): .... return "f2 " + arg .......
0
by: Calvin Spealman | last post by:
On Thu, Jul 17, 2008 at 7:45 AM, mk <mrkafk@gmail.comwrote: As was pointed out already, this is a basic misunderstanding of assignment, which is common with people learning Python. To your...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.