Why there is a difference between table and view?

CREATE TABLE SK_ABC (ABC VARCHAR2(10),BBC NUMBER, CCD VARCHAR2(100), DDC DATE);
CREATE OR REPLACE VIEW SK_ABC_V
AS SELECT ABC,BBC,SubStr(CCD,1,40) CCD FROM SK_ABC;after this am seeing CCD length in view as 160 in database. am expecting length as 40 or atleast it should give me 100 as table ccd data length is 100, but it is showing me as 160 is bit surprised...
can any one please explain me?
SELECT table_Name,column_name,data_length,column_id,char_used FROM ALL_TAB_COLS WHERE TABLE_NAME LIKE 'SK%' ORDER BY TABLE_nAME,COLUMN_ID;
TABLE_NAME COLUMN_NAME DATA_LENGTH COLUMN_ID CHAR_USED
SK_ABC         ABC                   10                   1                  B
SK_ABC         BBC                   22                   2  
SK_ABC         CCD                  100                  3                  B
SK_ABC         DDC                     7                  4  
SK_ABC_V     ABC                    10                  1                   B
SK_ABC_V     BBC                     22                  2  
SK_ABC_V     CCD                    160                 3                   B

Hi,
This,
SubStr(CCD,1,40)You are taking 40 characters from CCD. You are probably using a multi byte character set, so the column will be 160 bytes. Your output shows char_used = B, that means length of column is taken in bytes.
Edit: Key word is NLS_LENGTH_SEMANTICS
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/tdddg_globalization.htm#TDDDG62910
I think the right thing would be to use char semantics when using multi byte character sets
Regards
Peter
Edited by: Peter on May 10, 2011 3:26 AM

Similar Messages

  • Why there is a difference between Router and PIX ACL

    Hi,
    I have a very basic question about the differences beween ACL behaviour in PIX and Router.
    In Router if we put an extended acl entry and want to remove an mid entry then either we have to clear the entire ACL or remove the entries all the below.
    Whereas in case of PIX we can remove any of the entry.
    Why this difference is there.
    Would appreciate your quick answers.
    Thanks
    Irshad

    The PIX OS is designed such a way. Anyway, even in routers you can remove a mid entry by configuring named access-lists. You need not clear the entire ACL in this case.
    ip access-list extended ROUTER-ACL
    permit ip host x.x.x.x host y.y.y.y any

  • Difference between table and tenplate?

    Hi
    What is a difference between table and a template?
    Thanks

    are you refering to Smartforms?
    Well in SF, table is something that contains data. Tables could be dynamic.
    Template is a fixed format. Example if you have a invoice and the format is fixed with several vertical and horizontal lines. And you have terms and condition to be printed at the bottom. And the total amount.
    Now this template will be printed in the form even if there are line items and even if htere is no line items.

  • What is exact difference between table and template in script

    hello all
    what is exact difference between table and template in script

    Hi there.
    Tables alow you to achieve more complex flows with internal tables. You can use different types os lines, like footer, header, line items, and differente types of line items. Also, and most important, you have different processing blocks, again header block (processed before processing of first row), body block (rows) and footer block (after last row or page break).
    If you don't need any of this, use a template inside a loop to achieve something like a table. I personaly use templates only to draw lines, for example, before and after a loop, or to align some header in my documents.
    A table, is a loop and template mixed to become a very good tool.
    Regards.
    Valter Oliveira.
    Edited by: Valter Oliveira on Jun 5, 2008 5:10 PM

  • Is there any performance difference between unique and no unique index

    Hi,
    We are working with both databases Oracle and MS-SQL and we have an open channel to MS-SQL server core team.
    We got the word from them that there is a difference between unique and no unique index from the optimizer perspective, i.e. the optimizer knowing that the index is unique may choose a more suitable plan for running a specific query, we're still trying to find a specific example.
    Anyway, since we do not have an open channel to Oracle core, I thought maybe one of you guys knows something about Oracle optimizer behavior on this issue.
    I am interested verified answers from certified sources and not suggestions or thoughts.
    Thanks in advanced,
    Tal ([email protected]).

    Maybe, you will like to check this link for a similar question answered by Tom Kyte
    http://asktom.oracle.com/pls/ask/f?p=4950:8:385900000490041683::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:7641143144618,

  • Hi guru's what is the difference between table and temlate in smartforms

    hi guru's what is the difference between table and temlate in smartforms

    Hi Vasu,
    Template is used for proper allignment of data which table is used for displaying multiple data.
    We can say Template is for static data and Table is for dynamic data.
    Suppose we have a requirement in which we have to allign the customer address in such a way as shown below:-
    Name- Vasu Company- WIPRO Location- Chennai
    Desig- S/W Native - Mumbai
    Then for proper allighnment we can create a template and split that into 3 columns and 2 rows and create text elements for each cell display a proper allighned data at the output.
    When we include a template inside a loop it gives the same property as a table.
    When we have mutiple data which is to be extended to the next page like when we display all employee details in a company we use table.
    Table has 3 sections , HEADER, ITEM ,FOOTER
    The header secntion will be executed once and it will loop at the item level. at the end footer will be executed.
    Hope this gives u some idea..
    <b>Please reward if useful</b>
    Regards,
    sunil kairam.

  • Would there be a problem with the warranty in the UK if bought in USA? Plus is there a big difference between US and UK keyboards? Thanks

    Hi, I'm from the UK and in the USA for a week. I'm thinking of purchasing an Air. Would there be a problem with the warranty in the UK if bought in the US? Plus is there a big difference between US and UK keyboards?
    Cheers
    G

    There are subtle differences on a British layout, mainly having to do with the top line (shift numbers), to permit the use of European monetary symbols. There are a few other keys different (note the enter key).
    Here are the basic layouts. Obviously the MBA won't have an eject key, as the power key resides in that location.
    British English Keyboard
    USA English Keyboard

  • Difference between table and advanced table

    hi
    what is the main difference between table and advanced table ?
    What are the usages of both the Beans?

    Hi
    OAAdvancedTableBean extends OATableBean to provide declarative support for existing table features that previously required programmatic control.
    OAAdvancedTableBean also provides declarative support for features not available with OATableBean, such as column span in a table column header. Oracle recommend new tables be implemented as "advanced tables"...
    Please Read more info from Jdev Guide..
    Thanks
    AJ

  • Difference between Table and Table Type

    Hi
       Can you please let me know the
    Difference between Table and Table Type and
    Difference between Structure and Table Type?
    Regards,
    Sree

    hi,
    table is a data dictionary object in sap. table is of different types
    1. transparent tables
    2. pool tables
    3. cluster tables
    table type gives option for u to select different types of internal tables. they r
    1. standard table
    2. sorted table
    3. hash table
    Structures :
    -Defined like a table and can then be addressed from ABAP programs.
    -Structures contain data only during the runtime of a program.
    -Just like user-defined data type.
    - they are not present in database server and only on application server.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • Difference between Table and Container

    Hi,
        Whats the difference between table and container.
    How to create container in smartform.
    Cheers
    Senthil

    Hi,
         I have a requirement to remove a column from an existing container. I removed a column, but still the column showing up.. so I decided to recreate the container again. But I can create only table. How to make this as container.
    Cheers
    Senthil

  • In smart forms-- difference between table and template

    can you please tell me what is the difference between table and template in smart forms,
    and als give me some object developed in smart forms.

    it is not recommended because, when ever we activate the smartform it generates one function module.
    if we transport that driver program and smartform to testing or production, in that server the generated function module name will be differ.
    hope u got it.
    for this we need to use these function modules.
    SSF_FUNCTION_MODULE_NAME
    FM_NAME
    regards.
    santhosh reddy
    reward if useful
    Edited by: Santhosh Reddy on Feb 16, 2008 7:52 PM

  • The Relation between tables and views in oracle financial

    Dears
    I am work in oracle e business r12
    and i need to build report as xml
    when run my select its need big time to view data i have a huge of data so i need to clear the relation of this tables if there is miss and if there another technique in select statement
    this is my select statement
    select
    j_hdr.je_header_id je_header_id,
    hdr.VENDOR_NAME supplier,
    SEGMENT1||'-'||SEGMENT2||'-'||SEGMENT3||'-'||SEGMENT4||'-'||SEGMENT5||'-'||SEGMENT6||'-'||SEGMENT7||'-'||SEGMENT8||'-'||SEGMENT9 Account_number,
    hdr.gl_date gl_date,
    j_hdr.CURRENCY_CODE CURRENCY_CODE,
    inv_lin.DESCRIPTION DESCRIPTION,
    j_lin.ENTERED_DR ENTERED_DR,
    j_lin.ENTERED_CR ENTERED_CR,
    j_lin.ACCOUNTED_DR ACCOUNTED_DR,
    j_lin.ACCOUNTED_CR ACCOUNTED_CR,
    j_hdr.JE_SOURCE JE_SOURCE,
    j_hdr.DEFAULT_EFFECTIVE_DATE Transaction_DATE,
    hdr.INVOICE_NUM INVOICE_NUM,
    QUICK_PO_NUMBER PO_NUMBER,
    null ASSET_CATEGORY_ID,
    hdr.VENDOR_ID VENDOR_ID
    from gl_je_headers j_hdr,gl_je_lines_v j_lin,ap_invoice_distributions dist,ap_invoices_v hdr,ap_invoice_lines_v inv_lin
    where code_combination_id = DIST_CODE_COMBINATION_ID
    and hdr.invoice_id = inv_lin.INVOICE_ID
    and dist.invoice_id = inv_lin.INVOICE_ID
    and j_hdr.JE_HEADER_ID = j_lin.JE_HEADER_ID
    and j_hdr.status = 'P'
    and nvl(:P_SOURCE,'Payables') = 'Payables'
    and je_source = 'Payables'
    and j_lin.CODE_COMBINATION_ID between ( select CODE_COMBINATION_ID
    from gl_code_combinations_kfv
    where CONCATENATED_SEGMENTS = :P_FROM_COMBINATION_CODE)
    and ( select CODE_COMBINATION_ID
    from gl_code_combinations_kfv
    where CONCATENATED_SEGMENTS = :P_TO_COMBINATION_CODE)
    AND TRUNC(dEFAULT_EFFECTIVE_DATE) BETWEEN NVL(:P_FROM_DATE, DEFAULT_EFFECTIVE_DATE) AND NVL(:P_to_DATE, DEFAULT_EFFECTIVE_DATE)
    Thanks in advance

    Welcome to the world of complicated Oracle Application queries. Didn't fully understand your question, so a few guesses -
    I think that you are asking how to make your query faster? I would reference the FAQ section on how to post a question regarding performance.
    Your title indicates you want to understand the relationship between tables and views. In general, Oracle Applications uses views for 2 reasons - to join data from multiple tables for display, and to differentiate data from different organizations. (I am still on 11i and have heard organizations are handled differently in 12 so I can't speak to that for sure).
    To understand the relationship between tables in a view, you can access the view's source code, either through a development tool such as PL/SQL Developer or TOAD (I'm guessing Oracle's tool does this also, but have never used it), or by querying the source from the dba_source table.
    select * from dba_source where name = (name of view) and type = 'VIEW' order by line;without the ( ) just the view name, in all capital letters i.e. , 'GL_JE_LINES_V'
    Good luck!

  • What is the difference between 'workbookk' and ' view'?

    Hi all,
    What is the difference between 'workbook' and 'view'. I check some document but I don't see there is big difference.
    Thanks.
    J.

    hi John,
    We use workbooks for excel formating,like font changes, lay out changes etc...
    Workbooks into which queries are inserted are no different in appearance than other Excel workbooks.
    They can be saved as files, copied, sent and (using Excel functions) edited however you like and even supplemented with other data.
    Views are primarily used for BW Web Reports, it is similar to the concept of workbooks is for BEx.A local view can be accessed only within a workbook in which it was saved, where as a global view can be accessed globally in the system, it is not attached to a workbook. Only Global view can be used in BW Web Templates.
    u can seee the help doc for more details:
    http://help.sap.com/saphelp_nw04s/helpdata/en/0d/af12403dbedd5fe10000000a155106/content.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/3a/89883989676778e10000000a11402f/content.htm
    bye
    sham'm

  • Can I use a Photoshop CS6 guide book I got in college to learn CC, or is there too many differences between CS6 and CC?

    I have a guide book I got in college to help me learn Photoshop CS6, but I never finished the class. My question is: Can I use this book to learn Photoshop CC or is there too much diversity between CS6 and CC?

    caj50932876 wrote:
    Thanks! I appreciate you answering so quickly!
    That's OK.  We race to be the first responder, because we are sad geeks, and first responder sounds like something from a TV reality program.  Benjamin actually has flashing lights and a siren on his computer.

  • Difference between Table and Structure

    Dear SD Gurus,
    Can anybody tell me what is the difference between a Table and Structure
    Pls Reply.

    Tables are Database, which stay in system for long duration , as good as permanent, untill & unless the data is archived, which is not very frequent. Data at transaction level are captured from multiple tables, so as to meet the requirement. We can view the data in the table through T.code SE11 & SE16. there are certain tables in which data can be maintained as well as displayed. To maintain data, we use T.Code: SM30 or SM31.
    Structures are temporary table & hold the data for that particular instance or transaction.
    Regards,
    Rajesh Banka
    Reward suitable points.
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).

Maybe you are looking for

  • A call for help!  Can I make my master my slave?

    Hi, friends.  I hope these few words find you in good spirits. I am trying to recover data from about 10 years of my life, and I am hoping one of you will point me in the right direction. I have an old Power Mac G4 tower (Sawtooth, AGP from about 200

  • Images in galleries not showing in full screen mode

    I have a number of galleries in my ibook.  Some of them work fine and the pictures open up in full screen when tapped/pinched.  Other gallers dont allow me to view the pictures in full screen.  I have created them all the same way as far as I know. 

  • SQL Query Reference?

    Hi..:) Need some advise on any Oracle Sql query reference.. I use to do mysql development with reference to mysqlhelp.chm Is there any equivalent standalone help reference available for oracle. Thank you

  • Handling multiple buttons

    Hello all, I am working on project to control fluke multimeter. I got the communication and am able to read the values from it  and representing the values in graph. Here the problem comes, when i am switching the multimeter to voltmeter,ammeter and

  • Lightroom 3 Import error - I would like to upgrade to LR5

    Hi there. After importing into LR3, I get an error message that says: Some import operations were not performed. The following files could not be copied to the backup location. Then there is a list of images (usually all of the photos imported).  Thi