Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: tracking changes on a table through ODBC application

Re: tracking changes on a table through ODBC application

From: Anton Buijs <remove_aammbuijs_at_xs4all.nl>
Date: Thu, 17 Jul 2003 22:33:42 +0200
Message-ID: <3f17080a$0$49099$e4fe514c@news.xs4all.nl>


db dude <db_guy_2002_at_yahoo.com> schreef in berichtnieuws 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

Just an idea, don't know if it can work because I have never worked with pipes, just know of the existence.
A trigger on the table could write to a pipe (see dbms_pipe package description in the "Supplied PL/SQL Packages Reference). Your program just reads the pipe.
I think you can make it sit and wait till a message arrives in the pipe. That is what you want don't you?
Be aware of the fact that any other program can read the same pipe at the same time. Once a program has read it, it's gone. Pipes are "independent on transactions", that means when the trigger writes the pipe and the transaction is rolled back, the pipe message is not removed. You suggest that you want this. Received on Thu Jul 17 2003 - 15:33:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US