LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2004, 07:42 PM   #1
keikun_naruchan
LQ Newbie
 
Registered: Feb 2004
Distribution: Suse, LFS(Linux From Scratch)
Posts: 20

Rep: Reputation: 0
Exclamation Sql Problem (java Program)


Let s say I hava a Microsoft Access database saved as employee.mdb
In the employee database I have a table name Employee with fields such as emp_id, emp_name, emp_title and so on..

Lets say i have this ff data stored:

Record 1:

emp_id = 123
emp_name = johann
emp_title = trainee

Record 2:

emp_id = 234
emp_name = johann
emp_title = trainee

NOTE: my emp_id is always unique, it is my primary key..
All the data is saved only in one table named Employee

If i want to delete record 1. what should be my SQL?

I think it should be..
(Delete * where emp_id = 123

but im not sure.. HOPE YOU GUYS OUT THERE COULD HELP ME..
TNANKS FOR ANY SUGGESTION YOU COULD GIVE ME
 
Old 06-03-2004, 10:19 PM   #2
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
Close. It should be:

Code:
DELETE FROM Employee WHERE emp_id=123;
If you want to delete all rows from the table, just do:

Code:
DELETE FROM Employee;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
embedding sql in java pranith Programming 3 04-09-2010 09:08 AM
java.lang.InstantiationException: java.sql.Connection poeta_boy Programming 2 07-06-2005 08:26 PM
Java/M$ SQL Server SLaCk_KiD Linux - Software 1 12-19-2004 10:03 AM
java code executing SQL statements problem randomx Programming 1 11-09-2004 10:59 AM
Problem calling linux program from Java spasco Programming 3 04-25-2004 12:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration