snytax or logic problem?

I have attached the code and the question.
func.txt
1jawsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

skrgaCommented:
You shoul use
select dbo.getCode (@srcCode,@trgCode)  

Open in new window

.. in same call ..
0
1jawsAuthor Commented:
I am trying to get value from getCode function and use that value on gofind function as a parameters set to @src, and @trg .. so that doesnt work... when I say on this line select dbo.getCode (@srcCode)  as src ,  saying as src doesnt really help me at all.... I need to modify that code that, it will give me a value from getCode function as a @src and as a @trg
0
1jawsAuthor Commented:
how about like that? but that gives me snytax error of the  ')' for the first line...
update tblFind
	set Subject= dbo.gofind(@Subject,dbo.getCode (@srcCode), @src),dbo.getCode (@trgCode), @trg)),
	    Body = dbo.gofind(@Body,dbo.getCode (@srcCode), @src),dbo.getCode (@trgCode), @trg))
	where id = @id

Open in new window

0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

Scott PletcherSenior DBACommented:
You can't use a function call as a parameter to a function.

You would have to use a subquery to do the first function call, then use the results of that in an outer query to the other function call.
0
1jawsAuthor Commented:
how about like that?
alter PROCEDURE [dbo].[spMysp] 
   @id int,
   @orSubject nvarchar(255),
   @orBody nvarchar(max),
   @srcCode char(2),
   @trgCode char(2)
   
as
begin
 

declare @src varchar(10),
        @trg varchar(10)
        
 select @src = wlCode 			 				
		from tblcode
		where Code = @srcCode		
		
		select @trg = wlCode 			 				
		from tblcode
		where Code = @trgCode

	update tblFind
	set Subject= dbo.gofind(@Subject,@src,@trg),
	    Body = dbo.gofind(@Body,@src,@trg)
	where id = @id	
end

Open in new window

0
Scott PletcherSenior DBACommented:
declare @src varchar(10),
        @trg varchar(10)
       
select @src = dbo.getCode (@srcCode),
       @trg = dbo.getCode (@trgCode)

      update tblFind
      set Subject= dbo.gofind(@Subject,@src,@trg),
          Body = dbo.gofind(@Body,@src,@trg)
      where id = @id      
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
1jawsAuthor Commented:
thank you very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.