Error in stored procedure

Posted by Saritha.rajeshkumar under C# on 5/12/2011 | Points: 10 | Views : 1320 | Status : [Member] | Replies : 1
hi, this is saritha
i wrote stored procedure to search

ALTER proc [dbo].[sp_select_employersjobssearch]
(
@keywords varchar(50),
@category varchar(50),
@role varchar(50),
@location varchar(50),
@experience varchar(50)
)
as
begin
select jr.ResumeHeadlines,ld.JobseekerID,jbd.HighestDegree,jbd.Specialization,jpd.EmailId,jpd.Mobileno,jts.Skill1,jts.Skill2,jts.Skill3,jts.Skill4,jbd.WorkField,jjd.JobTitle,jjd.Location1,jjd.Location2,jbd.TechnicalExp from
Logindetails as ld inner join
JobSeekersResume as jr on jr.JobseekerID=ld.JobseekerID inner join
jobseekersbackgrounddetails as jbd on ld.JobseekerID=jbd.JobseekerID inner join
jobseekerspersonaldetails as jpd on jpd.JobseekerID=jbd.JobseekerID inner join
jobseekersjobdetails as jjd on jjd.JobseekerID=jpd.JobseekerID inner join
jobseekerstechnicalskills as jts on jts.JobseekerID=jjd.JobseekerID
where
jts.Skill1=@keywords
jts.Skill2=@keywords
jts.Skill3=@keywords
jts.Skill4=@keywords and
jbd.WorkField=@category and
jjd.JobTitle=@role and
jjd.Location1=@location
jjd.Location2=@location and
jbd.TechnicalExp=@experience
end

it is giving error "Incorrect syntax near 'jts'."




Responses

Posted by: Vanchi050585 on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
hi saritha,

you have to write query with single quote for varchar. like below

ALTER proc [dbo].[sp_select_employersjobssearch]
(
@keywords varchar(50),
@category varchar(50),
@role varchar(50),
@location varchar(50),
@experience varchar(50)
)
as
begin
select jr.ResumeHeadlines,ld.JobseekerID,jbd.HighestDegree,jbd.Specialization,jpd.EmailId,jpd.Mobileno,jts.Skill1,jts.Skill2,jts.Skill3,jts.Skill4,jbd.WorkField,jjd.JobTitle,jjd.Location1,jjd.Location2,jbd.TechnicalExp from
Logindetails as ld inner join
JobSeekersResume as jr on jr.JobseekerID=ld.JobseekerID inner join
jobseekersbackgrounddetails as jbd on ld.JobseekerID=jbd.JobseekerID inner join
jobseekerspersonaldetails as jpd on jpd.JobseekerID=jbd.JobseekerID inner join
jobseekersjobdetails as jjd on jjd.JobseekerID=jpd.JobseekerID inner join
jobseekerstechnicalskills as jts on jts.JobseekerID=jjd.JobseekerID
where
jts.Skill1='@keywords'
jts.Skill2='@keywords'
jts.Skill3='@keywords'
jts.Skill4='@keywords' and
jbd.WorkField='@category' and
jjd.JobTitle='@role' and
jjd.Location1='@location'
jjd.Location2='@location' and
jbd.TechnicalExp='@experience'
end


Check it.

Thanks
tvn

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response