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: Database copy question 2 ..(HELP!!!)

Re: Database copy question 2 ..(HELP!!!)

From: Anurag Varma <avdbi_at_nospam.hotmail.com>
Date: Fri, 07 Sep 2001 13:31:52 GMT
Message-ID: <c%3m7.10818$tb.2146397@news02.optonline.net>


all_tab_columns includes views also.
Try doing

   SELECT 'UPDATE ' || TABLE_NAME || ' SET COST = 1 ;'    FROM ALL_TAB_COLUMNS
   WHERE COLUMN_NAME = 'COST'
    AND TABLE_NAME IN (SELECT table_name from all_tables);

Be Wary of this statement though (i.e. check all the update clauses) since PLAN_TABLE and RESOURCE_COST$ tables also have a COST column in them,,,, which I suppose you would not want to update.

Anurag

"JK Yao" <jkyf0131_at_hotmail.com> wrote in message news:93f65984.0109070042.5861d059_at_posting.google.com...
> dear all,
>
> After I write an procedure to run what I select from the script :
>
> SELECT 'UPDATE ' || TABLE_NAME || ' SET COST = 1 ;'
> FROM ALL_TAB_COLUMNS
> WHERE COLUMN_NAME = 'COST' ;
>
> I create upgrade some table and the error code is
> ORA-01733: virtual column not allowed here.
> I cannot find those error table, coz there are no such tables.
>
> Question:
> Will the all_tab_columns include objects other than table? It is
> supposed to include just "Table" information, isn't it?
> Please clarify. Thanks a lot.
>
> JK
>
>
>
> Reid Lai <reidlai_at_netvigator.com> wrote in message
news:<3B97A31A.AE8F97CE_at_netvigator.com>...
> > SELECT
> > 'UPDATE ' || TABLE_NAME || ' SET COST = 1 ;'
> > FROM
> > ALL_TAB_COLUMNS
> > WHERE
> > COLUMN_NAME = 'COST' ;
> >
> > JK Yao wrote:
> >
> > > dear all,
> > >
> > > Is there any fast way to set all column called 'cost' to 1? Since I
> > > have 'Cost' column involved in so many table, I need some script of
> > > special way to done my job.
> > >
> > > Please clarify. Thanks a lot.
> > >
> > > I use Oracle8.1.6 in Solaris2.6
> > >
> > > regards,
> > > JK
Received on Fri Sep 07 2001 - 08:31:52 CDT

Original text of this message

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