Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting this error when trying to s

Status
Not open for further replies.

extempore

Programmer
Jun 1, 2001
71
US
getting this error when trying to send 3 arguments while calling the procedure in sybase -com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near '@p0'

getting this while removing the arguments and sending nothing...the sybase procedure has the hard coded arguements now - com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near ')'.

can anyone tell me what the problems is? thanks.

Extempore
 
you are probably missing a comma or apostrophe from your SQL, but we can't tell until you show us the statment causing the error.
 
Here is the code:

CallableStatement sp = connection.prepareCall("{ CALL p_vos_ repair_followup() }");

sp.execute();

throws
com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near ')'

*****************************************************
CallableStatement sp = connection.prepareCall("{ CALL p_vos_ repair_followup(?,?,?) }");

sp.setString(1, "EU-R223");
sp.setString(2, "EU-223");
sp.setString(3, "EU");

sp.execute();


throws

com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near '@p0'


either way i get the error.
 
Seems alright to me except that for callablestatements, we normally use executeUpdate() or executeQuery(), but then I guess it won't make much of a difference...

Are you 100% sure this is the part of the coding that is causing the problem?
 
Yeah positive...this is the place where the problem occurs...rest of the other procedures work perfectly and i dont have a clue whats with this one...i have seen the same error posted by another guy but apparently he did not get a response either...his posting is in the deja.com link :


Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top