| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#11
| |||
| |||
| Lew wrote: > Lew wrote: >>>> String var1 = "Dianne''s horse"; >>>> String cmd = "UPDATE huxtable (descrip) VALUES ( '" + var1 + "' )"; >>>> // DO NOT EVER DO SQL IN THIS MANNER! >>>> // IT IS A SECURITY HOLE BIG ENOUGH TO COAST A TRUCK THROUGH! >>>> // USE PreparedStatement! > > Arne Vajhøj wrote: >> Besides the SQL looks very non standard. The standard is: >> >> INSERT INTO tbl VALUES(val); >> INSERT INTO tbl(fld) VALUES(val); >> UPDATE tbl SET fld=val; >> UPDATE tbl SET fld=val WHERE id=otherval; > > Actually, it's wrong, not non-standard. There is a 99.99% chance that it is wrong. But since the original poster did not say what database he was using, then I preferred just calling it "non standard" - some databases has some weird syntaxes. Arne |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.