
February 6th, 2001, 09:07 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
|
<i><b>Originally posted by : moz (jgraham@wilcom.com.au)</b></i><br />Hi Paul,<br /><br />This may help you, I have a query that calls a function that I created in its select clause. <br />Maybe it is the syntax of your call (may need the dbo. qualifier) or your procedure may need to be created as a function.<br /><br />The function is: <br /><br />CREATE FUNCTION fConvertMMsToInches(@fltMMs float)<br />RETURNS float<br />AS<br />BEGIN<br /> DECLARE @fltInches float<br /> SET @fltInches = @fltMMs / 25.4<br /> RETURN(@fltInches)<br />END<br /><br />to call this is a query:<br /><br />select A, B, C, <br />dbo.fConvertMMsToInches(D.fWidth)) as "WidthInches"<br />from SOMETABLE<br /><br />Hope this helps<br /><br />------------<br />Paul at 12/24/2000 1:33:03 PM<br /><br /><br />i'm trying to do a query where one of the selected fields is the result of a stored procedure. The inputs of the stored procedure are one of the returned values from the query... confused yet??<br /><br />example<br /><br />I have the stored proced my_sp @in1<br /><br />I have a query that needs to work something like this<br /><br />Select<br /> A,<br /> B,<br /> C,<br /> D = ( exec @my_sp A )<br />From<br /> SomeTable<br /><br />anyhow, this doesn't seem to work... the stored procedure is far too complex to just embed in the select clause... is there anyway to do this???<br /><br />
|