aspose file tools*
The moose likes JDBC and the fly likes Syntax Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Syntax Error" Watch "Syntax Error" New topic
Author

Syntax Error

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
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


Thanks advance who ever answers this question.


regards
amit bhadre
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 86
>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");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Syntax Error
 
Similar Threads
SQL Dates
Problems with creating table in mysql through JSP
SQL Server limiting result set
deleting more than one rows sql
Exception in Microsoft ODBC driver