Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: tracking changes on a table through ODBC application
"db dude" <db_guy_2002_at_yahoo.com> wrote in message news:f4a8da28.0307161718.395202f7_at_posting.google.com...
> I have a table in which users are inserting records almost all the
> time. I need to write an ODBC based application program that would
> allow me to see what data is being inserted into the table in real
> time.
>
> One idea is to run a select query on the table (select * from table)
> once, keep the resultset open throughout the lifetime of the
> application, and then do SQLFetch() to get each new row that has been
> inserted into the table.
>
> My question is weather it is possible to keep the resultset open and
> see changes from other users in that result set. Can this be done
> using a cursor?
>
> Thanks
Nope. Won't work. Just add two columns (create_date, last_mod_date) to the tables and have them populated via a trigger. That way you can find out new additions and modifications.
Is there a reason behind all this madness you are trying or are we just being curious out here? If its just curiosity: You can do some redo log mining to figure this thing out. But ODBC ... nope ... you do a select and Oracle gets you the data present in that table at that point in time. Its not like you can just keep fetching and Oracle will keep getting you the new data.
Not only Oracle, I don't think you can do this in most other databases.
Anurag Received on Wed Jul 16 2003 - 22:13:08 CDT
![]() |
![]() |