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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Get function params with "SELECT"

Author  Topic 

Nowy
Yak Posting Veteran

57 Posts

Posted - 2007-06-08 : 04:45:08
Why doesn't work this?

SELECT * FROM dbo.Interpolate
(
(SELECT TOP 1 C4, C5, C6, C7, C8, C9, C10, C11, C12 FROM Test)

)

I get the following errors:
sg 116, Level 16, State 1, Line 30
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Msg 313, Level 16, State 3, Line 30
An insufficient number of arguments were supplied for the procedure or function dbo.Interpolate.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-08 : 04:48:23
Table-valued parameters for procedure/function are not supported in SQL 2000/2005.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-08 : 04:53:13
what are you trying to do ?
this ?

SELECT * FROM
(SELECT TOP 1 C4, C5, C6, C7, C8, C9, C10, C11, C12 FROM Test ORDER BY C4) AS Interpolate



KH

Go to Top of Page

Nowy
Yak Posting Veteran

57 Posts

Posted - 2007-06-08 : 05:00:13
I want to get te params for the function "Interpolate" with an "Select" query
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-08 : 05:50:39
-- declare variables

SELECT TOP 1 @c4 = C4, @c5 = C5, @c6 = C6, @c7 = C7, @c8 = C8, @c9 = C9, @c10 = C10, @c11 = C11, @c12 = C12
FROM Test

SELECT * FROM dbo.Interpolate
(
@c4, ... , @12
)

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-08 : 05:54:54
Very elegant!

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -