aspose file tools*
The moose likes JDBC and the fly likes is it possible to delete record from sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "is it possible to delete record from sql" Watch "is it possible to delete record from sql" New topic
Author

is it possible to delete record from sql

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
Im new to most of this ,so please bare with me. I have a table
with email addresses. And I would like to delete a record if it
is no longer in use. How would I write this would it be something like this "DELETE [Email Address] FROM [Email Addresses] WHERE
[Email Address] LIKE '" + emailString + "'";
Thank u for your time
Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
Almost
delete from email_addresses where email_address = 'xxxx'
Use = if you can instead of like.
Dan
Pranit Saha
Ranch Hand

Joined: Sep 09, 2001
Posts: 130
int rowsAffected = stat.executeUpdate("delete from emailaddres where userid = " + emailstring);
Assuming that stat is the Statement Object and emailstring stores that emailid what u want to delete..
Thanks..
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Pranit Saha:
int rowsAffected = stat.executeUpdate("delete from emailaddres where userid = " + emailstring);
Assuming that stat is the Statement Object and emailstring stores that emailid what u want to delete..
Thanks..

you mean:
int rowsAffected = stat.executeUpdate("delete from emailaddres where userid = '" + emailstring + "'");
right?
Jamie
 
Consider Paul's rocket mass heater.
 
subject: is it possible to delete record from sql