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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Is there any way we can exclude all possible values ?

Re: Is there any way we can exclude all possible values ?

From: Greg Norris <spikey.mcmarbles_at_gmail.com>
Date: Fri, 29 Dec 2006 09:48:28 -0600
Message-ID: <d4beff360612290748m74fc3085m44f17d4030ee6fa7@mail.gmail.com>


On 12/29/06, xiaoyan <xiaoyezi.xyz_at_163.com> wrote:
> Is there any way we can exclude all possible values to be assigned to a
> column in a table without knowing the type of the column ?

While I really don't see any point to this, something like the following should work...

SQL> create table test (

  2     col1 number(4) not null,
  3     col2 varchar2(10) constraint what_the_heck check (0=1)
  4 );

Table created.

SQL> insert into test values (1, 'test'); insert into test values (1, 'test')
*
ERROR at line 1:
ORA-02290: check constraint (SYSTEM.WHAT_THE_HECK) violated

SQL> insert into test values (1, NULL);
insert into test values (1, NULL)
*
ERROR at line 1:
ORA-02290: check constraint (SYSTEM.WHAT_THE_HECK) violated

-- 
"I'm too sexy for my code." - Awk Sed Fred.
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 29 2006 - 09:48:28 CST

Original text of this message

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