Either change your query to "...WHERE TaxNumber='" + tno + "'..."  where you are including single quotes within the double quotes or "...WHERE TaxNumber=?..." and replace "?" with "tno" in a prepared statement.  See java.sql.* for more info.
 
Mark
-----Original Message-----
From: Halil AKINCI [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject: sql statement

Hi,
 
I have a servlet that gets a parameter from a HTML form and execute a query. But my sql statement incorrect. I think following red part should be changed.
Can anyone check it?
-------------------------------------------------------------------------
.
.
String tno = request.getParameter("vergi_numaras�");
.
.
.
String sql="SELECT  FirstNname, LastName, TaxNumber, SUM(Debt) As Total  FROM " +     
  "Arsa_beyan WHERE TaxNnumber=tno GROUP BY TaxNumber, Fname, Lname ";

Reply via email to