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 -> Inserting through a view - forcing certain values into columns

Inserting through a view - forcing certain values into columns

From: Jeremy <jeremy0505_at_gmail.com>
Date: Mon, 12 Mar 2007 11:31:35 -0000
Message-ID: <MPG.205f4a69f66dda4198a3f2@news.individual.net>

Hi

Say you have a table:

create table mytab
(id number,

 name varchar2(30),
 filter_col varchar2(1));

Then you create a view on this

create or replace view mytab_v
as
(select *

 from mytab
 where filter_col = 'Y');

insert into mytab_v (id, name, filter_col) values (1, 'xxx','N');

I was wondering whether, on inserting a row via the view, the filter_col would automatically be given the value 'Y' or that if another value was supplied that some kind of implicit constraint might be violated. This doesn't appear to be the case, but is it possible to implement a view in such a way that such validation would be performed?

-- 
jeremy

 ============================================================
   ENVIRONMENT:                                             
   Oracle 9iR2 / Oracle HTTP Server / mod_plsql / Solaris 8 
 ============================================================
Received on Mon Mar 12 2007 - 06:31:35 CDT

Original text of this message

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