dbTalk Databases Forums  

transformation question

comp.database.oracle comp.database.oracle


Discuss transformation question in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
steve
 
Posts: n/a

Default transformation question - 02-11-2005 , 11:30 AM






i have an auditing table that tracks field level changes to a record for any
given table. i'm trying to make a query (and need help) that takes entries
in the auditing table and puts them into a similar structure as the table
the audit represents...showing the changes to a record over time. any help
or suggestions would be great. here's what i'm trying to get to:

foo
"field1" "field2" "field3" "date"

"a" "b" "c" "11-feb-2005"
"z" "12-feb-2005"
"j" "13-feb-2005"

here's the table structure for the audit table:

auditing table..

company
tableid
fieldid
recordid
value
userid
stamp (date)

any table "foo"...

field1
field2
field3

gets new records stored in the audit table like this:

foo=

"a" "b" "c"

auditing=

"mycompany" "foo" "field1" "a" "a" "jblow" "11-feb-2005"
"mycompany" "foo" "field2" "a" "b" "jblow" "11-feb-2005"
"mycompany" "foo" "field3" "a" "c" "jblow" "11-feb-2005"

if i edit record "a" and change only one field (field3 a day later) the
auditing table would look like this:

"mycompany" "foo" "field1" "a" "a" "jblow" "11-feb-2005"
"mycompany" "foo" "field2" "a" "b" "jblow" "11-feb-2005"
"mycompany" "foo" "field3" "a" "c" "jblow" "11-feb-2005"
"mycompany" "foo" "field3" "a" "z" "szque" "12-feb-2005"

if i edit record "a" and change only one field (field2 a day later) the
auditing table would look like this:

"mycompany" "foo" "field1" "a" "a" "jblow" "11-feb-2005"
"mycompany" "foo" "field2" "a" "b" "jblow" "11-feb-2005"
"mycompany" "foo" "field3" "a" "c" "jblow" "11-feb-2005"
"mycompany" "foo" "field3" "a" "z" "szque" "12-feb-2005"
"mycompany" "foo" "field2" "a" "j" "szque" "13-feb-2005"



Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.