This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Syntax Error  RSS feed

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code of query is as follows....


resultSet=statement.executeQuery("select Candidate_id,Candidate_Interview_Date ,Candidate_Interview_Result,Candidate_Interviewer_Name,Candidate_Feedback from CANDIDATE_INTERVIEW_RECORD inner join cms_candidate on cms_candidate.'"+CandidateID+"' = CANDIDATE_INTERVIEW_RECORD.'"+CandidateID+"'");

Error:

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '189'.

Here I am passing 189 as string to CandidateID variable.

thanks in advance if u tell correct syntax please.

regards
amit bhadre
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

cms_candidate.'"+CandidateID+"' = CANDIDATE_INTERVIEW_RECORD.'"+CandidateID+"'");



This looks strange. Are you trying to dynamically set the attributes you're comparing? But that wouldn't be named '189', right? Even if it was, the single quotes are incorrect there.
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>on cms_candidate.'"+CandidateID+"' = >CANDIDATE_INTERVIEW_RECORD.'"+CandidateID+"'");
Maybe you should use on cms_candidate.CandidateID= ANDIDATE_INTERVIEW_RECORD.CandidateID WHERE cms_candidate.CandidateID="+CandidateID");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!