Unused columns in 8i
Hi,
I've set one column unused in one table. Now I want to reuse it. How to do that?
Please answer it.
Thanx in advance
Darshil
Hi
Renaming a column is not supported in 8i.
Chris
PS: the syntax is "ALTER TABLE <table name> RENAME COLUMN <old column name> TO <new column name>"
Similar Messages
-
Sir
i am new to database.I am doing an oracle course on 051.My oracle faculty is saying
Set unused column option will hide the column for-ever.user can't retrieve it again.
what i believe if a statement is hiding a column there must be some option to regain it.
Is there any option of to make an unused column to reusable again?Hi,
i am new to database.
Is there any option of to make an unused column to reusable again?Since you're new:
Try to find your answers in the Oracle documentation as well, as it explains clearly how 'Oracle things' work, with examples and you can do quick searches on keywords of your interest.
Example: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2329
You should bookmark: http://tahiti.oracle.com and start reading the concepts and fundamentals when you've got some spare time.
assuming you're on 10g -
Hi All,
I am working on version 11.2.0.3.0 ( windows server 2008 ).
While dropping unused column i am getting below error
SQL> create table er (ab varchar2(50), aa varchar2(50)) compress;
SQL> alter table er set unused column ab;
Table altered.
SQL>
SQL>
SQL>
SQL>
SQL> alter table er drop unused columns;
alter table er drop unused columns
ERROR at line 1:
ORA-39726: unsupported add/drop column operation on compressed tablesi can't do such things for these number of tablesThat is the funniest thing I've heard in a while. If you can "alter table xxx drop unused columns," why can't you do what is suggested.
And no, it's not a bug.
And no, there is not "another way around" -
Drop unused column in compressed table
Good day for all.
I have partitioned compressed table under 10.2.0.4 database. I need to remove column, and did it according metalink note 429898.1, but then i execute command alter table .... drop unused columns, i got error ORA-39726 (unsupported add/drop column operation for compreseed table), so it mean that proposed workaround don't works now.
Does anyone have new workaround for this problem?alter table MY_TABLE set unused(MY_FNG_COLUMN);
-- success
alter table MY_TABLE drop unused columns;
-- error -
How to recover the unused column
According to the spec, 'set unused' does not actually remove the target columns and the column data remains in the table's rows. but if a column was marked as unused, there are no any access to the column. then why the clause is released?is it better than drop column?if the unused columns exist still,why there are no clause to restore it?
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2913496610745#2914947431112
-
Dear Gurus
I have a situation where I need to drop specific columns which are set to unused!
Say, I have 3 unused columns in a table and now I want to drop only one unused column from that.
SQL> alter table scott.emptest set unused (ENAME);
Table altered.
SQL> alter table scott.emptest set unused (COMM);
Table altered.
Once I set some columns un-used, now I want to drop only one un-used Column ENAME
SQL> alter table scott.emptest drop column ENAME;
alter table scott.emptest drop column ENAME
ERROR at line 1:
ORA-00904: "ENAME": invalid identifier
which in turn throws this error!
Help appreciated!
Thanks in advanced
Ravi PrakashSCOTT@demo102> create table tbl_25 as select * from emp
SCOTT@demo102> /
Table created.
SCOTT@demo102> desc tbl_25
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SCOTT@demo102> alter table tbl_25 set unused (deptno)
SCOTT@demo102> /
Table altered.
SCOTT@demo102> alter table tbl_25 set unused (comm);
Table altered.
SCOTT@demo102> desc tbl_25
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
SCOTT@demo102> select * from all_unused_col_tabs where table_name ='TBL_25';
OWNER TABLE_NAME COUNT
SCOTT TBL_25 2
SCOTT@demo102> alter table tbl_25 drop unused column;
Table altered.
SCOTT@demo102> select * from all_unused_col_tabs where table_name ='TBL_25';
no rows selected
SCOTT@demo102> Nicolas.
Add queries on all_unused_col_tabs.
Message was edited by:
N. Gasparotto -
After marking a column as unused, how to unmark it?
You cannot, mark columns unused is to save time for further drop.
Nicolas. -
How to get Materialized View to ignore unused columns in source table
When updating a column in a source table, records are generated in the corresponding materialized view log table. This happens even if the column being updated is not used in any MV that references the source table. That could be OK, so long as those updates are ignored. However they are not ignored, so when the MV is fast refreshed, I find it can take over a minute, even though no changes are required or made. Is there some way of configuring the materialized view log such that the materialized view refresh ignores these updates ?
So for examle if I have table TEST:
CREATE table test (
d_id NUMBER(10) PRIMARY KEY,
d_name VARCHAR2(100),
d_desc VARCHAR2(256)
This has an MV log MLOG$_TEST:
CREATE MATERIALIZED VIEW LOG ON TEST with rowid, sequence, primary key;
CREATE MATERIALIZED VIEW test_mv
refresh fast on demand
as
select d_id, d_name
from test;
INSERT 200,000 records
exec dbms_mview.refresh('TEST_MV','f');
update test set d_desc = upper(d_desc) ;
exec dbms_mview.refresh('TEST_MV','f'); -- This takes 37 seconds, yet no changes are required.
Oracle 10g/11gI would love to hear a positive answer to this question - I have the exact same issue :-)
In the "old" days (version 8 I think it was) populating the materialized view logs was done by Oracle auto-creating triggers on the base table. A "trick" could then make that trigger become "FOR UPDATE OF <used_column_list>". Now-a-days it has been internalized so such "triggers" are not visible and modifiable by us mere mortals.
I have not found a way to explicitly tell Oracle "only populate MV log for updates of these columns." I think the underlying reason is that the MV log potentially could be used for several different materialized views at possibly several different target databases. So to be safe that the MV log can be used for any MV created in the future - Oracle always populates MV log at any update (I think.)
One way around the problem is to migrate to STREAMS replication rather than materialized views - but it seems to me like swatting a fly with a bowling ball...
One thing to be aware of: Once the MV log has been "bloated" with a lot of unneccessary logging, you may perhaps see that all your FAST REFRESHes afterwards becomes slow - even after the one that checked all the 200000 unneccessary updates. We have seen that it can happen that Oracle decides on full table scanning the MV log when it does a fast refresh - which usually makes sense. But after a "bloat" has happened, the high water mark of the MV log is now unnaturally high, which can make the full table scan slow by scanning a lot of empty blocks.
We have a nightly job that checks each MV log if it is empty. If it is empty, it locks the MV log and locks the base table, checks for emptiness again, and truncates the MV log if it is still empty, before finally unlocking the tables. That way if an update during the day has happened to bloat the MV log, all the empty space in the MV log will be reclaimed at night.
But I hope someone can answer both you and me with a better solution ;-) -
How to Identify unused columns in a table
Hiiya..
Is there a way to find out that following columns of table X,Y, Z have never been used. So that, I can check with the FCs and mark them un-used (using ALTER TABLE).
I don't want to go through every line of (avlbl) PLSQL code to identify that so and so column of so and so table has never been used. Is there any view or any sys proc/pkg using which I can identify them.
TIAGuido
Not getting you exactly. What I am doing is pick all the columns one by one and search in all_source (like where TEXT like %COLUMN_NAME%). Now what about 'AND <UnusedColumn> IS NULL'
Sidhu -
Dropping unused columns from database table
I have an existing table called TUSER. I have mapped some fields, but not
all fields, as some are inserted by other applications and for reporting
purposes.
I am using JDK 1.3.1_02, Windows 2000, SQL Server 2000 database, Kodo
JDOEE 2.2.6 and JBoss 3.0.0.
When I refresh the datastore it drops all columns that are not mapped
(note that these colums can contain null values):
[java] [ connection: 2961925; statement: 2766626; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER ADD Job_Title_ID VARCHAR(255)
[java] [ connection: 2961925; statement: 1582473; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MAILUSERID
[java] [ connection: 2961925; statement: 5237832; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PHONENUMBERS
[java] [ connection: 2961925; statement: 2191491; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN EMPLOYEENO
[java] [ connection: 2961925; statement: 894443; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MDATE
[java] [ connection: 2961925; statement: 531758; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN STATUSCHANGETIME
[java] [ connection: 2961925; statement: 5899013; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN FINISHDATE
[java] [ connection: 2961925; statement: 8146001; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN LASTLOGGEDMBOARD
[java] [ connection: 2961925; statement: 7756310; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN DEL_FLG
[java] [ connection: 2961925; statement: 6817858; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PERMIT_CD
[java] [ connection: 2961925; statement: 7754670; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN LASTLOGGEDREQUESTER
[java] [ connection: 2961925; statement: 7332084; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MSG_SERVER
[java] [ connection: 2961925; statement: 1691809; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN AUTORUN
[java] [ connection: 2961925; statement: 5253969; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN REG_DATE
[java] [ connection: 2961925; statement: 4977422; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PERMIT_LST
[java] [ connection: 2961925; statement: 4343712; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN ALLOWREPL
[java] [ connection: 2961925; statement: 7104150; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN EMAIL
[java] [ connection: 2961925; statement: 4395840; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MANAGERSTATUS
[java] [ connection: 2961925; statement: 2417379; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MD5_DIGEST
[java] [ connection: 2961925; statement: 2865120; time: Thu Jul 04
15:33:25 JST 2002 ] ALTER TABLE TUSER DROP COLUMN SMTPADDRESS
15:33:25 JST 2002 ] INSERT INTO JDO_SCHEMA_METADATAX(CLASSNAMEX) VALUES
('com.gulfnet.g
roupcast.data.User')
Is this meant to happen? I am guessing not. Is there a way to tell the
schematool to not remove existing columns?
Thanks in advance.
KamYou can in fact tell the schematool not to drop columns it doesn't know about. When you run the schematool, use the "add" action rather than "refresh". Then it will only add columns, never drop them. See the documentation for details:
http://www.solarmetric.com/Software/Documentation/2.2.5/manual.html#schema_manipulation -
11g: automatic group by unused column
Hi,
I've got this problem:
I have report with just one measure. This measure should be aggregated over a selectable dimension.
Therefor I build a dashboard prompt, which saves the selected dimension in a presentation variable.
(btw: a column selector would be the easier way, but there are more than one report which should react on this dashboard prompt)
Then I used a "case when" in the report to differ between the selection:
case when [presentation-variable] = 'Dim1' then Dim1.col1
when [presentation-variable] = 'Dim2' then Dim2.col1
end
Now I would expect such a physical SQL:
select
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end,
sum(...)
from
group by
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end;
But OBIEE creates such one:
select
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end,
sum(...)
from
group by
Dim1.col1,
Dim2.col1,
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end;
So of course the wrong the measure is aggregated wrong, because it is grouped by a column, which i do not want to use.
Could it be the Problem, that this 2 columns are logical level key of a dimension hierarchy?
Anybody got a idea, how I could suppress this group by?Hi,
Just 4 hours ago, someone else had a very similar question:
Group by fails on ORA-00979
Personally, I consider that a bug in Oracle 10. When you do a GROUP BY on a view, you can't expect the SQL engine to look at the view definition, and determine if one of the columns can be derived from another.
In practice, it's easy enough to add c1u to the GROUP BY clause, or to use MAX (c1u) instead of c1u, to make your query work. -
Max no columns allowed in a table
i want to know how many columns are allowed in a table.maximum no of columns in table.
I hope this will be helpful for query
ORA-01792: maximum number of columns in a table or view is 1000
Cause: An attempt was made to create a table or view with more than 1000 columns, or to add more columns to a table or view which pushes it over the maximum allowable limit of 1000. Note that unused columns in the table are counted toward the 1000 column limit.
Action: If the error is a result of a CREATE command, then reduce the number of columns in the command and resubmit. If the error is a result of an ALTER TABLE command, then there are two options: 1) If the table contained unused columns, remove them by executing ALTER TABLE DROP UNUSED COLUMNS before adding new columns; 2) Reduce the number of columns in the command and resubmit. -
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);
-
SharePoint 2013 Make Calculated Column based on Custom Column
In SharePoint 2013, I am trying to create a Calculated Column that is a shortened display of another Custom Column. The Calculated Column would just show the first 100 characters concatenated with "..." like in the following formula:
=LEFT([CustomColumn],100)&"..."
However, every time that I go to create this calculated column, SharePoint doesn't provide my [CustomColumn] in the "Insert Column:" list. If I type it in anyway, SharePoint throws an error.
Details on my Column, List, and Site below:
Col. Type: Multiple lines of text
Col. Group: Custom Columns
Col. Text Type: Enhanced rich text
List Content Type: Custom Type Inherits from Event
Site Type: Publishing
Also, to no avail, I found this similar post (link below), but creating the Site Column and Calculated Column
before adding it to the Content Type did not work for me.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/26a7517e-ba43-4c49-95aa-3e6f7f4207ba/calculated-field-in-content-type-not-working
Anyone out there know how to coax SharePoint into submission?!Multi lines of text are one of the types of columns which can't be used by calculated columns/fields. Among such unusable columns are also Lookup columns, People columns, External Columns, MMS columns, etc.
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs -
How to add column dynamically based on user input in oracle?
**how to add column dynamically based on user input in oracle?**
I am generating monthly report based on from_date to to_date below is my requirement sample table
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
100001.............John...........02-OCT-12...............6
100002.............chris...........01-OCT-12...............4
Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
below is my code
create or replace
procedure MONTHLY_LVE_NEW_REPORT_demo
L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
--L_LEAVE_TYPE_CODE IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
L_DEPARTMENT_CODE IN VARCHAR2,
--L_MONTH IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
MONTHRPT_CURSOR OUT SYS_REFCURSOR
AS
O_MONTHRPT_CURSOR_RPT clob;
v_return_msg clob;
BEGIN
IF (L_BUSINESS_UNIT IS NOT NULL
AND L_FROM_DATE IS NOT NULL
and L_TO_DATE is not null
-- AND L_DEPARTMENT_CODE IS NOT NULL
THEN
OPEN MONTHRPT_CURSOR FOR
select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
from
SELECT DISTINCT a.employee_code,
a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
a.DEPARTMENT_CODE,
a.DEPARTMENT_DESC,
B.LEAVE_TYPE_CODE,
B.LVE_UNITS_APPLIED,
B.CREATED_DATE as CREATED_DATE,
DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
b.status
from SSHRMS_EMPLOYEE_DATA a
join
SSHRMS_LEAVE_BALANCE C
on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
and C.STATUS = 'Y'
left join
SSHRMS_LEAVE_REQUEST_TRN B
on
B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
and B.STATUS in ('A','P','C')
and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
join
SSHRMS_LEAVE_REQUEST_TRN D
on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
and D.LEAVE_TYPE_CODE in ('CL')
AND D.LEAVE_TYPE_CODE IS NOT NULL
group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
else
v_return_msg:='Field should not be empty';
end if;
END;
my code actual output
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
100001....................John............02-OCT-12.................6
100001....................chris...........01-OCT-12.................4
how to add column dynamically based on from_date to to_date?
Thanks and Regards,
Chris Jerome.You 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);
Maybe you are looking for
-
Iphoto is no longer on my desk top. How can I get it back?
iPhoto is no longer on my desktop. Not sure how it went away but is there a way I can get it back?
-
Suddenly, I can't burn any of my audio files. When I insert the blank CD it initializes it then it "finishes burning" then I get the message that it wasn't able to burn the file. I tried a several music files. I don't think I've past the burn limit b
-
CP 6 disable slides transitioning on left click
Hello, I'm having a slight issue with CP6. I'm trying to set up my project using back and next buttons, but once the slide finishes playing, if i left click anywhere on the screen, it proceeds to the next slide. my set up: I am importing PowerPoint 2
-
Why am i prompted for serial number upgrade?
Activated software with correct serial number but it now asks for a serial number upgrade. This is taking way too long. I feel strong coercion and pressure to buy stuff I don't want and don't need.
-
Creating activity without referencing Account and Contact Person.
Hello Experts, Our client has such a process, sales employee can perform unplanned visits and they record this visit just entering this prospectsu2019 telephone number and name surname.(without entering account ID as the customer data hasnu2019t been