dcsimg
UPDATE PROBLEMS IN JSP
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Charlotte_Endresen
Posted On:   Tuesday, April 3, 2001 06:42 AM

Seems to be some problems with parentheses. There are to few of them, dont know where to put them. stmt.executeUpdate("UPDATE kunde SET KFORNAVN=('"+request.getParameter("Fornavn") +"', KMellomnavn = '"+request.getParameter("Mellomnavn")+"', KETTERNAVN = '"+request.getParameter("EtterNavn") +"', KADRESSE = '"+request.getParameter("Adresse")+"', KTLF ='"+request.getParameter("Tlf") +"', KMOB_TLF = '"+request.getParameter("Mob") +"', K_EPOST = '"+request.getParameter("Epost")+"', POSTNR = '"+request.getParameter("Postnr") +"', AKTIV = '"+ "" + "'" + "' WHERE KNR = ('"+reques   More>>

Seems to be some problems with parentheses. There are to few of them, dont know where to put them. stmt.executeUpdate("UPDATE kunde SET KFORNAVN=('"+request.getParameter("Fornavn") +"', KMellomnavn = '"+request.getParameter("Mellomnavn")+"', KETTERNAVN = '"+request.getParameter("EtterNavn") +"', KADRESSE = '"+request.getParameter("Adresse")+"', KTLF ='"+request.getParameter("Tlf") +"', KMOB_TLF = '"+request.getParameter("Mob") +"', K_EPOST = '"+request.getParameter("Epost")+"', POSTNR = '"+request.getParameter("Postnr") +"', AKTIV = '"+ "" + "'" + "' WHERE KNR = ('"+request.getParameter("KNR" )+"')"); Thank you

   <<Less

Re: UPDATE PROBLEMS IN JSP

Posted By:   Robert_Crowley  
Posted On:   Tuesday, April 3, 2001 08:59 PM

It looks like it is a problem with your parentheses. To troubleshoot, try
setting the sql statement in a String, and pass the variable to
the executeUpdate method: Example:

String a="UPDATE kunde SET KFORNAVN='"+request.getParameter("Fornavn") +"',
KMellomnavn = '"+request.getParameter("Mellomnavn")+"', KETTERNAVN
= '"+request.getParameter("EtterNavn") +"', KADRESSE =
'"+request.getParameter("Adresse")+"', KTLF
='"+request.getParameter("Tlf") +"', KMOB_TLF =
'"+request.getParameter("Mob") +"', K_EPOST =
'"+request.getParameter("Epost")+"', POSTNR =
'"+request.getParameter("Postnr") +"', AKTIV = '"+ "" + "'" + "' WHERE
KNR = '"+request.getParameter("KNR" );

stmt.executeUpdate(a);

The above should work. You had too many parentheses,
SET KFORNAVN=('"+ //you do not need this parentheses
and
KNR = ('"+request.getParameter("KNR" )+"')");
//you do not need these parentheses, only the ones
//holding the request object.
About | Sitemap | Contact