SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Get function params with "SELECT"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nowy
Yak Posting Veteran

57 Posts

Posted - 06/08/2007 :  04:45:08  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 06/08/2007 :  04:48:23  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
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)

Singapore
17598 Posts

Posted - 06/08/2007 :  04:53:13  Show Profile  Reply with Quote
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 - 06/08/2007 :  05:00:13  Show Profile  Reply with Quote
I want to get te params for the function "Interpolate" with an "Select" query
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 06/08/2007 :  05:50:39  Show Profile  Visit spirit1's Homepage  Reply with Quote
-- 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
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 06/08/2007 :  05:54:54  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
Very elegant!

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000