3 Questions on ORACLE 7.2/SQLPLUS
From: badri <badri_at_cc.gatech.edu>
Date: 1995/12/09
Message-ID: <4ac6pb$7cb_at_gaia.cc.gatech.edu>#1/1
Date: 1995/12/09
Message-ID: <4ac6pb$7cb_at_gaia.cc.gatech.edu>#1/1
Hi:
I have the following questions:
- How to drop an existing column? I can think of exporting
and importing the table without the column. Also, creating a temp table
with the desired columns, dropping the original and renaming the temp table
to the original table. I want to know if there is a DDL command to do it.
- I have an intermittent occurrence of cost based optimization "showing up" by itself. I determine this by monitoring the chain_cnt and avg_row_len in User_Tab_Columns. My init.ora says that the optimization mode is RULE. Besides, even if I delete statistics, they get regenerated again. How is this? How can I prevent it?
- I have some columns in a table that are defined to be non-null. I need to define an additional constraint that they cannot be < 0. I would prefer to do this as a constraint and not a trigger. I tried Alter table mytable add (constraint myCons myColumn number > 0) and a host of other attempts, and failed all the time. What I need is something like "Check". The problem is that the table already exists and I cannot do a "Check" on an existing column!
Any and all help on any and all of the 3 questions would be greatly appreciated,
thanks a lot,
-Badri Received on Sat Dec 09 1995 - 00:00:00 CET