Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Records are still in my sql database after I delete them
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
AMABITxS
n00b
n00b


Joined: 12 Aug 2004
Posts: 24
Location: Goldsboro, NC

PostPosted: Wed Feb 01, 2006 8:54 pm    Post subject: Records are still in my sql database after I delete them Reply with quote

I have a data base that uses the SSN of my employees as the primary key. A week ago the computer locked up while I was in the middle of updating two records, and now when I search for the SSN of employeeA, I get the record from employeeB. For example

SELECT * FROM Employee WHERE (((Employee.SSN)="123-45-6789"));

Returns the record for EmployeeA. Since 123-45-6789 is EmployeeA's SSN that is fine, but

SELECT * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));

where 987-65-4321 is EmployeeB's SSN still returns the record for EmployeeA.


I deleted both records by using the delete commands:

DELETE * FROM Employee WHERE (((Employee.SSN)="123-45-6789"));
DELETE * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));

and then I re-added EmployeeA. But I still have the same problem. Only now when I select for EmployeeB's SSN (who's record has not been re-added).

SELECT * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));

I get a record that returns with all feilds reading "#Deleted" (even the SSN feild)


I did not build this database, I just inherited it from someone who left a while ago, and I am really a novice when it comes to db management.

Does anyone have any Ideas to fix my database?
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Wed Feb 01, 2006 10:02 pm    Post subject: Reply with quote

- what kind of a database server: MySQL, Oracle, PostGres, what ?
- where did you learn SQL ;-)
- have you examined the database schema ?
- is it (supposed to be) fully transactional ?
- if so, what does the transaction log say ?
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Feb 01, 2006 10:15 pm    Post subject: Re: Records are still in my sql database after I delete them Reply with quote

AMABITxS wrote:
A week ago the computer locked up while I was in the middle of updating two records, and now...

Look at the docs for your particular DBMS, regarding repairing the database files - it sounds like database corruption.
Back to top
View user's profile Send private message
AMABITxS
n00b
n00b


Joined: 12 Aug 2004
Posts: 24
Location: Goldsboro, NC

PostPosted: Wed Feb 01, 2006 10:30 pm    Post subject: Reply with quote

Ok, thanks guys. I'll let you know what I find.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum