Delete a column from the table
Hi.
I would like to delete a column from a table. I want to drop the table and recreate it later. But this table has a primary key which
is a foreign key of other tables. So after I recreate the table I must recover the relationship of this table and other tables.
How do I get the information about the primary key of this table as a foreign key of other tables from data dictionary?
Thanks in advance
null
For ur query the reply whay u have got is correct one. For further quries similar to one u had u can download a tool named TOAD (Tools for Oracle Application Developer) from quest site (www.quest.com). Install it a proceed.
Do let me know how and what u feek about TOAD.
Similar Messages
-
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
How can we delete a line from the table control .
hi all
how can we delete a line from the table control .
situation is.
created table control in se51 which will display the data of a table.
how could i select a line from the table control ?
how could i delete the selected lines form the table.
thanks in advanceChange the Table Control attributes such that user can only select a single record(row).
<u>Tip to delete a selected record</u>
1) write a module 'Mark' in the PAI as below
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
LOOP WITH CONTROL table_view.
MODULE read_table_control.
FIELD flag MODULE mark ON INPUT.
ENDLOOP.
MODULE user_command_0100.
2) Module Mark is below.
MODULE mark INPUT.
CHECK flag = 'X'.
x = table_view-top_line + sy-stepl - 1.
Delete itab INDEX x.
ENDMODULE. " mark INPUT
Table_view is the TableControl Name.
'flag' is of type char(1) available in the Internal table which was assigned to the select option in the table control.
<u>award if uesful</u>
Regards,
Sudheer -
Deleting Material Master from the tables
Hello Gurus.
We marked the materials master as deletion. But we want to remove from tables. Can any one please guide me
Thanks
JJIn a production system is NO OTHER WAY, only archiving.
In a test system you can use MMDE, but keep in mind this erases the material from the material tables, but if a material was used e.g. in a purchase order, then this order will stay in your system.
If you reuse the material number you will then have inconsitencies to old transactional data, which may be pretty disturbing for all others that do tests. -
How can we delete value fields from the Table T237A?
Dear All,
We need to delete some value fields in CO-PA. We got a message that these value fileds are being used in the Table T237A.
This table is related to key figure scheme.
We have deleted in t.c. sm31 in the table/view V_RS_T237A elements which were assigned to value fields to be deleted.
But we still have a message value fields are being used. And after some searches we found out they are still being used in the table T237A.
COuld you please, help us?
Thank you in advance!
Best regards,
Kamila.Change the Table Control attributes such that user can only select a single record(row).
<u>Tip to delete a selected record</u>
1) write a module 'Mark' in the PAI as below
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
LOOP WITH CONTROL table_view.
MODULE read_table_control.
FIELD flag MODULE mark ON INPUT.
ENDLOOP.
MODULE user_command_0100.
2) Module Mark is below.
MODULE mark INPUT.
CHECK flag = 'X'.
x = table_view-top_line + sy-stepl - 1.
Delete itab INDEX x.
ENDMODULE. " mark INPUT
Table_view is the TableControl Name.
'flag' is of type char(1) available in the Internal table which was assigned to the select option in the table control.
<u>award if uesful</u>
Regards,
Sudheer -
Getting the same columns from the table twice
Hi,
I have a question.I am trying to join two tables whose structures and te data are as follows.
portAssoc
MOId AssociatedMOId AssociatedClass
2 1 CrossConnect
1 1 CrossConnect
7 3 CrossConnect
6 3 CrossConnect
crossConnect
MOClass MOId MOName MOParentClass MOParentId
CrossConnect 1 pvc2 Port 1
CrossConnect 3 pvc5 Port 1 active
Port
MOClass MOId MOName MOParentClass MOParentId portIndex
Port 1 vcl5 Card 2 10
Port 2 vcl4 Card 2 20
Port 6 vcl8 Card 2 30
Port 7 vcl9 Card 2 40
I would like to get the output as follows.
MOId networkInterfaceMOId networkPort lineInterfaceMOId linePort
Here the MOId is the MOId of the crossConnect.This is equal to the AssociatedMOId of the portAssoc table.The networkIntefaceMOId is the MOId of the portAssoc which is equal to the MOId of the port.The networkPort is the portIndex in the port table and this is the same for lineInterfaceMOId and linePort.i.e, I have to be able to get the moid of tha associated class and the moid and some values of the port which are asociated.Can any one please tell me how to do this.
your help would be greatly appriciated.
Thanks and Regards,
BhagyaTry this:
select c.MOld, a.MOld as 'networkInterfaceMOld', p.portIndex as 'networkPort', 'lineInterfaceMOld', 'linePort'
from crossConnect c, portAssoc a, Port p
where c.MOid = a.AssociatedMOid
and a.MOid = p.MOid
I'm not quite sure what you mean by "...and this is the same for lineInterfaceMOId and linePort"
but if they are a column in one of your tables, just add it in based on the model above.
hth
Chris
www.MyDBA2000.com
Hi,
I have a question.I am trying to join two tables whose structures and te data are as follows.
portAssoc
MOId AssociatedMOId AssociatedClass
2 1 CrossConnect
1 1 CrossConnect
7 3 CrossConnect
6 3 CrossConnect
crossConnect
MOClass MOId MOName MOParentClass MOParentId
CrossConnect 1 pvc2 Port 1
CrossConnect 3 pvc5 Port 1 active
Port
MOClass MOId MOName MOParentClass MOParentId portIndex
Port 1 vcl5 Card 2 10
Port 2 vcl4 Card 2 20
Port 6 vcl8 Card 2 30
Port 7 vcl9 Card 2 40
I would like to get the output as follows.
MOId networkInterfaceMOId networkPort lineInterfaceMOId linePort
Here the MOId is the MOId of the crossConnect.This is equal to the AssociatedMOId of the portAssoc table.The networkIntefaceMOId is the MOId of the portAssoc which is equal to the MOId of the port.The networkPort is the portIndex in the port table and this is the same for lineInterfaceMOId and linePort.i.e, I have to be able to get the moid of tha associated class and the moid and some values of the port which are asociated.Can any one please tell me how to do this.
your help would be greatly appriciated.
Thanks and Regards,
Bhagya -
Delete a column froma table that is used in multiple interfaces
Is there a way to delete a column from a table where the table is being used in an interface ? The only way I could find so far was to delete the interface, delete the column then recreate the interface.
Otherwise deleting warns that the object is referred to by another object and lists the interfaces.
unfortunately the table in question is being referred to in multiple interfaces, so I'd prefer not to have to recreate all of them.
Many thanksYou can delete all the mappings (source an target) which refer to this column and then physically delete the column.
It's long but maybe better than dropping the whole interfaces using this column.
Regards and Merry Christmas
Brice -
Delete many rows from one table at once URGENT
Assume we have table called emp.
table desription:
SQL> desc emp
Name Null? Type
EMPNO NOT NULL NUMBER(6)
DIVISION NOT NULL NUMBER(3)
JOB_NO NOT NULL NUMBER(4)
START_DATE NOT NULL DATE
select * from emp;
EMPNO--------DIVISION--------JOB_NO------------START_DATE
1111------------------011-------------8181--------------04/10/1999
1111------------------011-------------8181--------------04/10/2004
2222------------------011-------------3131--------------05/11/2005
3333-----------------022-------------8181--------------06/09/2001
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------044-------------8181--------------06/24/1996
7777-----------------033-------------8181--------------12/02/1991
7777-----------------033-------------8181--------------03/01/2002
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989
My goal is to delete employee records for those employee which contains multiple values for JOB_NO
equal to 8181, (JOB_NO= 8181) with new start_dateS.
We need to keep only one record for JOB_NO 8181 which contains oldest start_date.
Here is the delete statement for the single record.
delete from emp
where empno = 7777 and job_no = 8181 and start_date in ('03/01/2002','06/24/1996);
So how could I delete thousands records from the table with this logic?
After deleting multiple records table should be as below:
select * from emp;
EMPNO--------DIVISION--------JOB_NO---------START_DATE
1111-----------------011-------------8181--------------04/10/1999
2222-----------------011-------------3131--------------05/11/2005
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------033-------------8181--------------12/02/1991
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989Here's one way to do it. I think this fits your business rules. At least it matches the output for your first example. It uses an analytic. I just like using them.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
1111 11 8181 10-APR-2004
2222 11 3131 11-MAY-2005
3333 22 8181 09-JUN-2001
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 44 8181 24-JUN-1996
7777 33 8181 02-DEC-1991
7777 33 8181 01-MAR-2002
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
12 rows selected.
SQL> delete employees
2 where rowid in
3 (select rowid
4 from
5 (
6 select empno
7 ,job_no
8 ,start_date
9 ,row_number() over (partition by empno, job_no order by start_date) rn
10 from employees
11 where job_no = 8181
12 )
13 where rn > 1
14 )
15 ;
4 rows deleted.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
2222 11 3131 11-MAY-2005
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 33 8181 02-DEC-1991
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
8 rows selected. -
Deleting a row from a table containing CLOB as one of the columns
When i delete a row from a table which contains a CLOB (internal clob) i.e. CLOB or BLOB column, Will the CLOB data will also be deleted ? I understand that what exactly stored in the CLOB column is the clob locator which points to the actual data.
So, when I delete this row, the clob locator will be deleted, but will the actual data what this locator is pointing to is also deleted ??? if not what is the process to delete the data the locator is pointing to when the row containing the locator is deleted ? If this is not happening then the actual data might become an orphan data which nobody has access to, will automatic garbage cleaning occurs on a frequent intravels to delete unaddressed data residing on the database server ?
Thanks in advance for the help, can email me at [email protected] alternatively.
Regards,
Srinivasa C.Michael,
Thanks very much for your inputs, here are the results i got when i tried the way you explained in your answer, the TRUNCATE command made the actual size back to normal, but the delete is not the same, so, how can i delete the data that a particular clob locator may point to ?
truncate would delete all the rows of the table, which might not serve my purpose, i would like to delete a row and also it's associated clob data from the database! is there anyway to do this ?
is there any limitation on the ool_sample size? i am basically a c++ programmer, i am looking for some function like FREE which would free the allocated memory to the clob once the locator is deleted.
your help is greatly appreciated - Thanks!
:-) Srini.
==========================
My Results:
==========================
SQL> create table sample (
2 id integer primary key,
3 the_data CLOB default empty_clob() )
4 lob (the_data) store as ool_sample;
Table created.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
20K
SAMPLE
10K
SQL> select count(*) from sample;
COUNT(*)
0
SQL> begin
2 for i in 1..1000
3 loop
4 insert into sample values (i, RPAD('some data', 4000) );
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> delete sample;
1000 rows deleted.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> commit;
Commit complete.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> begin
2 for i in 1..1000
3 loop
4 insert into sample values (i, rpad('some data', 4000));
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
9616K
SAMPLE
70K
SQL> truncate table sample;
Table truncated.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
20K
SAMPLE
10K -
Hi folks,
I have delete program to delete entries from a custom table and has only one feld in it.
tables: ZABC
selection-screen begin of block B1 with frame title text-110.
select-options: P_KOSTL for ZABC-KOSTL.
selection-screen end of block B1.
delete from ZABC where KOSTL in P_KOSTL.
Upon executing I am entering certain cost center ids on the selection screen to delete them from the table.It did not work.
what is it I am missing?
Thanks,
SKHi,
Try this sample code..Replace ZABC with your table..
TABLES: ZABC.
selection-screen begin of block B1 with frame title text-110.
select-options: P_KOSTL for ZABC-KOSTL.
selection-screen end of block B1.
START-OF-SELECTION.
* Delete the records from the table.
DELETE FROM ZABC where KOSTL IN P_KOSTL[ ]. " [] for the select-options.
IF sy-subrc <> 0.
ROLLBACK WORK.
ELSE.
COMMIT WORK.
ENDIF.
Thanks,
Naren -
Delete all entries from the following tables - Follow-up Activities (oracle)
Hello,
I performed a homogeneous system copy of our development BW system with the database (oracle 11.2.0.3) from the BW production system!
I already start the oracle database and the SAP system in the target system/server (development BW system) and I´m doing some follow-up activities. One of this activities is (at the system copy guide 6.2.3.2 Activities at Database Level) is to delete all entries from the following tables:
DBSTATHORA, DBSTAIHORA, DBSTATIORA, DBSTATTORA
I tried to delete them using SQL Plus:
sqlplus /nolog
SQL> connect /as sysdba
SQL> delete from DBSTATTORA;
delete from DBSTATTORA
ERROR at line 1:
ORA-00942: table or view does not exist
... and it show me that error message.
This is strange because when I go to transaction SE14 and check the DBSTATTORA I see that table exist and contain a lot of entries!
Why this is happened in SQL Plus!? I´m running the correct SQL statement for doing this type of task or not?
How can I delete the entries of that tables? Can I do that using the transaction SE14?
Can you help me please?
Thank you,
samid raifHello
sqlplus /nolog
SQL> connect /as sysdba
SQL> delete from DBSTATTORA;
delete from DBSTATTORA
ERROR at line 1:
ORA-00942: table or view does not exist
It doesn't surprise me as you are not mentioning the schema name here. Instead it should be
delete from SAPSR3.DBSTATTORA;
Assuming the schema owner is SAPSR3. if the owner is different then replace that with the correct one.
Regards
RB -
How can I delete an item from the main left column of iTunes?
I'd like to delete an item from the main left hand column in iTunes (the column containing the main headings LIBRARY, STORE, SHARED, PLAYLISTS etc etc). Under the first heading 'LIBRARY' appear the items Library, Music, Movies, iTunes U, Books, Apps and Ringtones. I'd like to remove the item "Library" from that list - it appears immediately after the heading "LIBRARY" and serves no purpose whatsoever. (Neither does it appear to cause any harm, I must say, just a nuisance.) This item does not appear in any of the iTunes viewing options or controls lists. Neither does it appear in iTunes in the other accounts on my Mac and I have yet to see it any other iTunes on any other Mac.
I've upgraded since about iTunes 8 assuming the problem would eventually disappear through the upgrades but it hasn’t, even through all the providedupgrade increments available for iTunes.
I'm assuming it's from something I've installed in my main user account at some stage and it entered this item in the iTunes app. But I can't see how to remove it. The only things I can remember installing are "iTunes Batch Column Renamer" and "Join Together", both if which are just Scripts and which I use fairly regularly, but I don't recall either of them installing that particular item.
Is there any folder I can navigate to to edit the list of items in that main left hand column of iTunes?
Many thanks in advance for any help offered.on second thought, that you have an item "library" is indeed odd - there shouldn't be.
suggest you try removing iTunes completely (click here and follow the instructions), then reinstall it using the standalone installer from here: http://www.apple.com/itunes/download/.
note this will not do anything to your media files, playlists, ratings, etc.
btw, you didn't install any 3rd party tools like this script:
Change Hidden iTunes Preferences v2.4
This application will allow you to invoke hidden iTunes preferences:
Show "Library" playlist
Changing view setting is global
Allow half-stars in ratings
Hide "Ping" buttons
Show/hide arrow links -- to either search the iTunes Store or search your library
Load complete iTunes Store preview before playing
Create playlists for purchased song collections
Play songs while importing or converting
Create file names with track number
Maintain grid view for Search results
Option-click zoom button for Mini Player&
Show buttons horizontally
Message was edited by: Jolly Giant -
I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??
Hi Kishore,
First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table. -
Combining the same column from 2 tables with distinct result.
I have 2 tables with identical name columns. One is current people and the other is historical people. I want a select that returns any name that is in either table. I want each name listed only once. I want to see 1 entry for each name if it is in the current table, the historical table, or both tables. I can easily do a select distinct on each table but how do I join the queries to get 1 result set with no duplicates? The name column is not a key field and I don't want any other columns from either table.
Just a simple UNION:
select name
from current
union
select name
from historical; -
Records have been deleted from the table.
Hi all ,
If records have been deleted from the table that any log file maintains the history as following Way.
User Name who delete the records.
Machine name where the command is execute.
The command syntax e.g delete from abc where ..
or any other help related to mentioned problem.
Regards,
Mobeen.Wrong forum .. your question doesnt make much sense.
But take a look at Oracle Auditing.
Maybe you are looking for
-
Can no longer burn DVD's on my MacBook Pro
As the title says, I can no longer burn DVD's. I can burn CD's but not DVD's. I get Sense= code errors and stuff no matter what burner I try out. It doesn't always want to read the DVD's either but ejects them one- two times before it surrenders and
-
10.0.2 reader for Windows still not available
hi - over 6 hours after the security bulletin was released there is still no 10.0.2 reader for Windows available - please could Adobe advise when this will be online? I'm looking at both of these locations and 10.0.1 is the latest... http://www.adobe
-
Can Iuse non Apple display with a new MacBook Pro?
Can I use a non Apple display with a new MacBook Pro? Special connections?
-
IPhoto '11 Crash-Please Help!
I've been trying all the tips from the various fora for the last week and nothing is working. Can someone please help??? Here's my crash report: Process: iPhoto [51601] Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto Identifie
-
When I send someone a forward of text (someone else's email) using Mail in Tiger and they reply back many of the characters and some of the spaces are jumbled and replaced with wierd letters. I can't be sure that it is only from my end or whether the