----- Original Message -----
From: "Halil AKINCI" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 4:38 PM
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 ";
The difficulty you are having is that your string uses the variable's name
rather than its value.
try this:
String sql="SELECT FirstNname, LastName, TaxNumber, SUM(Debt) As Total
FROM " +
"Arsa_beyan WHERE TaxNnumber='" + tno + "' GROUP BY TaxNumber, Fname,
Lname ";
HTH
Alex
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html