This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Retrieve changed values from audit table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Retrieve changed values from audit table" Watch "Retrieve changed values from audit table" New topic
Author

Retrieve changed values from audit table

saivenu madhav
Greenhorn

Joined: Nov 15, 2007
Posts: 29
Hi

I have audit table for each table, like USERS table audit table is USERS_ADT table which has all changes for each record in USERS table

I need to get only changed values for USERS table from USERS_ADT.

lets suppose, i have fields called firstname,lastname & email in USERS table.

i have fields in USERS_ADT are firstname,lastname & email & lastupdate


Depends on lastupdate value,


i want the following values

field newvalue oldvalue updateddate

firstname "madhav" "ram" "13-oct-08"
lastname "changala" "kothha" "14-oct=08"
email "madaj@gai.com" "asda@tcs.com" "15-oct-08"


Could you any get the solution for this

Regards
Madhav
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Could you any get the solution for this
It can't be done this way. There is no foreign key in the audit table that shows what record in your user table has been changed.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieve changed values from audit table
 
Similar Threads
Help with Send Email on submit
Insert Query using select statement
Search on the tables created by ebjs are case sensitive! Why?
Better sql statement?
Regarding HTML Form