This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes SQL Script to delete the records based on length Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Script to delete the records based on length" Watch "SQL Script to delete the records based on length" New topic
Author

SQL Script to delete the records based on length

sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,

I am looking for the SQL Script to delete the name whose length is less than 4 characters.

regards
sudha
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2504
    
    8

mysql example (be carefull when testing!)
Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,
I am using database as Oracle.
regards
sudha
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30795
    
157

Sudha,
That SQL will work in Oracle too.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
Sudha,

Do you want to update the name to be null (remove it) where it is less than 4 or do you want to delete the row where the name is less than 4?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2504
    
    8

I derived from the post's title that it was a request to delete them.
Regards, Jan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Script to delete the records based on length