To drop column of view
hello all
i would like to drop one of column of view.
but i unable to drop.
ashish>alter view magazine drop column author;
alter view magazine drop column author
ERROR at line 1:
ORA-00905: missing keyword
but same process i had done on table which work.
ashish>ed
Wrote file afiedt.buf
1* alter table magazines drop column author
ashish>/
Table altered.
can u please tell me why i m fail to do so??
with regards
ashish
A view is nothing more than a stored query, change the query and you change the view.
SQL> create view vw
2 as
3 select object_name
4 , object_type
5 from all_objects
6 where rownum < 10
7 /
View created.
SQL> select *
2 from vw
3 /
OBJECT_NAME OBJECT_TYPE
/1005bd30_LnkdConstant JAVA CLASS
/10076b23_OraCustomDatumClosur JAVA CLASS
/10297c91_SAXAttrList JAVA CLASS
/103a2e73_DefaultEditorKitEndP JAVA CLASS
/1048734f_DefaultFolder JAVA CLASS
/10501902_BasicFileChooserUINe JAVA CLASS
/105072e7_HttpSessionBindingEv JAVA CLASS
/106ba0a5_ArrayEnumeration JAVA CLASS
/106faabc_BasicTreeUIKeyHandle JAVA CLASS
9 rows selected.
SQL> create or replace view vw
2 as
3 select object_name
4 from all_objects
5 where rownum < 10
6 /
View created.
SQL> select *
2 from vw
3 /
OBJECT_NAME
/1005bd30_LnkdConstant
/10076b23_OraCustomDatumClosur
/10297c91_SAXAttrList
/103a2e73_DefaultEditorKitEndP
/1048734f_DefaultFolder
/10501902_BasicFileChooserUINe
/105072e7_HttpSessionBindingEv
/106ba0a5_ArrayEnumeration
/106faabc_BasicTreeUIKeyHandle
9 rows selected.
SQL>You beat me to it, Rob. And you're absolutely right about the triggers!
Message was edited by:
Alex Nuijten
Similar Messages
-
So i am switching over from Outlook '03 to Mail 2.0. In outlook I could have a three column vertical view of my mail. this would be great on MacBook with its widescreen. It maximizes the number of emails listed by spanning from the top to bottom of the screen and lets one read more on an email with out scrolling.
> rjkg.com/GS.html), but the center and right columns are
being pushed
> down in
> IE. Here's the css (navbar is left, headlines is right,
and content is
> center):
>
> #navBar{
> float: left;
> width: 20%;
> margin: 0px;
> padding: 0px;
> background-color: #ffddbb;
> border-right: 1px solid #cccccc;
> border-bottom: 1px solid #cccccc;
> }
>
> #headlines{
> float:right;
> width: 20%;
> border-left: 1px solid #cccccc;
> border-bottom: 1px solid #cccccc;
> padding-right: 10px;
> background-color: #ffddbb;
> background: #ffddbb;
> }
>
> #content{
> float: left;
> width: 499px;
> margin-top: 0px;
> margin-right: 0px;
> margin-left: 0px;
> }
>
> What do I do to make it showcorrectly in IE?
>
> Also, in Firefox, the center column isn't actually
centered between
> the two
> sidebars, but I'd like it to be. Any clues?
20% + 20% + 499px = ?
You can't mix measures like that. Try replacing 499 with 60%.
Your float
will now drop in all browsers. Why?
20% + 20% + 60% = 100%
But the borders and padding you've assigned are added to the
width,
resulting in another mathematical improbablility. The easiest
way to fix
that is the remove the padding and borders from the main
boxes and then
nest content boxes inside the main boxes. Assign your borders
and
padding to those nested elements.
Al Sparber - PVII
http://www.projectseven.com
Extending Dreamweaver - Nav Systems | Galleries | Widgets
Authors: "42nd Street: Mastering the Art of CSS Design" -
Drop column impact on dependencies
Hello,
i dropped a column on a table,, which was fine, but i have a view and package. when a drop a column from a table will not automatically drop from the view? do i have to alter view test drop column exra_col;
could someone let me know how to handle this...
Thank you..Have you tried putting a test case together?
SQL > SELECT * FROM V$VERSION;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL > CREATE TABLE TEST
2 ( col_a NUMBER
3 , col_b NUMBER
4 , col_c NUMBER
5 );
Table created.
SQL > CREATE VIEW TEST_VIEW
2 AS
3 SELECT col_a
4 , col_b
5 , col_c
6 FROM test
7 ;
View created.
SQL > SELECT * FROM test_view;
no rows selected
SQL > ALTER TABLE TEST DROP COLUMN col_c;
Table altered.
SQL > SELECT * FROM test_view;
SELECT * FROM test_view
ERROR at line 1:
ORA-04063: view "TEST.TEST_VIEW" has errors
SQL > CREATE OR REPLACE VIEW TEST_VIEW
2 AS
3 SELECT col_a
4 , col_b
5 FROM test
6 ;
View created.
SQL > SELECT * FROM test_view;
no rows selected
SQL > -
Hello. When I right click a cube in the solution explorer and click browse, I am presented with a Details field area which doesn't have "Drop Row Fields" area like in BIDS 2008, and doesn't have "Drop Column Fields" area like in BIDS. It just has one details
area with the message "Drag levels or measures here to add to the query".
How do I include the "Drop Row Fields" area and the "Drop Column Fields" area in this Details area so it can be like 2008?I am using MDX query to build SSRS report.
How do i get MDX query from Excel ?
Hi Vishal,
We can use "OLAP PivotTable Extension" to get MDX query in Excel, please download it from:
http://olappivottableextend.codeplex.com/
In addition, I would suggest you open a new case if you have any more questiosn.
Regards,
Elvis Long
TechNet Community Support -
Alter table tablename drop column col
I tried to drop a column from a table created by sys user. Being a sys user I am unable to drop the column. Please explain.
SQL> alter table test move tablespace users;
Table altered.
SQL> alter table test drop column two;
alter table test drop column two
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
Here two is the column name.
Regards
Vijay KumarHello Gasparotto
It is amazing to me. Being a sys user I created a table and then I tried to alter the table by dropping a column but it is giving me error as I have already stated. Please explain over this issue.
Regards
Vijay Kumar -
Shutdown hangs after drop column
Hi,
We were trying to drop column on a very big table, after that we cancelled that operation, and given shutdown immediate command.
Now shutdown is taking too much time, going on from last 9 hours.....
We want to start the database, what can be the best possible solution.
Shutdown abort and startup will help ?
Thanks
Dilipkumar Patel.We were trying to drop column on a very big table, after that we cancelled that operation, and given shutdown immediate command.I guess SMON was doing rollback the transaction when you cancelled the operation. Since it was a big table, it was taking lot of time.
Can you check the alter log is there any error or info msg in it?
I am afraid if you give shutdown abort, may cause serious issues.
Before you execute 'shutdown abort', make sure you have good backup, in case of recovery.
Jaffar -
How to Use Column Selector View in Reports
Hi all,
Can someone please advise on how to use the column selector view in CROMD's reporting tool?
Whenever I add a Column Selector view, and check the Enable checkbox of a certain column, a message appears "Click the columns in the selection pane to add more choices". However there is no selection pane, and the only thing I can do within the column is input a column label.
Am I missing any crucial steps here?
Thanks.Hi,
Choose a column as column selector by enabling the check box and click the columns that has to get into column selector in the left navigation.
On click the columns would get in one by one. After that field that you choose would be displayed in the position of the column in the report table
Typically the purpose is something like this. If you want to dynamically change the first field say by Account Type, Account Region, Account Status and see the revenue then it can be used
-- Venky CRMIT -
Dealing with errors due to newly added/dropped columns
DB version:11g
I am not sure if i have created an unnecessarily large post to explain a simple issue. Anway, here it is.
I have been asked to code a package for Archiving .
We'll have two schemas;The original schema and an Archive schema (connected via a DB Link)
ORIGINAL Schema -------------------------> ARCHIVE Schema
via DB Link When records of certain tables in the ORIGINAL schema meet the archiving criteria (based on Number of Days Old, Status Code etc), it will be moved ('archived') to the ARCHIVE schema using the INSERT syntax
insert into arch_original@dblink
col1,
col2,
col3,
select col1,
col2,
col3,
from original_tableThe original table and its archive table has the same structure, except that the Archive table has an additional column called archived_date which just records when a record got archived.
create table original
col1 varchar2(33),
col2 varchar2(35),
empid number
create table arch_original
col1 varchar2(33),
col2 varchar2(35),
empid number,
archived_date date default sysdate not null
);We have tables with lots of columns(there are lots of tables with more than 100 columns) and when all column names are explicitly listed like the above syntax, the code becomes huge.
Alternative Syntax:
So i thougt of using the syntax
insert into arch_original select original.*,sysdate from original; -- sysdate will populate archived_date columnEventhough the code looks simple and short, i've noticed a drawback to this approach.
Drawback:
For the next release, if developers decide to add/drop a column in the ORIGINAL table in the Original Schema, that change should be reflected in the archive_table's (ARCHIVE schema) DDL script as well. It is practically impossible to keep track of all these changes during the development phase.
If i use
insert into arch_original select original.*,sysdate from original; syntax, you will realise that there is change in the table structure only when you encounter an error(due to missing/new column) in the Runtime. But, if you have all the column names listed explicitly like
insert into arch_original@dblink
(col1,
col2,
col3,
select col1,
col2,
col3,
from original_tablethen you'll encounter this error during the Compilation itself. I prefer the error due to a missing/new column during the Compilation itself rather than in Runtime.
So what do you guys think? I shouldn't go for
insert into arch_original select original.*,sysdate from original; syntax because of the above Drawback. Right?What advantage would it bring if i make ARCHIVED_DATE as the first column in the ARCHIVE tables?The advantage is that if you'll add a column in the future on both original and archived tables the insert statement will work anyway...
SQL> create table x (a number, b number);
Table created.
SQL> create table y (arc_date date, a number, b number);
Table created.
SQL> insert into x values (1,1);
1 row created.
SQL> insert into x values (2,2);
1 row created.
SQL> select * from x;
A B
1 1
2 2
SQL> insert into y select sysdate, x.* from x;
2 rows created.
SQL> alter table x add (c number);
Table altered.
SQL> alter table y add (c number);
Table altered.
SQL> alter table x drop column b;
Table altered.
SQL> alter table y drop column b;
Table altered.
SQL> insert into x values (3,3);
1 row created.
SQL> insert into y select sysdate, x.* from x
2 where a=3;
1 row created.
SQL> select * from x;
A C
1
2
3 3
SQL> select * from y;
ARC_DATE A C
25-JAN-10 1
25-JAN-10 2
25-JAN-10 3 3Max
[My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]
Edited by: Massimo Ruocchio on Jan 25, 2010 12:44 PM
Added more explicative example -
Can't drag and drop from page view
Can't drag and drop from page view to desktop even though plus icon shows up for duplicating the page. On Mac 10.9.2 Acrobat XI. I don't want to extract through the menu and associated dialogues. Its slow and cumbersome.
Hi Peterbruce,
Acrobat for Windows will let you select pages in the Pages panel and drag them to your desktop, but that isn't an option in Acrobat for Mac OS. You can drag thumbnails from the Pages panel in one doc, to the Pages panel in another, however.
Best,
Sara -
Thumbnails in Column & List views
My Finder (v10.4.5) mostly does NOT show the thumbnails of my JPGs in Column & List views, unless those JPGs were created on my computer (Tiger 10.4.6).
I got it to finally show the thumbnails in Icon view (View > Show View Options > Show Icon Preview + All windows), but I also want to see the little thumbnails in Column and List Views. Anyone know how to do this.
NOTE: those same JPGs that don't get the thumbnails on my MAC, do show thumbnails on my crappy-*** Windows ME Dell's Explorer.
By the way, (different Question) is there a way I can set up to be notified via email when somebody replies to my question here in this discussion area?
Thanks,
Ted
PowerBook G4 Mac OS X (10.4.6) 2 GB DDR SDRAM
PowerBook G4 Mac OS X (10.4.6) 2 GB DDR SDRAMWith a Finder window open in Column view, when you go to the View menu item and select Show View Options there are not any "Show Icons" or "Show preview column" selections for me to check.
That is very very strange. Try opening a Finder window, have it in icon view, and the bring up Show View Options, I presume you are getting the options? Now go to View (don't close the options window!) and change to List. A different set of options should appear in the options window, and if you then change the view to Column what happens to the options window?
If you want to see thumbnails for files that don't have them you either use Column view with a preview column set to display icons, or put the folder in Icon view. The Mac OS Finder does not create thumbnail.db files, as does Windows (I believe many Linux window managers create analogous files). Instead the Finder either reads the thumb from the resource fork of the file (most--maybe all--Mac graphics programs have always had the ability to create custom icons that are a part of the file), or else it will create a thumb "on the fly" for files that don't have them if told to do so in Icon and Column views. In List view it will display a small icon if the file has one, otherwise it just uses the generic icon. Windows is incapable of reading Mac resource forks, where the custom icon is for files created on a Mac, and the Finder is incapable of reading Windows thumbnail.db files. Any file you create on your Mac with a Mac graphics program will have a custom icon, if you set the preference of the program to save the file that way. This includes Image Capture, if you use it to transfer files from your camera. Images you get from a Windows or Linux box, or download from the Internet, do not have a resource fork and so do not have a custom icon.
Francine
Francine
Schwieder -
Hi,
We have a table of size above 500GB. To satisfy some business need there was a requirement to drop one column. The column needed to be dropped contained huge data. Hence before dropping the column it was made unused and then we tried to drop the same. At this point we are facing some issues. The drop unused column has been executed before 18 hours and till now it is not completed.
Suspecting some discrepancy the session conducting the drop command has been killed. Now the table could be described but we are not able to select the table. I am providing the steps followed so far.
First the column was set to unused:
SQL> alter table table_name set unused (column_name);
At some later time the drop command had been executed:
SQL> alter table table_name drop unused columns checkpoint 1000;
The above statement was running for last 18 hours and till now not completed.
Then the corresponding session was killed.
After this the table could be described but select operation could not be performed and returned the following error:
ORA-12986:
columns in partially dropped state. Submit ALTER TABLE DROP COLUMNS CONTINUE
The above command was also executed but without any sign of completion and again killed.
DB Version: 10.2.0.3.0
OS: Sun Solaris 10
Environment: DWH
Kindly guide me at this point on how to resolve this and made the table available to the user.
Thanks in advance for your valuable time.
Regards,
Joyuser8686720 wrote:
The above command was also executed but without any sign of completion and again killed. Was the session waiting on anything?
According to the documentation you don't have many options:
CHECKPOINT Specify CHECKPOINT if you want Oracle Database to apply a checkpoint for the DROP COLUMN operation after processing integer rows; integer is optional and must be greater than zero. If integer is greater than the number of rows in the table, then the database applies a checkpoint after all the rows have been processed. If you do not specify integer, then the database sets the default of 512. Checkpointing cuts down the amount of undo logs accumulated during the DROP COLUMN operation to avoid running out of undo space. However, if this statement is interrupted after a checkpoint has been applied, then the table remains in an unusable state. While the table is unusable, the only operations allowed on it are DROP TABLE, TRUNCATE TABLE, and ALTER TABLE DROP ... COLUMNS CONTINUE (described in sections that follow).
You cannot use this clause with SET UNUSED, because that clause does not remove column data. -
Drop column from compressed table
NLSRTL
11.2.0.3.0
Production
Oracle Database 11g Enterprise Edition
11.2.0.3.0
64bit Production
PL/SQL
11.2.0.3.0
Production
TNS for Linux:
11.2.0.3.0
Production
Hello,
I read about how to drop column from a compressed table - first set it unused and then drop the unused columns. However, in the example below on the database I ran it, it does not work. Please, can you tell me WHEN this approach does not work. What it is dependent on - parameters or something else. Why I cannot drop the unused columns?
And the example along with the errors:
create table tcompressed compress as select * from all_users;
> table TCOMPRESSED created.
alter table tcompressed add x number;
> table TCOMPRESSED altered.
alter table tcompressed drop column x;
>
Error report:
SQL Error: ORA-39726: unsupported add/drop column operation on compressed tables
39726. 00000 - "unsupported add/drop column operation on compressed tables"
*Cause: An unsupported add/drop column operation for compressed table
was attemped.
*Action: When adding a column, do not specify a default value.
DROP column is only supported in the form of SET UNUSED column
(meta-data drop column).
alter table tcompressed set unused column x;
> table TCOMPRESSED altered.
alter table tcompressed drop unused columns;
>
Error report:
SQL Error: ORA-39726: unsupported add/drop column operation on compressed tables
39726. 00000 - "unsupported add/drop column operation on compressed tables"
*Cause: An unsupported add/drop column operation for compressed table
was attemped.
*Action: When adding a column, do not specify a default value.
DROP column is only supported in the form of SET UNUSED column
(meta-data drop column).
As you can see even after altering the table by setting the column X as unused I still cannot drop it by using DROP UNUSED COLUMNS.
Thank you.check this link it might help. At the end it has also mentioned of a bug check the same.
http://sharpcomments.com/2008/10/ora-39726-unsupported-adddrop-column-operation-on-compressed-tables.html -
Cannot drop column from table owned by SYS
Hello everybody,
How can I drop a column of table which is owned by sys? thanks!
Result as follows:
SQL> ALTER TABLE HELLO_TB DROP COLUMN NUM;
ALTER TABLE HELLO_TB DROP COLUMN NUM
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
newbie vYou can not 'change' the ownership.
You can, however, 'move' or 'clone' most objects by exporting and importing. As follows:
I create a table under SYS (shudder).
I then export it
- using userid SYS in this case,
- under normal circumstances I'd either use a DBA account or the owner's userid
- since I want a table, I use the TABLES option - a list is comma separated and in quotes
I then import it using a 'userid' switch - fromuser & touser options
- in this case from SYS to HR
Finally, I verify it was transported.
Actual console session in Linux follows:
pop2@fuzzy:~> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 19:58:01 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create table test1 ( x1 number );
Table created.
SQL> insert into test1 values (2);
1 row created.
SQL> select * from test1;
X1
2
SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
pop2@fuzzy:~> exp file=exp.dmp tables='TEST1'
Export: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:07 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST1 1 rows exported
Export terminated successfully without warnings.
pop2@fuzzy:~> imp file=exp.dmp fromuser=sys touser=hr
Import: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:44 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SYS's objects into HR
. . importing table "TEST1" 1 rows imported
Import terminated successfully without warnings.
pop2@fuzzy:~> sqlplus hr/hr
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:57 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from test1;
X1
2
SQL>The export/import pair are incredibly powerful - and few people understand them well. If you are interested in digging into their capability, check out their chapters in the Utilities manual (under the Books tab) at http://www.oracle.com/pls/db102/portal.portal_db?selected=1 -
How to hide the Columns and Views for Login user in SharePoint 2013
Hi Friends,
How to hide the Columns and Views for Login user in SharePoint 2013? Is it possible using OOB features? If not possible how can we hide the Columns and Views for Login user?
Could you please help on this.
Thanks,
Tiru
TiruHello Tirupal,
There is no OOB way to do this.
Please check this codeplex solution to achieve the same.
https://sp2013columnpermission.codeplex.com/
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful -
Problem dropping column in sqlplus.
I write
alter table u_gotobank drop column u_bacdamnt;
and it says i'm missing a key word at column.
what could be the problem?Jens, I don't think that's the problem :
SQL> desc test10
Name Null? Type
X NUMBER
Y CHAR(1)
Z CHAR(1)
W CHAR(1)
SQL> alter table test10 drop column w;
Table altered.
SQL>
Maybe you are looking for
-
In 6.0.2 Nightmare - Crashes, Lock-Ups
I updated to 6.0.2 and I have a full length doc that I'm editing. It was shot using the Canon H1 24f. All the footage (roughly 125 hours) has been logged to two LaCie Biggest FW800 drives. I bought a FW800 card to hopefully make things faster. Anyway
-
I have "upgraded" from Logic 7 to 8 (actually a downgrade in my opinion) and then to Logic 9. Now in L9, the Apple Loop browser crashes logic. It will not reindex. I can't play anything back, any activity in the browser crashes Logic. I've seen this
-
How can I push a personal video to an entire iPad cart?
We are currently using Apple Configurator and Cisco Meraki to manage updates and applications. We have the video file uploaded to the school's iTunes account but can't seem to figure out how to push the video file to all of the iPads in the cart at
-
Hi im trying to understand z index and i cant make it work, why i doesnt work? Adobe Creative Cloud
-
PB G4 1GHz - External Monitor flashing but eventually works
Something weird is going on with my Powerbook when I connect it to an external monitor. When I plug in the monitor the Powerbook will detect the external display, but the external monitor will flash on and off, intermittently displaying the screen, b