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: creating snapshot without constraints

Re: creating snapshot without constraints

From: Arun Mathur <themathurs_at_gmail.com>
Date: Fri, 21 Dec 2007 06:23:13 -0800 (PST)
Message-ID: <eb7846a8-7fcb-43c0-92ea-db62e44c9df0@f3g2000hsg.googlegroups.com>


On Dec 21, 5:28 am, amitabh.me..._at_gmail.com wrote:
> Hi
> Consider a test table - mytable:
>                        id        number   pk
>                        name   varchar2(20) not null,
>                        addr     varchar2(100) not null default 'local'
>
> I populated this table with some 200 test records.
> when I am trying to create snapshot using the following:
>
>                          create snapshot mytable_s refresh force as
> select * from test table;
>
> all works well.
> But in my requirement, i have something like if addr = 'local' then it
> should be null in the snapshot.
>
> So i tried something like:
>
>                          create snapshot mytable_s refresh force as
> select
>
> id,
>
> name,
>
> decode(addr, 'local', null)
>
> from test table;
>
> this throws error:   ORA-01723: zero-length columns are not allowed
>
> Is creating a snapshot without having the constraints of the table
> possible? if yes, how? please dont ask me to remove the not null
> constraint from addr field. I cant do it.
>
> Thanks in advance.

Hello,

What version of Oracle are you currently running?

Regards,
Arun Received on Fri Dec 21 2007 - 08:23:13 CST

Original text of this message

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