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

Home -> Community -> Usenet -> c.d.o.tools -> Re: /dev/null for Oracle?

Re: /dev/null for Oracle?

From: Stephan Born <stephan.born_at_beusen.de>
Date: 2000/05/23
Message-ID: <392A484E.9A52B70C@beusen.de>#1/1

> Hello,
>
> I want to get rid of a table which is filled (but never used) by an
> application I cannot change. How can I redirect the insert statements to
> '/dev/null' ? Would be an 'INSTEAD OF' trigger a solution?
>
> Thanx, Peter

Try the following:

create table dummy
(
 dummy varchar2(1)
);

create or replace view my_null_dev as
select
 to_number(null) c1,
 to_char(null) c2
from dummy;

using DUAL will not work because you have to grant insert rights on dual......bad idea!
Therefore create a dummy-table and a view on that table which consist of the

wanted columns .

create trigger trg_ins_my_null
instead of insert on my_null_dev
for each row
begin
 null;
end;

/

This trigger will do....nothing :o)

Now you can see, that there is nothing in the 'table' before and after the insert....

select * from my_null_dev

insert into my_null_dev
values (2, 'hallo');

select * from my_null_dev

Let me know, if this is a valid solution for your problem..

Regards, Stephan

--
---------------------------------------------------------------
Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-21          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------
Received on Tue May 23 2000 - 00:00:00 CDT

Original text of this message

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