Difference between CHAR & BYTE with respect to Storage

Hi,
I HAVE CREATED THREE TABLES WITH DIFFERENT STORAGE FORMATS.
SQL> CREATE TABLE A
2 (ENAME CHAR);
Table created.
SQL> CREATE TABLE AA
2 (ENAME CHAR(1 CHAR));
Table created.
SQL> CREATE TABLE AAA
2 (ENAME CHAR(1 BYTE));
WHEN I AM TRYING TO INSERT THE VALUES
CASE1) INSERTING A SINGLE CHARACTER ONLY
SQL> INSERT INTO A
2 VALUES
3 ('A');
1 row created.
SQL> INSERT INTO AA
2 VALUES
3 ('A');
1 row created.
SQL> INSERT INTO AAA
2 VALUES
3 ('A');
1 row created.
INSERTING MORE THAN ONE CHARACTER IN AAA TABLE
SQL> INSERT INTO AA
2 VALUES
3 ('AA');
('AA')
ERROR at line 3:
ORA-12899: value too large for column "RAVI1"."AA"."ENAME" (actual: 2, maximum:
1)
SQL> INSERT INTO AAA
2 VALUES
3 ('AAA');
('AAA')
ERROR at line 3:
ORA-12899: value too large for column "RAVI1"."AAA"."ENAME" (actual: 3,
maximum: 1)
please can any one tell me the differences.
Thanks & Regards
SAI***BABA

This one might help: Re: What is the difference between VARCHAR2(5 BYTE) & VARCHAR2(5 CHAR)?
Jim P.

Similar Messages

  • Difference between char and varchar, also the difference between varchar2

    Hi,
    Can anyone explain me the difference between char and varchar, and also the difference between varchar and varchar2...

    Varchar2 is variable width character data type, so if you define column with width 20 and insert only one character to tis column only, one character will be stored in database. Char is not variable width so when you define column with width 20 and insert one character to this column it will be right padded with 19 spaces to desired length, so you will store 20 characters in the dattabase (follow the example 1). Varchar data type from Oracle 9i is automaticlly promoted to varchar2 (follow example 2)
    Example 1:
    SQL> create table tchar(text1 char(10), text2 varchar2(10))
    2 /
    Table created.
    SQL> insert into tchar values('krystian','krystian')
    2 /
    1 row created.
    SQL> select text1, length(text1), text2, length(text2)
    2 from tchar
    3 /
    TEXT1 LENGTH(TEXT1) TEXT2 LENGTH(TEXT2)
    krystian 10 krystian 8
    Example 2:
    create table tvarchar(text varchar(10))
    SQL> select table_name,column_name,data_type
    2 from user_tab_columns
    3 where table_name = 'TVARCHAR'
    4 /
    TABLE_NAME COLUMN_NAME DATA_TYPE
    TVARCHAR TEXT VARCHAR2
    Best Regards
    Krystian Zieja / mob

  • Difference between CHAR and VARCHAR2 datatype

    Difference between CHAR and VARCHAR2 datatype
    CHAR datatype
    If you have an employee name column with size 10; ename CHAR(10) and If a column value 'JOHN' is inserted, 6 empty spaces will be inserted to the right of the value. If this was a VARCHAR column; ename VARCHAR2(10). How would it handle the column value 'JOHN' ?

    The CHAR datatype stores fixed-length character strings, and Oracle compares CHAR values using blank-padded comparison semantics.
    Where as the VARCHAR2 datatype stores variable-length character strings, and Oracle compares VARCHAR2 values using nonpadded comparison semantics.
    This is important when comparing or joining on the columns having these datatypes;
    SQL*Plus: Release 10.2.0.1.0 - Production on Pzt Au 6 09:16:45 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn hr/hr
    Connected.
    SQL> set serveroutput on
    SQL> DECLARE
    2 last_name1 VARCHAR2(10) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is NOT equal to -TONGUC -
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2 last_name1 CHAR(6) := 'TONGUC';
    3 last_name2 CHAR(10) := 'TONGUC';
    4 BEGIN
    5 IF last_name1 = last_name2 THEN
    6 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is equal to -' || last_name2
    || '-');
    7 ELSE
    8 DBMS_OUTPUT.PUT_LINE ( '-' || last_name1 || '- is NOT equal to -' || last_n
    ame2 || '-');
    9 END IF;
    10 END;
    11 /
    -TONGUC- is equal to -TONGUC -
    PL/SQL procedure successfully completed.
    Also you may want to read related asktom thread - "Char Vs Varchar" http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1542606219593
    and http://tahitiviews.blogspot.com/2007/05/less-is-more-more-or-less.html
    Best regards.

  • Considering buying refurbished.  Is there a big difference between a refurb with an original date this year vs. one from over a year ago??

    Considering buying refurbished.  Is there a big difference between a refurb with an original date this year vs. one from over a year ago??

    MacBook Air, 13", Mid 2013:
    On June 10, 2013, Apple released an updated MacBook Air in the same form factor as the 2012 model during the company's Worldwide Developer Conference (WWDC). The 11-inch and 13-inch models have a minimum standard 4GB RAM, with a maximum configuration of 8GB. Both models are powered by the Haswell ULT 1.3GHz dual-core Intel Core i5 processors with Turbo Boost up to 2.6GHz and 1.7GHz Dual-Core i7 with Turbo Boost up to 3.3GHz option available. Each model has a 128GB configuration and a 256GB configuration available, with the 256GB model being upgradeable to 512GB SSD.
    1.3 GHz (Core i5) or 1.7 GHz (Core i7)
    MacBook Air, 13", Early 2014:
    On April 29, 2014 Apple released an updated MacBook Air featuring faster processors and better battery life. The standard configurations also saw a price drop in most regions.
    1.4 GHz (Core i5) or 1.7 GHz (Core i7)
    MacBook Pro, 13", Retina, Late 2013:
    At the Apple Special Event on October 22, 2013, Apple announced that it had updated the 13-inch and 15-inch MacBook Pro with Retina display. Both versions feature the new Intel Haswell chipset.
    2.4 or 2.6 GHz (Core i5) or 2.8 GHz (Core i7)
    MacBook Pro, 13", Retina, Mid 2014:
    On July 29, 2014 Apple announced updated prices and processors for their Haswell Macbook Pro with Retina Display.
    2.6 or 2.8 GHz (Core i5) or 3.0 GHz (Core i7)
    I would go for the Pro Retina since the display is much better.

  • What is the difference between sales order with picking and without picking

    hi friends,
    i would like to know what is the difference between sales order with picking and without picking.
    thanks
    skrishnan

    Hello,
    Picking refers to preparing the right quantity and quality of goods for shipping on schedule as required by the customer.
    Once picking is configured, SAP Sd automatically generates picking lists and picking labels which can be tagged to the relevant goods. SAP can be configured to ensure that picked quantity is confirmed before goods are issued. This can be done using transaction code VSTK. In T-code VSTK, picking confirmations can be set, which ensure that goods picked for delivery are in accordance with picking slips.
    Picking thus helps in monitoring each item using the picking status. Picking is normally done in SAP SD by a shipping clerk.
    Prase

  • Difference between PR Relase with classification and Without classification

    Hi,
    Can any one tell me what is the difference between PR release  with and without classification
    Thanks
    Akkshaya

    For PR with release strategy without classification only item level release is possible. But for PR with release strategwithat classification overall release is possible.
    Below links will give you the complete details
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Both cannot be used together. Only one at a time can be used
    Regards,
    Ashwin

  • The difference between the upgrades with and without MO?

    I did many upgrades without maintenance optimizer.
    But I did not use maintenance optimizer so far.
    Could you summarize the differences between the upgrades with and without MO?
    Thanks!

    The upgrade is the same, procedure is the same, glitches are the same, tools are the same. The only difference is, that you MUST use maintenance optimizer to confirm the supportpackages in your download basked before you're able to download them.
    Nothing else is changing
    Markus

  • Difference between DEclaring Itab with DATA & TYpe Statement?

    HI Friends,
      What is the Difference between Declaring Itab with DATA & TYpe Statement?

    Hi,
    The Statements TYPES and DATA
    Each ABAP program define its own data types using the statement.
    TYPES dtype TYPE type ...
    and declare its own variables or instance attributes of classes using the statement
    DATA var {TYPE type} ...
    Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
    When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    TYPES: BEGIN OF struct,
             number_1 TYPE i,
             number_2 TYPE p DECIMALS 2,
           END OF struct.
    DATA:  wa_struct TYPE struct,
           number    LIKE wa_struct-number_2,
           date      LIKE sy-datum,
           time      TYPE t,
           text      TYPE string,
           company   TYPE s_carr_id.
    This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • What is the difference between Ipad Air with code MD787B/A and MD787FD/A??

    Hi - what is the difference between Ipad Air with the code MD787B/A and MD787FD/A ??

    You can see the model number in Settings>General>About>Model. The model number has a two-letter code, a number and some more letters. The last part stands for the country/region. The first letter can be "F" (refurbished), "M" (normal retail), or "P" (personalized / engraved). For example MC605B is the model MC605 and B is for the region.
    What country does my device belong to?
    http://www.jbfaq.com/article.asp?id=63
     Cheers, Tom

  • Differences between client copy with sap_all and database copy

    What's the difference between client copy with sap_all and doing a database copy.
    I know if I do a database copy from Production to our Quality system.
    I need to install the license key
    restore the production library to the quality library
    Initialize TMS and so on.
    I know if I want to copy to our Development system. I would need to run either a remote client copy or and export/import since I cannot do a database copy because I would loose all my other clients in Development.
    My question is, if the quality systems and the production systems are on the same support packs, same kernel.
    What does a database copy give you (besides being faser) that a remote client copy or export/import of a client copy does.
    Any differences
    Thanks
    Joe

    Hello Joe,
    If there is inconsistent Z tables between QAS and PRD, remote client copy could fail, especially when the table on PRD has longer length or more fields than the one on QAS.
    Also the source client should has no-activity during the client copy, otherwise the application data could be inconsistent. For example, some material documents are copied, but not the corresponding financial documents. (For PRD client, it could be hours between the times those tables are copied.) For database restore, it is rarely an issue.
    Best regards,
    Victor

  • Differences between Internal table with Occurs 0 and Field-Groups?

    Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
    Could anybody please give some information regarding above question?
    Thanks,
    Surya.

    hi,
    occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
    i.e data: itab like mara occurs 0 with header line.
    can take data only from mara table
    we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
    for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
    filed symbols works more faster than internal tables.
    if helpful reward some points.
    with regards,
    Suresh.A

  • KEYNOTE DIFFERENCES BETWEEN A CATALYST LAN SWITCH & A STORAGE SWITCH (MDS)

    Hi Guys,
    I had a very simple query. I had a very basic query. I wanted to know the difference between a switch which we connect to our campus netorks and switches connected to storage area networks. I dont mean the cost and stuff, but more into how they forward packets and the technologies. If I have a catalyst switch with 10Gb ports and a SAN switch with 10Gb ports , what would be the performance difference. what would be the difference in their forwarding mechanisms.

    Hi Rustom,
    The big difference is that the 10Gb ports on the Catalyst are ethernet and the 10Gb ports on the MDS switch are for Fibre Channel only.  You can't use the MDS ports for ethernet.
    Jim

  • The major difference between Oracle BC4J with WebSphere Business Components

    Hi BC4J/ADF experties:
    who could help to explian the difference betweenn IBM WebSphere Business Components(San Francisco) with Oracle BC4J(ADF) ? , the both product to emphasize Component-based developemnt but WebSphere Business Components have been define some enterprise base component that can provide extend and customize. how do you look up on this product strategy for developer ?

    I guess one difference is who can use it, for IBM components:
    Available for ISVs and Technology Partners only, and requires that the ISVs and Technology Partners have either a SanFrancisco Technology License Agreement, SanFrancisco Version 2 Development License or a SanFrancisco Version 2.1 OEM agreement and an appropriate transaction document executed under the respective base agreement.
    BC4J is for use by anybody who uses JDeveloper.
    IBM's solution seems to lock you into using Webssphere, with BC4J you can use whichever application server you want.
    I guess the problem is to find someone "who could help to explian IBM WebSphere Business Components" - I can't seem to find a good expenation of what it does, but it seems to be a set of functional components that do specific tasks.
    This is not what BC4J is about.
    IBM's solution forces you to use EJB. BC4J gives you a choice of deployment options.
    To understand what BC4J give you read:
    http://otn.oracle.com/products/jdev/collateral/tutorials/903/j2ee_bc4j/prnt/j2ee_bc4j.html

  • Difference between Production Supply Area and a Storage Location

    Hello Experts,
    Basic question but wanted to get more clarity on the concept as i never worked on the PSA
    Can someone tell me the exact difference between PSA and a SL. I understand PSA is a Kanban, WM and SL is an IM concept. Can a work center have a storage location assigned or just a PSA? Can a GI be done from PSA or just from a storage location.

    Hello
    The production supply area is a master data used by WM, while the storage location is used by MM-IM.
    Check this link for details:
    Production Supply Area - Warehouse Management System (WMS) - SAP Library
    The goods issue is done with reference to the storage location
    It is possible to assigne a storage location to a production supply area and assign the production supply area to the work center.
    BR
    Caetano

  • Better estimation of phase difference between two signals with variable frequency!

    Hello LabView Gurus, 
    Being a power engineer and having just a little knowledge of signal processing and labview, I have been pulling my hair out for the last couple of days to get a better estimation of phase difference between two signals.
    We have two analog voltage signals; 1. sine wave (50Hz ± 1Hz) and 2. a square wave with exactly half of sine wave frequency at any time.
    At the starting point of operation (and simulation/acquisition) both signals will have no phase difference. However, the square wave's frequency changes unpredictably for a just a few millisecond but then it gets synchronized with sine wave's frequency again. This means that the square wave will be phased out from its original position. The task of the labview is to find the phase difference between the two signals continuously.
    My approach to determine the phase difference is to measure the time when sine wave crosses zero amplitude and the time when the very next square wave changes amplitude from zero volts to +ve voltage (I have a 0.5volts threshold just to avoid any dramas from small line noise). The difference between these times is then divided by the time period and multiplied by 360 to get this phase difference in angles. 
    As this part is just a small block of a big project, I can only allow 5000Hz sampling rate each for both signals. I read 500 samples (which means I read data from 5 cycles of sine wave and 2.5 cycles of square wave).
    Now the problem is, as long as the frequency of sine wave stays constant at exactly 50Hz, I get a good estimation of the phase difference but when the frequency changes even a little (and it will happen in the real scenario i.e 50Hz ± 1Hz  and the square wave's frequency is dependent of sine wave's frequency), the estimation error increases.
    I have attached my labview program. From front panel, you can set the phase of square wave (between -180 and 0) and you should see the labview's calculated phase in the indicator box named 'Phase'. Then you can press 'Real Frequency' switch that would cause the frequency to change like it would in real operation.
    You can observe that the estimation error increases after you push the button. 
    All I need to do is to reduce this estimation error and make it as close to the actual phase difference as possible. Any help would be greatly appreciated.
    I am using LabView 2009 for this task.
    The application is for electric machines and the stability/performance of machines under different faults.
    Thank you for reading this far!
    Regards,
    Awais
    Attachments:
    v603.png ‏320 KB
    v603.vi ‏186 KB

    Jeff Bohrer wrote:
    Basic math gives me a bit of pause on this approach.  You are sampling at 50 times the frequency of interest so you get 50 samples per cycle.  your phase resolution is 1/50th cycle or 7.2 degrees +/- noise.  You will need to samlpe faster to reduce phase resolution or average multiple readings (at a time cost that is signifigant)
    Jeff- (Hardly Working)
    I am sampling at 100 times the sine wave's frequency and 200 times the square wave's frequency.  Increasing the sampling rate completely solves my problem. But since I am acquiring several other inputs, I cannot afford a sampling rate higher than 5kHz.
    F. Schubert wrote:
    I'm not a signal processing expert, but here my basic understanding.
    If you simulate sampling with 5kHz and a frequency of 50 Hz (and both are 'sync' by design), you always get an exact 5 periods. Any variation of your signals frequency gives you a propability to get 4 or 6 'trigger' events. That's an up or down of 20%!
    The one measure to reduce such problems is using 'window functions'. They don't fit your current approach (counting instead of a DSP algorithm), so this needs to be reworked as well.
    My approach would be to use the concept of a Locki-In amplifier. You need to phaseshift your ref-signal by 90°. Then multiply your measurement signal with the ref signal and the phase shifted ref signal. The obtained values for x/y coordinates of a complex number. Calculate the theta of the complex number (with the LV prim). Feed this in a low pass filter.
    The trick on this is, that the square wave has harmonics in it, in this you are interested in the second harmonic which is the sine wave.
    To get rid of the effect that the sync between sampling rate and ref signal frequency gives an error, you then can use the window I mentioned above (place it before the lock-in).
    For a design that really plays well, use a producer-consumer design pattern to get the calculations done in parallel with the DAQ.
    I suggest you to check on wikipedia for some of the keywords I mentioned. Go also for the external links which lead to great tutorials and AppNotes on the signal processing basics.
    Sorry, it's not a simple solution I offer and we will have quite some conversation on this forum if you follow this path. Maybe someone else knows a simpler way.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml
    An interesting view. the sine wave can indeed be looked as a second harmonic of the square wave. I will implement your idea and get back to you as soon as I get some results. But since I have very limited knowledge of signal processing, it might take me a while to get my hear around the solution you mentioned.

Maybe you are looking for

  • When i go to download something from itunes on my iPod touch it says "Your apple ID has been disabled"

    I had to call itunes bc my account had got hacked and they got that fixed and my account works i can sign in and sign out but when i go to download something or update an app on my ipod it comes up that my apple ID has been disabled. Does anyone know

  • Possible to use wired 10/100 ethernet for client device?

    I can't seem to find an answer to this question... I have a Airport Express that I connect to my stereo for streamed music in my living room. It's connected to my existing wireless network (Linksys WRT54G, WPA on). Works great. Airport Express is not

  • Bank Charges in PO

    Dear Experts, I have a scenario where in for a PO i will open LC aginst my Vendor in Bank & i paid some bank charges to bank . My PO is 100Rs and Bank charge is 20Rs & Total is 120Rs which should add to my material cost. this is getting add while pos

  • " ? extends Classifier " not assignable to Classifier

    I am just trying to understand this My method is like this public List<? extends Classifier> getClassifiers(){ Now if I use the loop like this I get the error "Type mismatch: cannot convert from element type ? extends Classifier to Classifier" for( C

  • How do I achive this dotted effect

    http://www.istockphoto.com/file_download_approved.php?RequestExtendedLicense=0&quantity_34 =1&quantity_35=1&quantity_36=1&quantity_37=1&quantity_38=1&quantity_39=1&quantity_40=1&IAg ree=&fileID=3781774&ConcreteTypeID=8&inPoint=0&outPoint=0&action=acc