Column in base table corresponds to column in view

Hi,
I have a view based on one table. I want to know the colum name of the view is corresponds to which column names in the base table. Showing the creation statement does not help because it has many colums and I cann't track this colum to which name.
Please advise how to show this info....

Just because the create statement is too hard for you doesn't mean that isn't, in fact, the way to find out. Try harder. Format the create statement - you'd be surprised how much it helps to put in indentation and carriage returns.

Similar Messages

  • How to select columns in a table by their column id and not the column name

    Hello,
    How do you select columns from a table based on their column_id.
    I have create a view
    but other than Select * , i cant now select one just one column from it
    the view as follow:
    create view count_student as
    select a.acode "acode",aname "Activity Name",count(ae.acode) "Number of student joined"
    from aenrol ae, activity a
    where a.acode= ae.acode
    group by a.acode,aname;

    The issue is that you have decided to use quoted column names. A pretty horrible idea (mostly for the reasons that you are now finding).
    Re-create the view and get rid of the silly double quotes.

  • Add columns to a table with lob column

    Hi,
    Just a quick question: is there a performance penalty after adding columns to a table with a lob fied? the lob field is now the last column in the table and via via I was told that adding columns will impact badly the IO performance on the table if the lob field isn't anymore the last column. The table is on a Oracle 10.2.0.3 version.
    thanks. regards
    Ivan

    Havent heard of performance degradation specifically due to a LOB column not being the last column in a table (although there are several issues with just having a LOB column in a table).
    You may want to build a test database to test it out. It should be easy to run tests comparing one with the additional column and one the original to prove or refute it. The results would be interesting to learn - please post them up if you intend to test it out.

  • Why mandatory columns of  Base tables and interface are differant?

    Hi guys , i have load supplier into AP(ap_suppliers) through Interface table(ap_suppliers_int) but my confusion is that ap_suppliers have 8 mandatory columns but it's interface ap_suppliers_int have only 2 mandatory column.why?and also with these 2 columns records are also loading.
    Regards,
    Shakeel khan

    Hi Shakeel,
    If you are using 12.0, data in AP_SUPPLIERS is not imported from AP_SUPPLIERS_INT table, data in AP_SUPPLIERS_INT corresponds to data in PO_VENDORS(Vendors data Maintained in 11i).
    If its 11i, If Segment1 is NULL, its generated from below sql,
    SELECT user_defined_vendor_num_code
    INTO l_ven_num_code
    FROM financials_system_parameters;
    And if summary flag is NULL its inserted 'N' and if Enabled Flag is NUll its inserted as 'Y'.
    The rest are WHO columns.
    Refer to AP_PO_VENDORS_APIS_PKG for additional info on this.
    Hope this helps.
    Thanks,
    Kiran

  • How to join two columns between two tables with different column names

    Hi
    How i can join 2 columns with different names between the 2 tables.
    Can any one please give solution for this.
    Thanks
    Manu

    Hi,
    basic understanding of joins:
    If you want to join 2 tables there should be matching column w.r.t. data and it's data type. You need not to have same column names in both the tables...
    so, find those columns which has got same values..

  • Select the column details for table in one column as varchar2(32000)

    Oracle Version: ORACLE 10G R 2
    Problem : Select the column details for some tables and want to store the same in VARCHAR2(32000) separated by ||
    Example:
    TABLE_NAME COLUMN_NAME DATA_TYPE
    EMP EMPNO NUMBER
    EMP ENAME VARCHAR2
    EMP JOB VARCHAR2
    EMP MGR NUMBER
    EMP HIREDATE DATE
    EMP SAL NUMBER
    EMP COMM NUMBER
    EMP DEPTNO NUMBER
    EMP RN NUMBER
    Want to store
    COLUMNS (empno||ename||job||mgr||hiredate||sal||comm||deptno||rn);

    SQL> var cur refcursor
    SQL> declare
    ctx number;
    begin
    ctx := dbms_xmlgen.newcontext('select * from emp');
    dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.empty_tag);
    open :cur for select * from xmltable('for $i in ROW return string-join($i/*, "||")' passing dbms_xmlgen.getxmltype(ctx).extract('ROWSET/ROW'));
    end;
    PL/SQL procedure successfully completed.
    SQL> print cur
    COLUMN_VALUE                                                                                       
    7369||SMITH||CLERK||7902||17.12.1980 00:00:00||800||||20                                           
    7499||ALLEN||SALESMAN||7698||20.02.1981 00:00:00||1600||300||30                                    
    7521||WARD||SALESMAN||7698||22.02.1981 00:00:00||1250||500||30                                     
    7566||JONES||MANAGER||7839||02.04.1981 00:00:00||2975||||20                                        
    7654||MARTIN||SALESMAN||7698||28.09.1981 00:00:00||1250||1400||30                                  
    7698||BLAKE||MANAGER||7839||01.05.1981 00:00:00||2850||||30                                        
    7782||CLARK||MANAGER||7839||09.06.1981 00:00:00||2450||||10                                        
    7788||SCOTT||ANALYST||7566||19.04.1987 00:00:00||3000||||20                                        
    7839||KING||PRESIDENT||||17.11.1981 00:00:00||5000||||10                                           
    7844||TURNER||SALESMAN||7698||08.09.1981 00:00:00||1500||0||30                                     
    7876||ADAMS||CLERK||7788||23.05.1987 00:00:00||1100||||20                                          
    7900||JAMES||CLERK||7698||03.12.1981 00:00:00||950||||30                                           
    7902||FORD||ANALYST||7566||03.12.1981 00:00:00||3000||||20                                         
    7934||MILLER||CLERK||7782||23.01.1982 00:00:00||1300||||10                                         
    14 rows selected.

  • Adding up entries of 2 different columns of a table in a single view column

    Hi All,
             I have a requirement wherein I have to add up the entries of 2 different columns of 2 different database tables and show it in one column of a View.
    Eg. Table A has column A and Table B has column B. I create a view C with column C.
    Now Col C = Col A + Col B
    Can anyone please let me know how this view can be created?
    Thanks,
    Momdipa

    Hi Momdipa,
    ABAP Table View does not support dynamic arithmetic operations. So, you can't achieve this business logic in the view. There are no operators in the view which can help you to do this.
    If you need this functionality, you need to create a ABAP Report to calculate the sum on the execution of the Report. And then you can update the View based on your own business logic.
    Hope this helps.
    Thanks,
    Samantak.

  • How to keep view column in a table

    Hi,
    I have two table and one view(I have same data in any other schema so I don't want to keep same data in both schema) I want to make primary key in first table based on one column from 2nd table and one column from view, but it's not looking possible if it's possible so how, if it is not there is any other solution.
    Thanks and Regards, Khawar.

    Hello all,
    Thanks for reply following are view and table desc.
    SQL> desc emp_dept_vw
    Name Null? Type
    EMP_ID NOT NULL VARCHAR2(10)
    F_NAME NOT NULL VARCHAR2(50)
    M_NAME VARCHAR2(15)
    L_NAME VARCHAR2(15)
    DESIGNATION VARCHAR2(40)
    JOIN_DATE DATE
    REGION_ID VARCHAR2(15)
    DEPT_ID VARCHAR2(30)
    FAMILY_NAME VARCHAR2(20)
    SEX CHAR(1)
    LOCATION VARCHAR2(20)
    DEPT_NAME VARCHAR2(30)
    SECTION VARCHAR2(40)
    SQL> desc pc_user
    Name Null? Type
    PC_SERIAL NOT NULL VARCHAR2(20)
    PRINTER_SERIAL VARCHAR2(20)
    SQL> desc pc
    Name Null? Type
    PC_SERIAL NOT NULL VARCHAR2(20)
    BRAND NOT NULL VARCHAR2(50)
    HDD_MODEL_NO CHAR(18)
    MEM_CODE VARCHAR2(20)
    NIC_CODE VARCHAR2(20)
    PROCESSOR_ID VARCHAR2(20)
    MONITOR_ID VARCHAR2(20)
    MOTHER_BOARD VARCHAR2(30)
    SUPP_ID VARCHAR2(20)
    FDD VARCHAR2(20)
    PRICE NOT NULL NUMBER
    WARRANTY NOT NULL VARCHAR2(20)
    DELIVERY_DATE NOT NULL DATE
    REMARKS NOT NULL VARCHAR2(200)
    I want to use EMP_ID from EMP_DEPT_VW view as a part of composite key in PC_USER table.
    Many Thanks .
    Khawar

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

    Hello 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

  • How to drop a partitioned column in a table

    Hi All,
    I am trying to drop a column which is partitioned into 4 values.
    When I use the command
    ALTER TABLE TNAME DROP COLUMN CNAME;
    I am getting an error message stating that cannot drop a parttioned column.
    ALTER TABLE fn_dev_excpt DROP COLUMN THEATER_ID
    ERROR at line 1:
    ORA-12984: cannot drop partitioning column
    Appreciate your help on this,
    Thanks,
    Madhu K.

    Hi,
    Can you please drop the partition itself using the below command.Dropping of column which is partitioned is not alllowed.
    SELECT table_name, partition_name
    FROM user_tab_partitions;
    ALTER TABLE range_list DROP PARTITION s2k ;
    where table_name=range_list ,
    partition_name=s2k
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com/
    Edited by: Rafi (Oracle DBA) on Mar 25, 2010 12:58 AM

  • How to rename column name of table?

    Hello...
    How to rename column name of table?
    The column have data.
    Thanks.
    Martonio.

    The following should work in 9i release 2 and above.
    SQL> create table mytable(col1 varchar2(2),
      2  col2 date);
    Table created.
    SQL> insert into mytable values('t1',sysdate);
    1 row created.
    SQL> select * from mytable;
    CO COL2
    t1 30-NOV-04
    1 row selected.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    COL2                                               DATE
    SQL> alter table mytable rename column col2 to mydate;
    Table altered.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    MYDATE                                             DATE
    SQL> select * from mytable;
    CO MYDATE
    t1 30-NOV-04
    1 row selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Productionhttp://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/wnsql.htm#972698

  • Sparse table with many columns

    Hi,
    I have a table that contains around 800 columns. The table is a sparse table such that many rows
    contain up to 50 populated columns (The others contain NULL).
    My questions are:
    1. Table that contains many columns can cause a performance problem? Is there an alternative option to
    hold table with many columns efficiently?
    2. Does a row that contains NULL values consume storage space?
    Thanks
    dyahav

    [NULLs Indicate Absence of Value|http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10743/schema.htm#sthref725]
    A null is the absence of a value in a column of a row. Nulls indicate missing, unknown, or inapplicable data. A null should not be used to imply any other value, such as zero. A column allows nulls unless a NOT NULL or PRIMARY KEY integrity constraint has been defined for the column, in which case no row can be inserted without a value for that column.
    Nulls are stored in the database if they fall between columns with data values. In these cases they require 1 byte to store the length of the column (zero).
    Trailing nulls in a row require no storage because a new row header signals that the remaining columns in the previous row are null. For example, if the last three columns of a table are null, no information is stored for those columns. In tables with many columns, the columns more likely to contain nulls should be defined last to conserve disk space.
    Most comparisons between nulls and other values are by definition neither true nor false, but unknown. To identify nulls in SQL, use the IS NULL predicate. Use the SQL function NVL to convert nulls to non-null values.
    Nulls are not indexed, except when the cluster key column value is null or the index is a bitmap index.>
    My guess for efficiently storing this information would be to take any columns that are almost always null and place them at the end of the table definition so they don't consume any space.
    HTH!

  • Query for comparing two columns in two tables

    Hai, all,
    I have following two tables and columns, I need to get the rows (all columns) from scott.cp_ip which are not ( the same value present in t1 and also in t2).
    Table scott.cp_ip column cp_ip.vrno = Table scott.cb1 column cb1.cb_vnno
    I used the following query and did not get the correct result:
    select * from scott.cp_ip where cp_ip.vrno in (select cb1.cb_vnno from scott.cb1);
    Can you please tell how it can be solved?
    Thanks in advance.
    Rcs
    SQL> desc scott.cb1;
    Name Null? Type
    ID NUMBER
    SUPCODE NUMBER
    SUPLNAME VARCHAR2(100)
    NAME VARCHAR2(100)
    ITEMCODE VARCHAR2(10)
    RECDOC NUMBER
    RECDATE VARCHAR2(10)
    TOTVALUE NUMBER
    QTY NUMBER
    CB_IPNO NUMBER
    CB_VNNO NUMBER
    CB_VDT VARCHAR2(10)
    CB_AMT NUMBER
    SQL> desc scott.cp_ip;
    Name Null? Type
    ID NUMBER
    VRNO NUMBER
    CODE VARCHAR2(50)
    HEAD VARCHAR2(255)
    PARTI VARCHAR2(255)
    CR NUMBER
    SQL> select * from scott.cp_ip
    2 intersect
    3 select * from scott.cb1;
    select * from scott.cp_ip
    ERROR at line 1:
    ORA-01789: query block has incorrect number of result columns
    SQL> (select * from scott.cp_ip
    2 minus
    3 select * from scott.cb1)
    4 union all
    5 (select * from scott.cb1
    6 minus
    7 select * from scott.cp_ip);
    (select * from scott.cb1
    ERROR at line 5:
    ORA-01789: query block has incorrect number of result columns
    SQL> select * from scott.cp_ip where cp_ip.vrno in (select cb1.cb_vnno from scott.cb1);
    result=instead of 1408 rows, 1481 rows (excess 73 rows) getting!
    ----------

    Instead of SELECT * write only the column that you want to compare. I guess that would be cb1.cb_vnno and cp_ip.vrno.

  • Adding column to a table

    Hi everybody,
    I have to make a column (in Siebel repository) or better to say I have to add a column to the table. The column doesn't exist in a database. There is a PL/SQL package which has the stored procedure I need to call to make column. How may I make the column from the stored procedure?
    Thanks in advance.
    I apologize if the meaning from the above sentences is confused.
    Edited by: Stanisa on 24.02.2010. 14.45

    1.) The Siebel guys are over there -> http://forums.oracle.com/forums/category.jspa?categoryID=151
    2.) Siebel schema changes are applied through Siebel Tools to the schema. Ref. "Apply" and "Activate" buttons.

  • How to display records from base table as well as some other table?

    Hello expert,
    I have a requirement to develope a form described below:
    One control block and database block.
    DB block  is based on table T1 (USER, Table_name, Column_name, ACCESS);
    In control block, there are three fields,
    User, Table user will enter , and DB block will query based on control block fields(user, table_name).
    In table it is not necessary that all the columns of any table will be given.
    suppose there is a Table X consist of 10 column.
    Initially user give access for all the 10 columns through this form.
    if we query for user , table, all the record will come from table T1.
    now consider the case, when access given to table X number of columns were 10. after that 2 new columns added later.
    now there is no info of added column in table T1. i want if user query DB block, these newly added column must display in DB Block.
    Please help me out.
    Thanks
    Dhirender

    >i want if user query DB block, these newly added column must display in DB Block.
    You need to modify your form and add the two columns as base table items. Forms does not add two base table items by itself.

Maybe you are looking for