hi folks,

     Sorry for bit off topic question, but i hope somebody
     can thru light on it!.

     I have problem on setting String values in the
     prepared statement.I have a sql statement
     somthing like,

      "insert into TableName (Name, Age, ?,?, Sponser_Name,
       Sponser_country)  select tbl.Name,tbl.Age,tbl.Address1,
      tbl.Address2, tbl.Sponser_Name,tbl.Sponser_country from
      tbl";

       (This is to copy data form one table to another table)

      here i want to set the coloumn name at run time by using
      prepareStatement setString. but i am getting exception
     "syntax error in INSERT INTO statement" when execute
     the query.

    so how could i set the values using setString? FYI, setString
    of prepareStatement works when the '?' appears in the
    'where' clause.

thanks for your time,

with regards,
           rathna.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to