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.
| Author |
Topic |
|
kam
Starting Member
17 Posts |
Posted - 2006-03-16 : 15:43:12
|
| Is the only way to do this by returning a table, or can I just return three seperate values? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-03-16 : 15:47:38
|
| You can return 3 separate values if you concatenate them into one value. A scalar function means to return a single value. A table function means to return a result set. What do you want to do with the 3 values? With your answer, we can steer you into the best UDF choice.Tara Kizeraka tduggan |
 |
|
|
kam
Starting Member
17 Posts |
Posted - 2006-03-16 : 15:52:20
|
| I'm trying to create a function which calculates the cross product of a two sets of vector values. My input would be Ai,Aj,Ak and Bi,Bj,Bk and the output would be Zi,Zj,Zk. |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-03-16 : 16:18:18
|
| In ur function find the Cross product and get the calculated vector as a varchar of Zi + Zj + Zk (eg : 4i + 5k - 7k)Return it as a Varcharie. '4i + 5k - 7k'and in ur front end application deal with coefficients of i,j & k seperately |
 |
|
|
kam
Starting Member
17 Posts |
Posted - 2006-03-16 : 16:28:20
|
| I need to deal with the returned vector using a procedure - if i return it as a varchar, will there be an easy way to break it back up in to three indivisual values? |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
|
|
kam
Starting Member
17 Posts |
Posted - 2006-03-16 : 20:05:06
|
| Thanks for your suggestions.I've decided to use a table, it seems to be the most efficient of options available.KAm |
 |
|
|
|
|
|
|
|