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 v

You 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

Similar Messages

  • 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 solve ORA-30756 "cannot create column or table of type that..."

    Hi there!
    I'm working on some excersises for the university but just can't get rid of this error.
    First, here's my SQL:
    [http://pastebin.com/f1266a668]
    And here is what I get:
    TYPE "LieferserviceTyp" Kompiliert.
    TYPE "ArtikelTyp" Kompiliert.
    TYPE "LebensmittelTyp" Kompiliert.
    TYPE "HaushaltswarenTyp" Kompiliert.
    TYPE "ArtikelInArtKombiTyp" Kompiliert.
    TYPE "ArtikelKombiTyp" Kompiliert.
    TYPE "ArtikelInKatalogTyp" Kompiliert.
    TYPE "KatalogTyp" Kompiliert.
    Fehler beim Start in Zeile 60 in Befehl:
    CREATE TABLE "Artikel" OF "ArtikelTyp" (
    PRIMARY KEY("artnr")
    Fehler bei Befehlszeile:60 Spalte:0
    Fehlerbericht:
    SQL-Fehler: ORA-30756: Spalte oder Tabelle mit einem Objekttyp, der ein Supertyp-Attribut enthält, kann nicht erstellt werden
    30756. 00000 - "cannot create column or table of type that contains a supertype attribute"
    *Cause:    The user tried to create a column or table of an object type that
    contains a supertype attribute. This is not supported because
    it leads to infinite recursion in our current storage model.
    Note that creating a column of a type implies that we
    create columns corresponding to all subtype attributes as well.
    *Action:   Change the type definition to contain a supertype REF attribute
    instead of the supertype object attribute.
    Fehler beim Start in Zeile 67 in Befehl:
    CREATE TABLE "Kataloge" OF "KatalogTyp" (
    PRIMARY KEY("katalog_id")
    Fehler bei Befehlszeile:67 Spalte:0
    Fehlerbericht:
    SQL-Fehler: ORA-30756: Spalte oder Tabelle mit einem Objekttyp, der ein Supertyp-Attribut enthält, kann nicht erstellt werden
    30756. 00000 - "cannot create column or table of type that contains a supertype attribute"
    *Cause:    The user tried to create a column or table of an object type that
    contains a supertype attribute. This is not supported because
    it leads to infinite recursion in our current storage model.
    Note that creating a column of a type implies that we
    create columns corresponding to all subtype attributes as well.
    *Action:   Change the type definition to contain a supertype REF attribute
    instead of the supertype object attribute.
    Fehler beim Start in Zeile 76 in Befehl:
    DROP TABLE "Artikel"
    Fehlerbericht:
    SQL-Fehler: ORA-00942: Tabelle oder View nicht vorhanden
    00942. 00000 - "table or view does not exist"
    *Cause:   
    *Action:
    Fehler beim Start in Zeile 77 in Befehl:
    DROP TABLE "Kataloge"
    Fehlerbericht:
    SQL-Fehler: ORA-00942: Tabelle oder View nicht vorhanden
    00942. 00000 - "table or view does not exist"
    *Cause:   
    *Action:
    DROP TYPE "KatalogTyp" erfolgreich.
    DROP TYPE "ArtikelInKatalogTyp" erfolgreich.
    DROP TYPE "ArtikelKombiTyp" erfolgreich.
    DROP TYPE "ArtikelInArtKombiTyp" erfolgreich.
    DROP TYPE "HaushaltswarenTyp" erfolgreich.
    DROP TYPE "LebensmittelTyp" erfolgreich.
    DROP TYPE "ArtikelTyp" erfolgreich.
    DROP TYPE "LieferserviceTyp" erfolgreich.
    The comments are in german but the structure should be clear I think.
    Any help appreciated!

    Unfortunately it's a bad idea to store your code samples (or screenshots or whatever) on an external site, because not everybody can get access to such sites, especially if their workplace has limitations on websites that can be visited.
    you're pastebin.com is one such site that I cannot access, so I can't see your code.
    If you want to paste code and/or data on the forums remember to put the tag: {noformat}{noformat} before _and_ after it, so that the formatting is maintained and it's easier for us to read.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Com.waveset.util.ConfigurationError: Cannot find columns for table 'object'

    I am trying to install IDM on my own laptop and use MS SQL Server 2000 as the repository. I run the create table scripts, copy all the jar files to C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Idm\WEB-INF\lib. But I still got the following error message:
    com.waveset.util.ConfigurationError: Cannot find columns for table 'object' ==>com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'object'
    Does anyone have any idea of what may cause this problem?
    THANKS!

    I found the solution to this issue.. is that the Database user ID must be set to the schema .. this is the statment that probably did not work:
    CREATE USER <username> FOR LOGIN <login name> with DEFAULT_SCHEMA = <database name>
    In sql 2005 expand the database... open security .. find the user.. right click and select properties.. in the default schema box.. select the SunSync database .. in the schemas owned by this user select the sunsync schema database..
    good luck

  • XML Column from table extract to Pipe Delimited Text File

    Hi,
    I have an XML column with large data in a Table ( Source SQL server Database).
    I was asked to   extract    XML column to .txt file using SSIS.
    Is it possible to extract xml column with huge data to text file ?
    when I tried,  select XML column from Table in source , I noticed  that Property of column is taken as [DT_NTEXT] . I Converted it to DT_TEXT as Ansi donot support DT_NTEXT.
    Execution method was success but it failed due to trucation. so wondering is there a way to get XML column extracted to Pipe delimited text file?
    Is it advisable to do this ? or IS It Valid to export XML in Pipe Delimited File ?
    Please Kindly advice
    thanks
    kodi

    Are you looking at shredding data within XML nodes and then importing it to text file or are you looking at exporting XML value as is? Also is SSIS a necessity?
    If not, You can simply use T-SQL for this along with bcp for this. just use a query like
    EXEC xp_cmdshell 'bcp "SELECT CAST(XMLColumn AS varchar(max)) AS Column FROM table" queryout <full file path> -c -S <ServerName> -T -t |'
    provided you use trusted connection (windows authentication)
    see
    http://visakhm.blogspot.in/2013/10/bcp-out-custom-format-data-to-flat-file.html
    If you want to shred the data use Xpath functions in the query as below
    http://visakhm.blogspot.in/2012/10/shred-data-as-well-as-metadata-from-xml.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error in Dropping columns from Subject Area to selected Columns section

    While Dropping columns from Subject Area to selected Columns section in Analytics nothing is happening.There is no error in the RPD.I am using OBIEE 11g and windows7.I am also getting page error like below:
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
    Timestamp: Tue, 4 Sep 2012 08:31:07 UTC
    Message: 'kmsgPickerUIJSCantAddColumns' is undefined
    Line: 1
    Char: 1781
    Code: 0
    URI: http://localhost:7001/analytics/res/b_mozilla/picker.js
    Message: 'kmsgPickerUIJSCantAddColumns' is undefined
    Line: 1
    Char: 1781
    Code: 0
    URI: http://localhost:7001/analytics/res/b_mozilla/picker.js
    Can you guys please help?

    That error usually means it is still mapped, maybe it is used in another interface if you say the mapping has definitely been removed.
    You can expand the datastore > Used In > "As a Target" or "As a Source" or "In a Package" - that should tell you if it being used anywhere else.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • DROP column from constarints

    Hi,
    I need to know the command to drop columns from primary key constraints.(some columns)
    Please help on this,
    Thanks,

    826854 wrote:
    is there any other way to drop only some columns without recreating it.
    just i want to know alternate , if iam wrong please ignore.
    Thanks for the answer.Its there any issue you face to just drop and add new primary key in your setup i.e. you fear that volum is high and dropping and adding back would take time?

  • Drop column from compressed partitioned table

    Hi,
    DB version is 11.2.02.
    We have table which is range partitioned and sub-partitioned by list.
    Table is also compressed.
    When I try to drop a column, I get error.
    CREATE TABLE DWH_REP.P_RATING (
      id_source$                 NUMBER(38,0)  NULL,
      time_insert$               DATE          ,
      time_update$               DATE          ,
      FLG_CURRENT$               NUMBER(38,0)  ,
      FLG_CHANGED$               NUMBER(38,0)  ,
      id_audit$                  NUMBER(38,0)  ,
      ID_DATE_PSTING             NUMBER(38,0)  ,
      partner_rating_id          VARCHAR2(256) ,
      partner_id                 VARCHAR2(256) ,
      id_partner                 NUMBER(38,0)  , 
      rating_system_id           VARCHAR2(256) ,
      rating_id                  VARCHAR2(256) ,
      date_rating                DATE          ,
      date_follow_up             DATE          ,
      risk_team_id               VARCHAR2(256) ,
      risk_team_descr            VARCHAR2(256) ,
      risk_team_changed_id       VARCHAR2(256) ,
      risk_team_changed_descr    VARCHAR2(256) ,
      date_risk_team_changed     DATE          ,
      assignment_id              VARCHAR2(256) ,
      date_assignment            DATE          ,
      date_assignment_confirmed  DATE          ,
      date_assignment_expiration DATE          ,
      flg_exception              VARCHAR2(256) ,
      exception_id               VARCHAR2(256) ,
      date_exception             DATE         
    -- TABLESPACE DWH_REP_DATA
    PARTITION BY RANGE (FLG_CURRENT$, ID_DATE_PSTING)
       SUBPARTITION BY LIST (ID_SOURCE$)
       (PARTITION P_RATING_2010               
           VALUES LESS THAN (0, 20110101)
           SUBPARTITION P_RATING_2010_UCS VALUES  (10) TABLESPACE DWH_O_2010_TBS,
           SUBPARTITION P_RATING_2010_UCM VALUES (11) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_ORBI30 VALUES  (30) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_ORBI31 VALUES  (31) TABLESPACE DWH_O_2010_TBS,
           SUBPARTITION P_RATING_2010_CETELEM VALUES  (40) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_MILES VALUES  (60) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_BHI VALUES  (80) TABLESPACE DWH_O_2010_TBS,
           SUBPARTITION P_RATING_2010_DF VALUES  (DEFAULT) TABLESPACE DWH_O_2010_TBS),   
         PARTITION P_RATING_2011            
           VALUES LESS THAN (0, 20120101)
           SUBPARTITION P_RATING_2011_UCS VALUES (10) TABLESPACE DWH_O_2011_TBS,
           SUBPARTITION P_RATING_2011_UCM VALUES (11) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_ORBI30 VALUES (30) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_ORBI31 VALUES (31) TABLESPACE DWH_O_2011_TBS,
           SUBPARTITION P_RATING_2011_CETELEM VALUES (40) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_MILES VALUES (60) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_BHI VALUES (80) TABLESPACE DWH_O_2011_TBS,
           SUBPARTITION P_RATING_2011_DF VALUES (DEFAULT) TABLESPACE DWH_O_2011_TBS),
        PARTITION P_RATING_current           
           VALUES LESS THAN (maxvalue, maxvalue)
           SUBPARTITION P_RATING_CUR_UCS VALUES (10) TABLESPACE DWH_O_CRT_UCS_TBS,
           SUBPARTITION P_RATING_CUR_UCM VALUES (11) TABLESPACE DWH_O_CRT_UPM_TBS,
    --     SUBPARTITION P_RATING_CUR_ORBI30 VALUES (30) TABLESPACE DWH_O_CRT_ORBI30_TBS,
    --     SUBPARTITION P_RATING_CUR_ORBI31 VALUES (31) TABLESPACE DWH_O_CRT_ORBI31_TBS,
           SUBPARTITION P_RATING_CUR_CETELEM VALUES (40) TABLESPACE DWH_O_CRT_CETELEM_TBS,
    --     SUBPARTITION P_RATING_CUR_MILES VALUES (60) TABLESPACE DWH_O_CRT_MILES_TBS,
    --     SUBPARTITION P_RATING_CUR_BHI VALUES (80) TABLESPACE DWH_O_CRT_BHI_TBS,
           SUBPARTITION P_RATING_CUR_DF VALUES (DEFAULT) TABLESPACE DWH_O_CRT_DF_TBS))
    ENABLE ROW MOVEMENT
    NOLOGGING
    COMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    ALTER TABLE DWH_REP.P_RATING DROP COLUMN ID_PARTNER;
    ORA-39726: unsupported add/drop column operation on compressed tables

    littleboy wrote:
    Hi,
    DB version is 11.2.02.
    We have table which is range partitioned and sub-partitioned by list.
    Table is also compressed.
    When I try to drop a column, I get error.
    CREATE TABLE DWH_REP.P_RATING (
    id_source$                 NUMBER(38,0)  NULL,
    time_insert$               DATE          ,
    time_update$               DATE          ,
    FLG_CURRENT$               NUMBER(38,0)  ,
    FLG_CHANGED$               NUMBER(38,0)  ,
    id_audit$                  NUMBER(38,0)  ,
    ID_DATE_PSTING             NUMBER(38,0)  ,
    partner_rating_id          VARCHAR2(256) ,
    partner_id                 VARCHAR2(256) ,
    id_partner                 NUMBER(38,0)  , 
    rating_system_id           VARCHAR2(256) ,
    rating_id                  VARCHAR2(256) ,
    date_rating                DATE          ,
    date_follow_up             DATE          ,
    risk_team_id               VARCHAR2(256) ,
    risk_team_descr            VARCHAR2(256) ,
    risk_team_changed_id       VARCHAR2(256) ,
    risk_team_changed_descr    VARCHAR2(256) ,
    date_risk_team_changed     DATE          ,
    assignment_id              VARCHAR2(256) ,
    date_assignment            DATE          ,
    date_assignment_confirmed  DATE          ,
    date_assignment_expiration DATE          ,
    flg_exception              VARCHAR2(256) ,
    exception_id               VARCHAR2(256) ,
    date_exception             DATE         
    -- TABLESPACE DWH_REP_DATA
    PARTITION BY RANGE (FLG_CURRENT$, ID_DATE_PSTING)
    SUBPARTITION BY LIST (ID_SOURCE$)
    (PARTITION P_RATING_2010               
    VALUES LESS THAN (0, 20110101)
    SUBPARTITION P_RATING_2010_UCS VALUES  (10) TABLESPACE DWH_O_2010_TBS,
    SUBPARTITION P_RATING_2010_UCM VALUES (11) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_ORBI30 VALUES  (30) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_ORBI31 VALUES  (31) TABLESPACE DWH_O_2010_TBS,
    SUBPARTITION P_RATING_2010_CETELEM VALUES  (40) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_MILES VALUES  (60) TABLESPACE DWH_O_2010_TBS,
    --     SUBPARTITION P_RATING_2010_BHI VALUES  (80) TABLESPACE DWH_O_2010_TBS,
    SUBPARTITION P_RATING_2010_DF VALUES  (DEFAULT) TABLESPACE DWH_O_2010_TBS),   
    PARTITION P_RATING_2011            
    VALUES LESS THAN (0, 20120101)
    SUBPARTITION P_RATING_2011_UCS VALUES (10) TABLESPACE DWH_O_2011_TBS,
    SUBPARTITION P_RATING_2011_UCM VALUES (11) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_ORBI30 VALUES (30) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_ORBI31 VALUES (31) TABLESPACE DWH_O_2011_TBS,
    SUBPARTITION P_RATING_2011_CETELEM VALUES (40) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_MILES VALUES (60) TABLESPACE DWH_O_2011_TBS,
    --     SUBPARTITION P_RATING_2011_BHI VALUES (80) TABLESPACE DWH_O_2011_TBS,
    SUBPARTITION P_RATING_2011_DF VALUES (DEFAULT) TABLESPACE DWH_O_2011_TBS),
    PARTITION P_RATING_current           
    VALUES LESS THAN (maxvalue, maxvalue)
    SUBPARTITION P_RATING_CUR_UCS VALUES (10) TABLESPACE DWH_O_CRT_UCS_TBS,
    SUBPARTITION P_RATING_CUR_UCM VALUES (11) TABLESPACE DWH_O_CRT_UPM_TBS,
    --     SUBPARTITION P_RATING_CUR_ORBI30 VALUES (30) TABLESPACE DWH_O_CRT_ORBI30_TBS,
    --     SUBPARTITION P_RATING_CUR_ORBI31 VALUES (31) TABLESPACE DWH_O_CRT_ORBI31_TBS,
    SUBPARTITION P_RATING_CUR_CETELEM VALUES (40) TABLESPACE DWH_O_CRT_CETELEM_TBS,
    --     SUBPARTITION P_RATING_CUR_MILES VALUES (60) TABLESPACE DWH_O_CRT_MILES_TBS,
    --     SUBPARTITION P_RATING_CUR_BHI VALUES (80) TABLESPACE DWH_O_CRT_BHI_TBS,
    SUBPARTITION P_RATING_CUR_DF VALUES (DEFAULT) TABLESPACE DWH_O_CRT_DF_TBS))
    ENABLE ROW MOVEMENT
    NOLOGGING
    COMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    ALTER TABLE DWH_REP.P_RATING DROP COLUMN ID_PARTNER;
    ORA-39726: unsupported add/drop column operation on compressed tables
    can you checkwith following?
    SQL>alter table t set unused column x;
    SQL>alter table t drop unused columns;Tom explains it ->http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:69076630635645

  • Update table a columns using columns from table b (values of 2 columns of table b need to taken from table c)

    Guys,
    I need to update table A columns col3, col4, col5 and col6 by table b columns col3, col4, col5 and col6 however table b col5 and col6 values need to come from table c col1.
    Means table b col5 and col6 have values in it however i need to replace them with value from table c col1 and need to update table a col5 and col6 accordingly.
    table a and table b has col1 and col2 in common.
    i am trying something like this.
    Update a
    a.col3 = b.col3,
    a.col4 = b.col4,
    a.col5 = (select col1 from table_c c where c.col2=b.col5),
    a.col6 = (select col1 from table_c c where c.col2=b.col6)
    from table_A a inner join table_b
    on  a.col1=b.col1 and a.col2=b.col2
    can someone help me reframe above update query?
    thanks in advance for your help.

    Try the below:(If you have multiple values, then you may need to use TOP 1 as commented code in the below script)
    create Table tableA(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
    Insert into tableA values(1,2,3,4,5,6)
    create Table tableB(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
    Insert into tableB values(1,2,30,40,50,60)
    create Table tableC(Col1 int,Col2 int,Col3 int,Col4 int,Col5 int,Col6 int)
    Insert into tableC values(100,50,30,40,2,2)
    --Insert into tableC values(200,50,30,40,2,2)
    Insert into tableC values(100,60,30,40,2,2)
    Select * From tablea
    Update a Set
    a.col3 = b.col3,
    a.col4 = b.col4,
    a.col5 = (select col1 from tablec c where c.col2=b.col5 ),
    a.col6 = (select col1 from tablec c where c.col2=b.col6 )
    from tableA a inner join tableb b
    on a.col1=b.col1 and a.col2=b.col2
    --Update a Set
    --a.col3 = b.col3,
    --a.col4 = b.col4,
    --a.col5 = (select Top 1 col1 from tablec c where c.col2=b.col5 Order by c.Col1 asc),
    --a.col6 = (select Top 1 col1 from tablec c where c.col2=b.col6 Order by c.Col1 asc)
    --from tableA a inner join tableb b
    --on a.col1=b.col1 and a.col2=b.col2
    Select * From tablea
    Drop table tablea,Tableb,TableC

  • 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 thanks

    You 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

  • End User will build the report by himself by choosing the columns from tabl

    We are using Oracle 10g Application server (Forms and Report Services), Forms and Report., our most urgent requirement is End User have to build the required reports by him Like wizards style, (Example Adhoc, MIS reports)., More clear, from the form we want to show all the tables structures, queries, after that end user will choose some columns from the form and specified the condition by himself to run the report after that he will press start button , then automatically report has build for the selected columns from the end user., and this report is parmanent afterwords., he can use any time.
    Like this kind of report building is possiable , anyone has faced same situation.

    Yes it is.
    In BW, this can be achieved by using document management. The option will be available to the user via context menu in the report (goto-->documents - text/pdf/img etc). In your case user can choose to create/change/display a 'text' document, which will be attached to the report.
    cheers,

  • Columns from table FLASHBACK_TRANSACTION_QUERY

    Hi, have any problem with columns START_TIMESTAMP and COMMIT_TIMESTAMP from table FLASHBACK_TRANSACTION_QUERY ?
    It's declarated in type DATE.
    This is correct ?
    Message was edited by:
    anderson.rf
    Message was edited by:
    anderson.rf

    Hi
    If I understand correctly then you can use
    SQL> select to_char(START_TIMESTAMP, 'DD/MM/YY HH:MI:SS') FROM FLASHBACK_TRANSACTION_QUERY
    Hope it helps.
    Rgds
    Adnan

  • HOWTO drop column from Designer instead of warning

    Hi,
    is there possibility to tell designer to generate scripts for dropping columns that are no longer in repository? I'm using Designer 6i.
    Thank you,
    Radek

    This functionality is not available in Designer at this point. The decision not to drop the column was in order to try to preserve data integrity.
    However, as the database now allows you to do this, we have decided to add this functionality to Designer. In the short term you will need to
    update your DDL scripts manually, but we hope to bring you this functionality automatically from Designer by the end
    of this calendar year or early next year in a maintenance release.
    Regards
    Sue Harper

  • Adding or Deleting Rows and Columns from Tables

    I have notices that you can't delete or add a row or columns from a table in iWeb without having problems.
    You may get two added or deleted.
    I should indicate that the table comes from Excel.
    Does anyone know of a work-around?

    Problem 1 - The sub-form 'Stds' was not configured for repeating rows.
    Problem 2 - The script was on the wrong event. The script should be on the 'change' event and not the 'initialize' event.
    Problem 3 - Which header row in which sub-form are you referring too?
    Steve

  • Cannot drop login from SQL 2012

    I am trying to drop a login with no mapped dbs, no owned schemas, no rights, no endpoints, nothing what-so-ever and I have been at this for 4 hours.  This is the error, is there any global way to determine what in the world SQL 2012 sees this login
    as owning?????
    Msg 15141, Level 16, State 1, Line 1
    The server principal owns one or more server role(s) and cannot be dropped.

    ****************To check User Own Schema
    select * from sys.schemas where principal_id = user_id('user_name')
    select * from sys.database_principals where owning_principal_id in (
    select principal_id from sys.database_principals where name='DomainName\UserName')
    ALTER AUTHORIZATION ON SCHEMA::SchemaName TO dbo
    *************** To Transfer any object owned by user/principal
    SELECT 'ALTER SCHEMA [dbo] TRANSFER [' + SCHEMA_NAME([schema_id]) + '].[' + [name] + '];'
    FROM sys.objects
    WHERE [schema_id] IN (SELECT [schema_id] FROM sys.schemas WHERE principal_id = USER_ID('DomainName\UserName'))
    ************** To Check Role Owner
    select dp2.name as role, dp1.name as owner
    from sys.database_principals as dp1 inner join sys.database_principals as dp2
    on dp1.principal_id = dp2.owning_principal_id
    where dp1.name = 'Username'
    ************** To Change Role Owner
    ALTER AUTHORIZATION ON ROLE::[RoleName] TO [dbo];

Maybe you are looking for

  • How can i get apple to reset my iphone4

    i go to unlock my iphone 4 and it restarts and i cant text anyone or do anything can apple rest my phone?

  • Where can I change the font settings for the name of the month in iPhoto's calendar project?

    where can I change the font settings for the name of the month in iPhoto's calendar project?  I just ordered two copies of a calendar I designed in iPhoto and was surprised to find that the calendar's months were printing in something like an Arial 1

  • Can anyone help with a table problem?

    Hi, everybody! (ID CS5 -- Windows 7) I have a zillion tables to prepare for a very long document. The tables are in Word. I placed one of them and tried to do a table style. Everything works but I am not able to record in the style the row height of

  • What is the best data type to store XML string

    Hello all, If we want to store a XML string in oracle database table for some other program use what is the best data type that we can use in the table to store this XML string.. Is it VARCHAR? or can we use BLOB type Anybody to help please Message w

  • Detaching query in BI 7.0

    Hi, In 3.5 it was possible to detach the queries in a workbook. Can anyone tell me if this is still possible in BI 7.0 as the workbook is now over 3MB, instead of a few KB. Thanks for your help Lisa