Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 where is error in my function

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-07-23 : 05:07:47
dear folks,
please check my function i'm getting error like this

Select statements included within a function cannot return data to a client.

create function getuomid(@uomcode varchar(50))
returns varchar
as begin
declare @uom_id varchar(50)
select uom_id from vuom where uom_code=@uomcode
return @uom_id
end
go

Vinod
Even you learn 1%, Learn it with 100% confidence.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-23 : 05:12:44
[code]CREATE FUNCTION getuomid(@uomcode varchar(50))
RETURNS varchar(50)
AS
BEGIN
DECLARE @uom_id varchar(50)
SELECT @uom_id = uom_id FROM vuom WHERE uom_code = @uomcode
RETURN @uom_id
END[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-23 : 05:13:15
create function getuomid(@uomcode varchar(50))
returns varchar
as begin
declare @uom_id varchar(50)
select @uom_id = uom_id from vuom where uom_code=@uomcode
return @uom_id
end


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-23 : 05:13:31



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-23 : 05:14:53
[code]SELECT COUNT = COUNT + 1[/code]



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-07-23 : 05:40:22
thank you KH and Peso

Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -