aspose file tools*
The moose likes JDBC and the fly likes delete sql not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "delete sql not working " Watch "delete sql not working " New topic
Author

delete sql not working

bhavin ragha
Greenhorn

Joined: Mar 28, 2012
Posts: 17
trying to delete all information relating to cd005

im putting in the statement below. But i get the error: near ",": syntax error... (im using sqlite)

delete from cds, bands, band_members, releases
where band_members.band_id = bands.band_id
and band_members.band_id = releases.band_id
and cds.cd_id = releases.cd_id
and cds.cd_id = 'cd005'

when i change delete to select * i get the values that i want to delete.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

You can only delete rows from one table using the SQL DELETE statement.
bhavin ragha
Greenhorn

Joined: Mar 28, 2012
Posts: 17
Paul Clapham wrote:You can only delete rows from one table using the SQL DELETE statement.


so how do i delete all data relating to cd005
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

One table at a time.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 498
Or if you are allowed to set cascade delete option.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: delete sql not working
 
Similar Threads
Why Just run in my PC ?
gui question
Head First Servlets: Beer Problem
package java.nio.file does not exist
Syntax error on Tokens delete these tokens???