It looks like I haven't had my morning coffee.
My last response was wrong.
Only tno needs to be enclosed in single quotes and not entire where clause.
Also I agree with Margaret in that the fields in the GROUP BY should also
be present in the fields that are in the SELECT clause.
Regards,
Richard
At 08:53 AM 4/22/2002 -0700, you wrote:
>Halil,
>I assume that Taxnumber is a char or varchar field.
>Therefore the statement should be:
>String sql="SELECT FirstNname, LastName, TaxNumber, SUM(Debt) As
>Total FROM " + "Arsa_beyan WHERE 'TaxNnumber=" + tno + "' GROUP BY
>TaxNumber, Fname, Lname ";
>
>You need to put the WHERE clause inside single quotes.
>
>Regards,
>
>Richard
>
>At 06:38 PM 4/22/2002 +0300, you wrote:
>>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 ";
>
>___________________________________________________________________________
>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
>
___________________________________________________________________________
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