How to drop a column in Oracle 7i
I tried
"alter table tablename drop column columnname" in Oracle 7i, it is not working.
Column is nullable
Could anyone pls help me on this?
any luck finding the v6 doc online?
RENAME emp to emp_orig;
CREATE VIEW EMP as
select col1, col2... --LEAVE OFF THE COLUMN YOU WANT TO DROP
from emp_orig;
GRANT select, insert, update, delete on EMP to ....
this way, you don't have to drop anything, recreate indexes, deal with downtime, etc.
better solution, just tell people to ignore the other column. really, what harm can it do?
Similar Messages
-
Hi OTNeites,
How does one drop a column in Oracle 7.2 or Oracle 8.0
Thanks in advance.Something like this.
create new_table as select col1, col2, col3
from old_table
drop old_table
rename new_table to old table
The trick is to select all the columns except the one you want to drop when creating the new table.
In this case you lost all indexes, constraints ...
You should create script for recriate all objects in DB
that will be drop with DROP OLD_TABLE command. -
How to find encrypted columns in oracle 10g database
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?
Thanks..user602872 wrote:
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?Hmm not which I could find,
SQL> select * from dict where lower(table_name) like '%encrypted%';
TABLE_NAME
COMMENTS
DBA_ENCRYPTED_COLUMNS
Encryption information on columns in the database
ALL_ENCRYPTED_COLUMNS
Encryption information on all accessible columns
USER_ENCRYPTED_COLUMNS
Encryption information on columns of tables owned by the user
SQL>HTH
Aman.... -
How to create dynamics columns in oracle query1.
hi,
how to create dynamics columns in oracle query.its very urgent.
regards
prasad..Urgent is it?
Why? Have you forgotten to do your coursework and you'll get thrown off your course if you don't hand it in today?
What makes you believe that your request for help is more important than someone else who has requested help? It's very rude to assume you are more important than somebody else, and I'm sure they would like an answer to their issue as soon as they can get one too, but they've generally been polite and not demanded that it is urgent.
Also, you assume that people giving answers are all sitting here just waiting to answer your question for you. That's not so. We're all volunteers with our own jobs to do. How dare you presume to demand our attention with urgency.
If you want help and you want it answering quickly you simply just put your issue forward and provide as much valuable information as possible.
Looking at your post you haven't told us what database version you are using, you haven't provided any create table DDL's and insert statements to populate that with sample data, and you haven't even shown us that you've had a go at doing something yourself.
You will find if you post on here demanding your post is urgent then most people will just ignore it, some will tell you to get lost, and some will explain to you why you shouldn't post "urgent" requests. Occasionally you may find somebody who's got nothing better to do who will actually provide you with an answer, but you really are limiting your options by not asking properly.
/rant
As a basic example of dyanamic SQL:
DECLARE
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
BEGIN
-- Parse the query.
DBMS_SQL.PARSE(cur, 'SELECT hiredate, sal FROM emp', DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
FOR colind IN 1 .. ncols
LOOP
DBMS_OUTPUT.PUT_LINE (cols.col_name);
END LOOP;
DBMS_SQL.CLOSE_CURSOR (cur);
END;
/ -
How can I delete column in oracle 8i
Hi,
How can I remove the Column from table in oracle 8i
ex: table Name EMP
Empid Number(8)
EmpFName Varchar2(64)
EmpLName Varchar2(64)
EmpDOB Varchar2(10)
EmpAge Number(2)
Here i want to remove the Empage column.
Kindly give the solution.
Advance ThanxShankar,
(Shankar is my friend..)
You have to verify any composite index that are pointing to the column before dropping or setting unused to that column if required.
Othatwise the index will be amicably lost. Just gather that information before dropping, sothat you can rebuild that index after drop.
SQL> create table test(no number(10),tst_unused number(10));
Table created.
SQL> create index tst_un_idx on test(NO,TST_UNUSED);
Index created.
SQL> insert into test values(1,2);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> alter table test set unused column tst_unused;
Table altered.
SQL>
SQL> select * from user_indexes where TABLE_NAME='TEST';
no rows selected
SQL> create index tst_un_idx on test(NO);
Index created.
Regards
N.Venkatagiri -
Forms 6.0 how to query clob column with oracle 9.2 DB
hi every body,
i made install for oracle 9.2 oracle DB every thing goes ok but when i made query in my form version 6.0 which have CLOB column the form closed automatically without any message?
and just for know when i run the same form with oracle 8.1.7 DB the form made query normally without any problem.
i want your help please.
Message was edited by:
mshaqalaihI know there was a problem in 6i where you would get a crash if your query returned more than {Max Length} characters of the field representing the CLOB column.
-
How to create hidden column in Oracle Table
Hi folks
i have one doubt regarding hidden column creation in Oracle Table..
Let me briefly explain my requirements.
I have one table called UWRMC_MAST is table contain the following columns
RMC_N_ID NUMBER(10) NOT NULL,
COB_N_ID NUMBER(2) NOT NULL,
SUBCOB_N_ID NUMBER(2),
RMC_C_CODE VARCHAR2(10 BYTE) NOT NULL,
RMC_C_NAME VARCHAR2(100 BYTE) NOT NULL,
CREATED_N_BY NUMBER(10) NOT NULL,
CREATED_D_DT DATE NOT NULL,
MODIFIED_N_BY NUMBER(10) NOT NULL,
MODIFIED_D_DT DATE NOT NULL,
RECORD_N_STS NUMBER(1) NOT NULL,
RMC_C_REMARKS VARCHAR2(256 BYTE),
EFFECT_D_DT DATE NOT NULL
RMC_N_ID is primary key
i want to create one column like Old_EFFECT_D_DT as virtual column
when ever i update the effective date that date should be insert into Old_EFFECT_D_DT i.e., Virtual Column
For example
SQL> select RMC_N_ID, COB_N_ID, SUBCOB_N_ID, RMC_C_CODE, EFFECT_D_DT from uwrmc_mast;
RMC_N_ID COB_N_ID SUBCOB_N_ID RMC_C_CODE EFFECT_D_
46 1 74 PCTMOTR 02-FEB-11
Below i update the effective date(01-feb-2011
SQL> update uwrmc_mast
2 set EFFECT_D_DT = '01-apr-2011'
3 where rmc_n_id =46;
1 row updated.
But i want a result like below
SQL> select RMC_N_ID, COB_N_ID, SUBCOB_N_ID, RMC_C_CODE, EFFECT_D_DT from uwrmc_mast;
RMC_N_ID COB_N_ID SUBCOB_N_ID RMC_C_CODE EFFECT_D_ OLD_EFFE
46 1 74 PCTMOTR 01-APR-11 02-FEB-11Is this possible to do in oracle , kindly give a solution for my requirement
Regards
ArunArun wrote:
Hi Mr.David_Aldridge
Am having the doubt that's why i posted my quires in oracle forums.. just i want to know whether my requirement suit for VIRTUAL COLUMN in Table.
Regards,
ArunWell, I'm not sure exactly what your requirement is.
If you want to audit changes to the records of that table then it would be better to use Oracle's auditing facility. If this previous change date is really a required part of your actual application functionality then you might use the application itself to maintain the previous date as a column in the table, as you say, or if you need to maintain the history of changes then add a new table so you can keep track of multiple changes. -
How to display WHO columns in oracle apps form
Hi all,
I have WHO columns in the Table and i need to add in the existing form and i have WNI trigger (execute_query) and i am trying to add columns in the Existing Database Block
After opening the Form(oracle apps form) i am not getting/populate any records on the Block
Please help and please give me the steps
ThanksHi ,
This community is to discuss Oracle Application Server specific issues, you can post this query in for better response:
Forms
Oracle Forms - EBS (MOSC)
Regards,
Prakash. -
Any method to drop extra column in oracle 8
hello
I am using oracle 8
i want to remove extra column from my table
please help me
regards
pritamDrop column is available only after Oracle 8. The only thing I can think of is to re-create the table without the extra column
create table <newtablename > as
select col1, col2.... from <tablename>
But then you will have to recreate the constraints on the new table. ( only the not null constraint will be copied to it) -
Dropping a column's default value
How to drop a column's default value?
The following commands fails:
ALTER TABLE t1 ALTER COLUMN c1 DROP DEFAULT.
ALTER TABLE t1 MODIFY c1 DROP DEFAULT.
Thanks in advance.SQL> ALTER TABLE IDENTIFICADORES_DOMINIOS_RANGO MODIFY TIPO_DATO DEFAULT NULL;
Table altered
SQL> DESC IDENTIFICADORES_DOMINIOS_RANGO
Name Type Nullable Default Comments
CODIGO_IDENTIFICADOR NUMBER(7)
DESCRIPCION VARCHAR2(50)
TIPO VARCHAR2(1)
TIPO_DATO VARCHAR2(1) NULL Tipo de dato que contiene el Dominio-RangoI would like drop DEFAULT value; now, it's marked like NULL. It's not the same... is it? -
How to rename the column name in oracle 8i?
hi,
Does anyone know how to rename the column name in oracle 8i?My method was drop the relationship key first then delete the old column,finally add the new column.
Thanks for your replay.
jingThere is no facilty to rename a column name in Oracle 8i. This is possible from Oracle 9.2 version onwards.
For you task one example given below.
Example:-
Already existed table is ITEMS
columns in ITEMS are ITID, ITEMNAME.
But instead of ITID I want ITEMID.
Solution:-
step 1 :- create table items_dup
as select itid itemid, itemname from items;
step 2 :- drop table items;
step 3 :- rename items_dup to items;
Result:-
ITEMS table contains columns ITEMID, ITEMNAME -
How to drop the multi columns?????
how to drop the multi columns in oracle
Like
alter table drop column a,b;
is it possible.how to drop the multi columns in oracle
Like
alter table drop column a,b;
is it possible.Yes, it is possible.
RTFM:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2124702
pratz -
How to make column range based on a column in Oracle BI 11g
Hello everyone!
I want to know, how to make column range from a column in oracle bi 11g.
for example!
I have a column amounts and I want to build on this with other values of quantity, other column range 1-9,10-49,50-99,100-249, 249 o more.
regards!
when I try to make the range I have error.
Syntax error [nQSError: 26012] . (HY000)
SQL Issued: SELECT CASE WHEN "CUBO_DEEE_TAB"."CANTIDAD" BETWEEN 1 AND 9 THEN 1 a 9 ELSE "CUBO_DEEE_TAB"."CANTIDAD" END FROM "DM_DEEE"
Edited by: 964157 on 09-oct-2012 11:50You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);
-
How to drop a partitioned column in a table
Hi All,
I am trying to drop a column which is partitioned into 4 values.
When I use the command
ALTER TABLE TNAME DROP COLUMN CNAME;
I am getting an error message stating that cannot drop a parttioned column.
ALTER TABLE fn_dev_excpt DROP COLUMN THEATER_ID
ERROR at line 1:
ORA-12984: cannot drop partitioning column
Appreciate your help on this,
Thanks,
Madhu K.Hi,
Can you please drop the partition itself using the below command.Dropping of column which is partitioned is not alllowed.
SELECT table_name, partition_name
FROM user_tab_partitions;
ALTER TABLE range_list DROP PARTITION s2k ;
where table_name=range_list ,
partition_name=s2k
Best regards,
Rafi.
http://rafioracledba.blogspot.com/
Edited by: Rafi (Oracle DBA) on Mar 25, 2010 12:58 AM -
How to update html file in clob column in oracle
hi,
please help me how to update html file in clob column in oracle
ThanksThis is your main query as i am able to understand and you want to update your html file into terms columns based on conditions :
SELECT b.terms As terms
FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
WHERE a.enrlmnt_type_cid = 1
AND a.chklst_item_cid = b.chklst_item_cid
AND a.chklst_item_cid = 79
AND a.oprtnl_flag = 'A'
AND b.oprtnl_flag = 'A'
AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE;So i suggest below one but you need to create a directory where you can store your html file and then you can update .. And remaining consult Experts suggestions too as your
question is improperly posted . . .
DECLARE
vclob CLOB;
v_bfile BFILE := BFILENAME ('YOUR_DIR', 'filename.html');
BEGIN
SELECT b.terms
INTO vclob
FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
WHERE a.enrlmnt_type_cid = 1
AND a.chklst_item_cid = b.chklst_item_cid
AND a.chklst_item_cid = 79
AND a.oprtnl_flag = 'A'
AND b.oprtnl_flag = 'A'
AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE
FOR UPDATE;
DBMS_LOB.fileopen (v_bfile);
DBMS_LOB.loadfromfile (vclob, v_bfile, DBMS_LOB.getlength (v_bfile));
DBMS_LOB.fileclose (v_bfile);
END;
/ Regards..
Maybe you are looking for
-
How do I password protect a pdf file - getting error messages?
I'm trying to protect a pdf file (i.e. a tax return printed to PDF) with password to open and password to modify. However I'm getting an error message in a pop up window saying..."The file may be read-only, or another user may have it open. Please sa
-
An error occurred during creation of the central repository. (BODI-300020)
I am trying to create a central repository for Data Service, the following error appear Creating repository... (BODI-300026) Reading SQL file <C:\BO\DataServices_12\admin\repo\MSSQL\ms.sql>. (BODI-20001) Executing SQL file <C:\BO\DataServices_12\admi
-
Hi, Can anyone advise why my brand new iPhone 6 Plus showing Lifetime 2 hrs 41 mins under Settings/Call Time? I did not even use the phone to make call yet! Thank you. Regards, SC.
-
Error while applying leave through ESS
Hi All, In portal Employee is unable to apply any leave. The system is giving the error message as "As per policy, Casual Leave cannot be taken for more than 1 working day consecutively, Please utilise Privilege leave for this purpose. In case you do
-
I want to develop a proxy in windows phone 8 that will handle all data traffic emanating from phone(i.e. browser and Apps). The following procedures were carried out a) Edited the Wifi settings http proxy and port to the loop back proxy running in th